My Project
Public Member Functions | List of all members
ParaEngine::CCommandLineParser Class Reference

command line parameter parser e.g. More...

#include <CommandLineParser.hpp>

Public Member Functions

 CCommandLineParser (const char *lpCmdLine=NULL)
 
const char * GetCommandLine ()
 get string specifying the command line for the application, excluding the program name. More...
 
const char * GetValue (const char *pParam, const char *defaultValue)
 return a specified parameter value in the command line of the application. More...
 
void SetCommandLine (const char *pCommandLine)
 set string specifying the command line for the application, excluding the program name. More...
 

Detailed Description

command line parameter parser e.g.

CCommandLineParser cmdLines("a=\"a_value" b="b_value"");

assert(std::string("a_value") == cmdLines.GetValue("a", "default_value")); assert(std::string("b_value") == cmdLines.GetValue("b", "default_value"));

Member Function Documentation

§ GetCommandLine()

const char* ParaEngine::CCommandLineParser::GetCommandLine ( )
inline

get string specifying the command line for the application, excluding the program name.

§ GetValue()

const char* ParaEngine::CCommandLineParser::GetValue ( const char *  pParam,
const char *  defaultValue 
)
inline

return a specified parameter value in the command line of the application.

If the parameter does not exist, the return value is NULL.

Parameters
pParamkey to get
defaultValueif the key does not exist, this value will be added and returned. This can be NULL.

§ SetCommandLine()

void ParaEngine::CCommandLineParser::SetCommandLine ( const char *  pCommandLine)
inline

set string specifying the command line for the application, excluding the program name.

calling this function multiple times with different command line is permitted. The latter settings will merge and override the previous ones. such as key="value" key2="value2"

extract parameters


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