[ox/clargs] Add default argument option for ClArgs::getString
This commit is contained in:
parent
d98a5e386a
commit
4276135e65
4
deps/ox/src/ox/clargs/clargs.cpp
vendored
4
deps/ox/src/ox/clargs/clargs.cpp
vendored
@ -42,8 +42,8 @@ bool ClArgs::getBool(const char *arg) {
|
||||
return m_bools[arg];
|
||||
}
|
||||
|
||||
string ClArgs::getString(const char *arg) {
|
||||
return m_strings[arg];
|
||||
string ClArgs::getString(const char *argName, const char *defaultArg) {
|
||||
return m_strings.count(argName) ? m_strings[argName] : defaultArg;
|
||||
}
|
||||
|
||||
int ClArgs::getInt(const char *arg) {
|
||||
|
2
deps/ox/src/ox/clargs/clargs.hpp
vendored
2
deps/ox/src/ox/clargs/clargs.hpp
vendored
@ -24,7 +24,7 @@ class ClArgs {
|
||||
|
||||
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);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user