ConsoleRule Class Reference

#include <ConsoleRule.h>

Inheritance diagram for ConsoleRule:

ConsoleRuleFn ConsoleRuleMethodIAdapter< T > ConsoleRuleMethodIAdapterEx< T > ConsoleRuleMethodIAdapterEx2< T >

List of all members.

Public Member Functions

 ConsoleRule (const char *name, const std::vector< ConsoleRuleParam > &params, unsigned int userData=0)
virtual ~ConsoleRule ()
virtual void runRule (Console *console, const char *wholeLine, std::vector< ConsoleRuleValue > &values)=0
std::string toString ()
std::string toString (std::vector< ConsoleRuleValue > &values)
const char * getName ()
std::vector
< ConsoleRuleParam > & 
getParams ()
unsigned int getUserData ()
bool matchesPartialParams (std::vector< ConsoleRuleValue > &values)
bool matchesExactParams (std::vector< ConsoleRuleValue > &values)

Static Public Member Functions

static std::string valuesToString (std::vector< ConsoleRuleValue > &values)

Protected Attributes

std::string name_
std::vector
< ConsoleRuleParam
params_
unsigned int userData_


Detailed Description

Definition at line 62 of file ConsoleRule.h.


Constructor & Destructor Documentation

ConsoleRule::ConsoleRule ( const char *  name,
const std::vector< ConsoleRuleParam > &  params,
unsigned int  userData = 0 
)

Definition at line 35 of file ConsoleRule.cpp.

ConsoleRule::~ConsoleRule (  )  [virtual]

Definition at line 44 of file ConsoleRule.cpp.


Member Function Documentation

virtual void ConsoleRule::runRule ( Console console,
const char *  wholeLine,
std::vector< ConsoleRuleValue > &  values 
) [pure virtual]

Implemented in ConsoleRuleFn, ConsoleRuleMethodIAdapter< T >, ConsoleRuleMethodIAdapterEx< T >, and ConsoleRuleMethodIAdapterEx2< T >.

Referenced by ConsoleRules::addLine().

std::string ConsoleRule::toString (  ) 

Definition at line 49 of file ConsoleRule.cpp.

References ConsoleRuleTypeBoolean, ConsoleRuleTypeNone, ConsoleRuleTypeNumber, ConsoleRuleTypeString, ConsoleRuleParam::getName(), getName(), ConsoleRuleParam::getType(), int(), and params_.

Referenced by ConsoleRules::dump(), and ConsoleRules::matchRule().

std::string ConsoleRule::toString ( std::vector< ConsoleRuleValue > &  values  ) 

Definition at line 76 of file ConsoleRule.cpp.

References ConsoleRuleTypeBoolean, ConsoleRuleTypeNone, ConsoleRuleTypeNumber, ConsoleRuleTypeString, ConsoleRuleParam::getName(), getName(), ConsoleRuleParam::getType(), int(), params_, and ConsoleRuleValue::valueString.

std::string ConsoleRule::valuesToString ( std::vector< ConsoleRuleValue > &  values  )  [static]

Definition at line 104 of file ConsoleRule.cpp.

References ConsoleRuleTypeBoolean, ConsoleRuleTypeNone, ConsoleRuleTypeNumber, ConsoleRuleTypeString, int(), ConsoleRuleValue::type, and ConsoleRuleValue::valueString.

Referenced by ConsoleRules::addLine().

const char* ConsoleRule::getName (  )  [inline]

Definition at line 79 of file ConsoleRule.h.

References name_.

Referenced by ConsoleRules::addRule(), ConsoleRules::matchRule(), and toString().

std::vector<ConsoleRuleParam>& ConsoleRule::getParams (  )  [inline]

Definition at line 80 of file ConsoleRule.h.

References params_.

Referenced by ConsoleRules::matchRule().

unsigned int ConsoleRule::getUserData (  )  [inline]

Definition at line 81 of file ConsoleRule.h.

References userData_.

bool ConsoleRule::matchesPartialParams ( std::vector< ConsoleRuleValue > &  values  ) 

Definition at line 161 of file ConsoleRule.cpp.

References _strnicmp, ConsoleRuleTypeBoolean, ConsoleRuleTypeNone, ConsoleRuleTypeNumber, ConsoleRuleTypeString, ConsoleRuleParam::getName(), ConsoleRuleParam::getType(), int(), params_, stricmp, LangStringUtil::strlen(), ConsoleRuleValue::type, and ConsoleRuleValue::valueString.

Referenced by ConsoleRules::matchRule().

bool ConsoleRule::matchesExactParams ( std::vector< ConsoleRuleValue > &  values  ) 

Definition at line 133 of file ConsoleRule.cpp.

References ConsoleRuleTypeBoolean, ConsoleRuleTypeNone, ConsoleRuleTypeNumber, ConsoleRuleTypeString, ConsoleRuleParam::getName(), ConsoleRuleParam::getType(), int(), params_, stricmp, ConsoleRuleValue::type, and ConsoleRuleValue::valueString.

Referenced by ConsoleRules::matchRule().


Member Data Documentation

std::string ConsoleRule::name_ [protected]

Reimplemented in ConsoleRuleMethodIAdapter< T >, ConsoleRuleMethodIAdapterEx< T >, and ConsoleRuleMethodIAdapterEx2< T >.

Definition at line 86 of file ConsoleRule.h.

Referenced by getName(), ConsoleRuleFn::getValue(), and ConsoleRuleFn::setValue().

std::vector<ConsoleRuleParam> ConsoleRule::params_ [protected]

Definition at line 87 of file ConsoleRule.h.

Referenced by getParams(), matchesExactParams(), matchesPartialParams(), and toString().

unsigned int ConsoleRule::userData_ [protected]

Definition at line 88 of file ConsoleRule.h.

Referenced by getUserData(), and ConsoleRuleMethodIAdapterEx2< T >::runRule().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:01 2009 for Scorched3D by  doxygen 1.5.3