mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Support hex entities in metadata
This commit is contained in:
@@ -209,13 +209,23 @@ void UtilityClass::updateglow()
|
||||
}
|
||||
}
|
||||
|
||||
bool is_positive_num(const std::string& str)
|
||||
bool is_positive_num(const std::string& str, bool hex)
|
||||
{
|
||||
for (size_t i = 0; i < str.length(); i++)
|
||||
{
|
||||
if (!std::isdigit(static_cast<unsigned char>(str[i])))
|
||||
if (hex)
|
||||
{
|
||||
return false;
|
||||
if (!std::isxdigit(static_cast<unsigned char>(str[i])))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!std::isdigit(static_cast<unsigned char>(str[i])))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user