[*] Update CmdLine prototype: AuOptional<const AuString &> GetValue(const AuString &key)
This commit is contained in:
parent
5c34a8435b
commit
cac3746bf0
@ -39,11 +39,11 @@ namespace Aurora::CmdLine
|
||||
AUKN_SYM const AuString &GetValue(const AuString &key, const AuString &defaultValue);
|
||||
|
||||
/**
|
||||
* @brief Returns part after key= or an empty string
|
||||
* @brief Returns part after key=
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
AUKN_SYM const AuString &GetValue(const AuString &key);
|
||||
AUKN_SYM AuOptional<const AuString &> GetValue(const AuString &key);
|
||||
|
||||
/**
|
||||
* @brief Returns a constant array of values; key=values and /key values
|
||||
|
@ -38,13 +38,24 @@ namespace Aurora::CmdLine
|
||||
AUKN_SYM const AuString &GetValue(const AuString &key, const AuString &defaultValue)
|
||||
{
|
||||
auto itr = gCmdValueMap.find(key);
|
||||
if (itr == gCmdValueMap.end()) return defaultValue;
|
||||
if (itr == gCmdValueMap.end())
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
return itr->second;
|
||||
}
|
||||
}
|
||||
|
||||
AUKN_SYM const AuString &GetValue(const AuString &key)
|
||||
AUKN_SYM AuOptional<const AuString &> GetValue(const AuString &key)
|
||||
{
|
||||
return GetValue(key, kEmptyString);
|
||||
auto itr = gCmdValueMap.find(key);
|
||||
if (itr == gCmdValueMap.end())
|
||||
{
|
||||
return AuOptional<const AuString &> {};
|
||||
}
|
||||
return itr->second;
|
||||
}
|
||||
|
||||
AUKN_SYM const AuList<AuString> &GetValues(const AuString &key)
|
||||
|
Loading…
Reference in New Issue
Block a user