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

  1. #include "CCmd.h"
  2. #include <string.h>
  3.  
  4. /*
  5.     CCmd is an abstract class, so this constructor is only used to init the fields.
  6. */
  7. CCmd::CCmd(const char* name){
  8.     this->name=name;
  9.     infoStr=NULL;
  10.     usageStr=NULL;
  11.     flags=CON_FLAG_ALL_SET;
  12. }
  13.  
  14. /*
  15.     We give an implementation for the virtual destructor of CCmd for the compiler
  16. */
  17. CCmd::~CCmd(){
  18. }
  19.  
  20. /*
  21.     sets the console to whitch the ccmd is attached
  22. */
  23. void CCmd::setConsole(Console* con){
  24.     console=con;
  25. }
  26.  
  27. /*
  28.     Same as for CVar
  29. */
  30. char* CCmd::getFlagsStr(char* buff){
  31. /*
  32.     buff[0]= (flags & CON_FLAG_SERVER_READ) ? 'r' : '-';
  33.     buff[1]= (flags & CON_FLAG_SERVER_WRITE) ? 'w' : '-';
  34.     buff[2]= (flags & CON_FLAG_SERVER_EXECUTE) ? 'x' : '-';
  35.     buff[3]= '|';
  36.     buff[4]= (flags & CON_FLAG_CLIENT_READ) ? 'r' : '-';
  37.     buff[5]= (flags & CON_FLAG_CLIENT_WRITE) ? 'w' : '-';
  38.     buff[6]= (flags & CON_FLAG_CLIENT_EXECUTE) ? 'x' : '-';
  39.     buff[7]= '\0';
  40. */
  41.     
  42.     strcpy(buff, "[exe]");
  43.  
  44.     return buff;
  45. }
  46.