36 return m_sAppCmdLine.c_str();
44 const char*
GetValue(
const char* pParam,
const char* defaultValue)
46 std::map<string, string>::iterator it = m_commandParams.find(pParam);
47 if(it!= m_commandParams.end())
49 return (*it).second.c_str();
51 if(defaultValue!=NULL)
53 m_commandParams[pParam] = defaultValue;
54 return m_commandParams[pParam].c_str();
66 m_sAppCmdLine = pCommandLine;
68 m_sAppCmdLine.clear();
74 while((nPos =(
int) m_sAppCmdLine.find(
'=', nBegin))!=string::npos)
77 int nFromPos = (int)m_sAppCmdLine.find(
'\"', nBegin+1);
78 if(nFromPos!=(
int)string::npos)
80 int nToPos = (int)m_sAppCmdLine.find(
'\"', nFromPos+1);
81 if(nToPos!=(
int)string::npos)
86 for(;(m_sAppCmdLine[nBegin] ==
' '|| m_sAppCmdLine[nBegin] ==
'\t' || m_sAppCmdLine[nBegin] ==
'\n' || m_sAppCmdLine[nBegin] ==
'\r'); nBegin++)
88 for(;nPos>=1 && (m_sAppCmdLine[nPos-1] ==
' '|| m_sAppCmdLine[nPos-1] ==
'\t' || m_sAppCmdLine[nPos-1] ==
'\n' || m_sAppCmdLine[nPos-1] ==
'\r'); nPos--)
92 m_commandParams[m_sAppCmdLine.substr(nBegin, nPos-nBegin)] = m_sAppCmdLine.substr(nFromPos+1, nToPos - nFromPos-1);
107 std::string m_sAppCmdLine;
110 std::map<std::string, std::string> m_commandParams;
void SetCommandLine(const char *pCommandLine)
set string specifying the command line for the application, excluding the program name...
Definition: CommandLineParser.hpp:63
const char * GetCommandLine()
get string specifying the command line for the application, excluding the program name...
Definition: CommandLineParser.hpp:34
different physics engine has different winding order.
Definition: EventBinding.h:32
const char * GetValue(const char *pParam, const char *defaultValue)
return a specified parameter value in the command line of the application.
Definition: CommandLineParser.hpp:44
command line parameter parser e.g.
Definition: CommandLineParser.hpp:24