[ox/clargs] Add default argument option for ClArgs::getString

This commit is contained in:
Gary Talent 2020-12-21 23:35:09 -06:00
parent d98a5e386a
commit 4276135e65
2 changed files with 3 additions and 3 deletions

View File

@ -42,8 +42,8 @@ bool ClArgs::getBool(const char *arg) {
return m_bools[arg]; return m_bools[arg];
} }
string ClArgs::getString(const char *arg) { string ClArgs::getString(const char *argName, const char *defaultArg) {
return m_strings[arg]; return m_strings.count(argName) ? m_strings[argName] : defaultArg;
} }
int ClArgs::getInt(const char *arg) { int ClArgs::getInt(const char *arg) {

View File

@ -24,7 +24,7 @@ class ClArgs {
bool getBool(const char *arg); bool getBool(const char *arg);
::std::string getString(const char *arg); ::std::string getString(const char *argName, const char *defaultArg = "");
int getInt(const char *arg); int getInt(const char *arg);
}; };