diff options
Diffstat (limited to 'mpeglib/example/yaf/yafcore/commandTable.h')
-rw-r--r-- | mpeglib/example/yaf/yafcore/commandTable.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/mpeglib/example/yaf/yafcore/commandTable.h b/mpeglib/example/yaf/yafcore/commandTable.h new file mode 100644 index 00000000..75dd4325 --- /dev/null +++ b/mpeglib/example/yaf/yafcore/commandTable.h @@ -0,0 +1,82 @@ +/* + valid Commands for Input/Output + Copyright (C) 1998 Martin Vogt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation. + + For more information look at the file COPYRIGHT in this package + + */ + + + +#ifndef __COMMANDTABLE_H +#define __COMMANDTABLE_H + + +extern"C" { +#include <string.h> +#include <stdio.h> +} + +#include <kdemacros.h> + +#define _CT_START 40 + + + + + + +struct CommandDescriptionStruct { + + int lexternalUse; // written when user enters "help" + + // this field can be used to deliver a delayed return msg + int lReturn; // true generate ret-msg automatically + + const char* longName; + const char* shortName; + int number; + const char* help; +}; + + +typedef struct CommandDescriptionStruct CommandDescription; + + +class KDE_EXPORT CommandTable { + + int nCommandDesc; + CommandDescription commandDesc[50]; + + public: + CommandTable(); + virtual ~CommandTable(); + void insert(CommandDescription* cmdDesc); + + + int getNr(const char* name); + const char* getCommand(const char* name); + const char* getCommand(int nr); + const char* getArgs(const char* command,const char* wholeLine); + + int getReturnFlag(int cmdNr); + void print(); + void print (int i,int lWithHelp); + + int getCommandCounter(); + void join(CommandTable* table); // join two tables (no deep join!) + + private: + CommandDescription* getCommandDescription(int i); + int getPos(int commandNr); +}; + + +#endif + + + |