18 #include "precompiled.h"
27 std::string arg0(argv[0]);
30 std::replace(arg0.begin(), arg0.end(),
'/',
SYS_DIR_SEP);
34 for (
int i = 1; i < argc; ++i)
37 if (argv[i][0] !=
'-')
43 const char* eq = strchr(argv[i],
'=');
46 name = CStr(argv[i]+1, eq-argv[i]-1);
51 name = CStr(argv[i]+1);
54 m_Args.push_back(make_pair(name, value));
63 template<
typename S>
bool operator()(
const S& v) {
return v.first ==
x; }
82 std::vector<CStr> values;
83 ArgsT::const_iterator it =
m_Args.begin();
89 values.push_back(it->second);
CStr Get(const char *name) const
Get the value of the named parameter.
OsPath GetArg0() const
Get the value of argv[0], which is typically meant to be the name/path of the program (but the actual...
std::vector< CStr > GetMultiple(const char *name) const
Get all the values given to the named parameter.
#define SYS_DIR_SEP
directory separation character
bool Has(const char *name) const
Test whether the given name was specified, as either -name or -name=value
bool operator()(const S &v)
#define T(string_literal)