[ox/clargs] Replace C string with StringView
All checks were successful
Build / build (push) Successful in 2m27s
All checks were successful
Build / build (push) Successful in 2m27s
This commit is contained in:
parent
043df533b7
commit
17f28d43d1
2
deps/ox/src/ox/clargs/clargs.cpp
vendored
2
deps/ox/src/ox/clargs/clargs.cpp
vendored
@ -42,7 +42,7 @@ bool ClArgs::getBool(ox::CRStringView arg, bool defaultValue) const noexcept {
|
||||
return !err ? *value : defaultValue;
|
||||
}
|
||||
|
||||
String ClArgs::getString(ox::CRStringView arg, const char *defaultValue) const noexcept {
|
||||
String ClArgs::getString(ox::CRStringView arg, ox::StringView defaultValue) const noexcept {
|
||||
auto [value, err] = m_strings.at(arg);
|
||||
return !err ? ox::String(*value) : ox::String(defaultValue);
|
||||
}
|
||||
|
2
deps/ox/src/ox/clargs/clargs.hpp
vendored
2
deps/ox/src/ox/clargs/clargs.hpp
vendored
@ -26,7 +26,7 @@ class ClArgs {
|
||||
bool getBool(ox::CRStringView arg, bool defaultValue) const noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
String getString(ox::CRStringView argName, const char *defaultValue) const noexcept;
|
||||
String getString(ox::CRStringView argName, ox::StringView defaultValue) const noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
int getInt(ox::CRStringView arg, int defaultValue) const noexcept;
|
||||
|
Loading…
Reference in New Issue
Block a user