diff --git a/deps/ox/src/ox/clargs/clargs.cpp b/deps/ox/src/ox/clargs/clargs.cpp index 26c52c5b..35aacf65 100644 --- a/deps/ox/src/ox/clargs/clargs.cpp +++ b/deps/ox/src/ox/clargs/clargs.cpp @@ -6,26 +6,24 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include +#include #include "clargs.hpp" namespace ox { -using namespace ::std; - ClArgs::ClArgs(int argc, const char **args) { for (int i = 0; i < argc; i++) { - string arg = args[i]; + String arg = args[i]; if (arg[0] == '-') { - while (arg[0] == '-' && arg.size()) { - arg = arg.substr(1); + while (arg[0] == '-' && arg.len()) { + arg = arg.c_str() + 1; } m_bools[arg] = true; // parse additional arguments if (i < argc && args[i + 1]) { - string val = args[i + 1]; - if (val.size() && val[i] != '-') { + String val = args[i + 1]; + if (val.len() && val[i] != '-') { if (val == "false") { m_bools[arg] = false; } @@ -42,8 +40,8 @@ bool ClArgs::getBool(const char *arg) { return m_bools[arg]; } -string ClArgs::getString(const char *argName, const char *defaultArg) { - return m_strings.count(argName) ? m_strings[argName] : defaultArg; +String ClArgs::getString(const char *argName, const char *defaultArg) { + return m_strings.contains(argName) ? m_strings[argName].c_str() : defaultArg; } int ClArgs::getInt(const char *arg) { diff --git a/deps/ox/src/ox/clargs/clargs.hpp b/deps/ox/src/ox/clargs/clargs.hpp index c7cea3a2..3346e038 100644 --- a/deps/ox/src/ox/clargs/clargs.hpp +++ b/deps/ox/src/ox/clargs/clargs.hpp @@ -8,23 +8,24 @@ #pragma once -#include -#include +#include namespace ox { +class String; + class ClArgs { private: - ::std::map<::std::string, bool> m_bools; - ::std::map<::std::string, ::std::string> m_strings; - ::std::map<::std::string, int> m_ints; + HashMap m_bools; + HashMap m_strings; + HashMap m_ints; public: ClArgs(int argc, const char **args); bool getBool(const char *arg); - ::std::string getString(const char *argName, const char *defaultArg = ""); + String getString(const char *argName, const char *defaultArg = ""); int getInt(const char *arg); };