Changeset 6021 for code/trunk/src/libraries/core/CommandLineParser.h
- Timestamp:
- Nov 4, 2009, 12:28:59 PM (15 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/CommandLineParser.h
r6014 r6021 38 38 #define SetCommandLineArgument(name, defaultValue) \ 39 39 orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \ 40 = orxonox::CommandLine ::addArgument(#name, defaultValue, false)40 = orxonox::CommandLineParser::addArgument(#name, defaultValue, false) 41 41 #define SetCommandLineOnlyArgument(name, defaultValue) \ 42 42 orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \ 43 = orxonox::CommandLine ::addArgument(#name, defaultValue, true)43 = orxonox::CommandLineParser::addArgument(#name, defaultValue, true) 44 44 #define SetCommandLineSwitch(name) \ 45 45 orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \ 46 = orxonox::CommandLine ::addArgument(#name, false, false)46 = orxonox::CommandLineParser::addArgument(#name, false, false) 47 47 #define SetCommandLineOnlySwitch(name) \ 48 48 orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \ 49 = orxonox::CommandLine ::addArgument(#name, false, true)49 = orxonox::CommandLineParser::addArgument(#name, false, true) 50 50 51 51 … … 67 67 68 68 Retrieving an argument is possible with the getCommandLineArgument function of the 69 CommandLine class. It is a Singleton, but the public interface is static.69 CommandLineParser class. It is a Singleton, but the public interface is static. 70 70 */ 71 71 class _CoreExport CommandLineArgument 72 72 { 73 friend class CommandLine ;73 friend class CommandLineParser; 74 74 75 75 public: … … 137 137 CommandLineArgument 138 138 */ 139 class _CoreExport CommandLine 139 class _CoreExport CommandLineParser 140 140 { 141 141 public: … … 167 167 private: 168 168 //! Constructor initialises bFirstTimeParse_ with true. 169 CommandLine () : bFirstTimeParse_(true) { }169 CommandLineParser() : bFirstTimeParse_(true) { } 170 170 //! Undefined copy constructor 171 CommandLine (const CommandLine& instance);172 ~CommandLine ();173 174 static CommandLine & _getInstance();171 CommandLineParser(const CommandLineParser& instance); 172 ~CommandLineParser(); 173 174 static CommandLineParser& _getInstance(); 175 175 176 176 void _parseCommandLine(const std::string& cmdLine); … … 194 194 195 195 template <> 196 inline void CommandLine ::getValue<std::string>(const std::string& name, std::string* value)196 inline void CommandLineParser::getValue<std::string>(const std::string& name, std::string* value) 197 197 { 198 198 *value = getArgument(name)->getValue().getString(); … … 209 209 */ 210 210 template <class T> 211 CommandLineArgument& CommandLine ::addArgument(const std::string& name, T defaultValue, bool bCommandLineOnly)211 CommandLineArgument& CommandLineParser::addArgument(const std::string& name, T defaultValue, bool bCommandLineOnly) 212 212 { 213 213 OrxAssert(!_getInstance().existsArgument(name),
Note: See TracChangeset
for help on using the changeset viewer.