home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 March / ENTER.ISO / files / fwp-0.0.6-win32-installer.exe / CCmd.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-12-06  |  980 b   |  34 lines

  1. #ifndef __CCmd_h__
  2. #define __CCmd_h__
  3.  
  4. #include "Console.h"
  5.  
  6. /*
  7.     This is the mother of all ccmds.
  8.     It is an abstract class witch only defines the interface
  9. */
  10. class CCmd{
  11. public:
  12.     const char* name;            /* name of the ccmd */
  13.     const char* infoStr;        /* string to be displayed by 'info'-cmd */
  14.     const char* usageStr;        /* string to be displayed by 'usage'-cmd */
  15.  
  16.     unsigned short flags;    /* accessability flags */
  17.  
  18.     CCmd(const char* name);    /* since CCmd is an abstract class, this only sets the name variable */
  19.     virtual ~CCmd()=0;    /* make this class abstract, so only the derivates can be used */
  20.  
  21.     virtual bool exec(int argc, char* argv[])=0;    /* exec ccmd with arguments */
  22.     void setConsole(Console* con);            /* links the ccmd to Console 'con'*/
  23.  
  24.     char* getFlagsStr(char* buff);    /* writes a string describing the accessability-flags into buff */
  25.  
  26. protected:
  27.     Console* console;    /* Console to whitch the ccmd is attached */
  28. };
  29.  
  30.  
  31.  
  32.  
  33. #endif    /* __CCmd_h__ */
  34.