This commit is contained in:
Branimir Karadžić
2017-11-27 23:10:20 -08:00
parent 5585eb69d4
commit 148bdc60fa
5 changed files with 32 additions and 30 deletions

View File

@@ -1043,6 +1043,20 @@ namespace bx
return hd.d;
}
int32_t toString(char* _out, int32_t _max, bool _value)
{
StringView str(_value ? "true" : "false");
strCopy(_out, _max, str);
return str.getLength();
}
bool fromString(bool* _out, const StringView& _str)
{
char ch = toLower(_str.getPtr()[0]);
*_out = ch == 't' || ch == '1';
return 0 != _str.getLength();
}
bool fromString(float* _out, const StringView& _str)
{
double dbl;