# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLMISC::ICommand Class Reference

Create a function that can be call in realtime. More...

#include <command.h>

Inheritance diagram for NLMISC::ICommand:

NLMISC::CVariable List of all members.

Public Types

typedef std::map< std::string,
ICommand * > 
TCommand
enum  TType { Unknown, Command, Variable }

Public Methods

 ICommand (const char *commandName, const char *commandHelp, const char *commandArgs)
 Constructor. More...

virtual ICommand::~ICommand ()
virtual bool execute (const std::vector< std::string > &args, NLMISC::CLog &log)=0

Static Public Methods

void execute (const std::string &commandWithArgs, NLMISC::CLog &log, bool quiet=false)
 Executes the command and display output to the log
Parameters:
quiet  true if you don't want to display the "executing the command ...".
More...


void expand (std::string &commandName, NLMISC::CLog &log=*InfoLog)
 Command name completion. More...

void serialCommands (IStream &f)

Public Attributes

std::string HelpString
std::string CommandArgs
TType Type

Static Public Attributes

TCommandCommands
bool CommandsInit

Protected Attributes

std::string _CommandName

Detailed Description

Create a function that can be call in realtime.

Don't use this class directly but use the macro NLMISC_COMMAND

Author:
Vianney Lecroart , Nevrax France
Date:
2001

Definition at line 176 of file command.h.


Member Typedef Documentation

typedef std::map<std::string, ICommand *> NLMISC::ICommand::TCommand
 

Definition at line 196 of file command.h.

Referenced by ICommand.


Member Enumeration Documentation

enum NLMISC::ICommand::TType
 

Enumeration values:
Unknown 
Command 
Variable 

Definition at line 191 of file command.h.


Constructor & Destructor Documentation

NLMISC::ICommand::ICommand const char *    commandName,
const char *    commandHelp,
const char *    commandArgs
 

Constructor.

Definition at line 38 of file command.cpp.

References _CommandName, Command, CommandArgs, Commands, CommandsInit, HelpString, nlstopex, TCommand, and Type.

Referenced by NLMISC::CVariable::CVariable.

virtual NLMISC::ICommand::ICommand::~ICommand   [virtual]
 


Member Function Documentation

void NLMISC::ICommand::execute const std::string &    commandWithArgs,
NLMISC::CLog   log,
bool    quiet = false
[static]
 

Executes the command and display output to the log

Parameters:
quiet  true if you don't want to display the "executing the command ...".

Definition at line 103 of file command.cpp.

virtual bool NLMISC::ICommand::execute const std::vector< std::string > &    args,
NLMISC::CLog   log
[pure virtual]
 

Implemented in NLMISC::CVariable.

void NLMISC::ICommand::expand std::string &    commandName,
NLMISC::CLog   log = *InfoLog
[static]
 

Command name completion.

Case-sensitive. Displays the list after two calls with the same non-unique completion. Completes commands used with prefixes (such as "help " for example) as well.

Definition at line 252 of file command.cpp.

References NLMISC::CLog::displayNL, and NLMISC::strlwr.

void NLMISC::ICommand::serialCommands IStream   f [static]
 

Definition at line 348 of file command.cpp.


Member Data Documentation

std::string NLMISC::ICommand::_CommandName [protected]
 

Definition at line 215 of file command.h.

Referenced by NLMISC::CVariable::execute, and ICommand.

std::string NLMISC::ICommand::CommandArgs
 

Definition at line 188 of file command.h.

Referenced by ICommand.

ICommand::TCommand * NLMISC::ICommand::Commands [static]
 

Definition at line 35 of file command.cpp.

Referenced by ICommand.

bool NLMISC::ICommand::CommandsInit [static]
 

Definition at line 36 of file command.cpp.

Referenced by ICommand.

std::string NLMISC::ICommand::HelpString
 

Definition at line 187 of file command.h.

Referenced by ICommand.

TType NLMISC::ICommand::Type
 

Definition at line 192 of file command.h.

Referenced by NLMISC::CVariable::CVariable, and ICommand.


The documentation for this class was generated from the following files: