Changeset 952 for code/branches/core2/src/orxonox/core/CommandExecutor.h
- Timestamp:
- Mar 29, 2008, 3:04:06 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core2/src/orxonox/core/CommandExecutor.h
r951 r952 40 40 namespace orxonox 41 41 { 42 enum CommandState 43 { 44 CS_Empty, 45 CS_FunctionClass_Or_Shortcut_Or_Keyword, 46 CS_Shortcut_Params, 47 CS_Shortcut_Finished, 48 CS_Function, 49 CS_Function_Params, 50 CS_Function_Finished, 51 CS_ConfigValueClass, 52 CS_ConfigValue, 53 CS_ConfigValueType, 54 CS_ConfigValueFinished, 55 CS_KeybindKey, 56 CS_KeybindCommand, 57 CS_KeybindFinished, 58 CS_Error 59 }; 60 61 class _CoreExport CommandEvaluation 62 { 63 public: 64 std::string processedCommand_; 65 SubString tokens_; 66 std::list<const std::string*> listOfPossibleFunctionClasses_; 67 std::list<const std::string*> listOfPossibleShortcuts_; 68 std::list<const std::string*> listOfPossibleFunctions_; 69 std::list<const std::string*> listOfPossibleConfigValueClasses_; 70 std::list<const std::string*> listOfPossibleConfigValues_; 71 std::list<const std::string*> listOfPossibleKeys_; 72 73 Identifier* functionclass_; 74 Identifier* configvalueclass_; 75 ExecutorStatic* shortcut_; 76 ExecutorStatic* function_; 77 ConfigValueContainer* configvalue_; 78 ConfigValueContainer* key_; 79 80 std::string errorMessage_; 81 CommandState state_; 82 }; 83 42 84 class _CoreExport CommandExecutor 43 85 { 44 enum CommandState45 {46 CS_Empty,47 CS_FunctionClass_Or_Shortcut_Or_Keyword,48 CS_Shortcut_Params,49 CS_Shortcut_Finished,50 CS_Function,51 CS_Function_Params,52 CS_Function_Finished,53 CS_ConfigValueClass,54 CS_ConfigValue,55 CS_ConfigValueType,56 CS_ConfigValueFinished,57 CS_KeybindKey,58 CS_KeybindCommand,59 CS_KeybindFinished,60 CS_Error61 };62 63 86 public: 64 87 static bool execute(const std::string& command); 88 static bool execute(const CommandEvaluation& evaluation); 89 65 90 static std::string complete(const std::string& command); 91 static std::string complete(const CommandEvaluation& evaluation); 92 66 93 static std::string hint(const std::string& command); 94 static std::string hint(const CommandEvaluation& evaluation); 95 96 static const CommandEvaluation& evaluate(const std::string& command); 67 97 68 98 static bool addConsoleCommandShortcut(ExecutorStatic* executor); … … 90 120 91 121 static CommandExecutor& getInstance(); 122 static CommandEvaluation& getEvaluation(); 92 123 93 124 static void parse(const std::string& command, bool bInitialize = true); … … 123 154 static ConfigValueContainer* getContainerOfPossibleKey(const std::string& name); 124 155 125 std::string lastProcessedCommand_; 126 SubString tokens_; 127 std::list<const std::string*> listOfPossibleFunctionClasses_; 128 std::list<const std::string*> listOfPossibleShortcuts_; 129 std::list<const std::string*> listOfPossibleFunctions_; 130 std::list<const std::string*> listOfPossibleConfigValueClasses_; 131 std::list<const std::string*> listOfPossibleConfigValues_; 132 std::list<const std::string*> listOfPossibleKeys_; 133 134 Identifier* functionclass_; 135 Identifier* configvalueclass_; 136 ExecutorStatic* shortcut_; 137 ExecutorStatic* function_; 138 ConfigValueContainer* configvalue_; 139 ConfigValueContainer* key_; 140 141 std::string errorMessage_; 142 CommandState state_; 156 CommandEvaluation evaluation_; 143 157 144 158 std::map<std::string, ExecutorStatic*> consoleCommandShortcuts_;
Note: See TracChangeset
for help on using the changeset viewer.