[DEBUG] template specific implementation with gcc error
This commit is contained in:
parent
2c6a1b8fc8
commit
9da43a7107
@ -427,33 +427,34 @@ std::string etk::regexp::strTick(int32_t _pos) {
|
||||
|
||||
|
||||
|
||||
|
||||
template<> std::string etk::to_string<etk::RegExp<std::string>>(const etk::RegExp<std::string>& _val) {
|
||||
namespace etk {
|
||||
template<> std::string to_string<etk::RegExp<std::string>>(const etk::RegExp<std::string>& _val) {
|
||||
return _val.getRegExp();
|
||||
}
|
||||
template<> std::string etk::to_string<etk::RegExp<std::u32string>>(const etk::RegExp<std::u32string>& _val) {
|
||||
template<> std::string to_string<etk::RegExp<std::u32string>>(const etk::RegExp<std::u32string>& _val) {
|
||||
return _val.getRegExp();
|
||||
}
|
||||
template<> std::u32string etk::to_u32string<etk::RegExp<std::string>>(const etk::RegExp<std::string>& _val) {
|
||||
template<> std::u32string to_u32string<etk::RegExp<std::string>>(const etk::RegExp<std::string>& _val) {
|
||||
return _val.getURegExp();
|
||||
}
|
||||
template<> std::u32string etk::to_u32string<etk::RegExp<std::u32string>>(const etk::RegExp<std::u32string>& _val) {
|
||||
template<> std::u32string to_u32string<etk::RegExp<std::u32string>>(const etk::RegExp<std::u32string>& _val) {
|
||||
return _val.getURegExp();
|
||||
}
|
||||
|
||||
template<> bool etk::from_string<etk::RegExp<std::string>>(etk::RegExp<std::string>& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<etk::RegExp<std::string>>(etk::RegExp<std::string>& _variableRet, const std::u32string& _value) {
|
||||
_variableRet.compile(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<etk::RegExp<std::u32string>>(etk::RegExp<std::u32string>& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<etk::RegExp<std::u32string>>(etk::RegExp<std::u32string>& _variableRet, const std::u32string& _value) {
|
||||
_variableRet.compile(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<etk::RegExp<std::string>>(etk::RegExp<std::string>& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<etk::RegExp<std::string>>(etk::RegExp<std::string>& _variableRet, const std::string& _value) {
|
||||
_variableRet.compile(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<etk::RegExp<std::u32string>>(etk::RegExp<std::u32string>& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<etk::RegExp<std::u32string>>(etk::RegExp<std::u32string>& _variableRet, const std::string& _value) {
|
||||
_variableRet.compile(_value);
|
||||
return true;
|
||||
}
|
||||
};
|
@ -362,11 +362,7 @@ namespace etk {
|
||||
TK_VERBOSE("Parse : \"" << _str << "\" ==> " << *this);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
template<> std::string etk::to_string<vec2>(const vec2& _obj) {
|
||||
template<> std::string to_string<vec2>(const vec2& _obj) {
|
||||
std::string str;
|
||||
str = "(";
|
||||
str += etk::to_string(_obj.x());
|
||||
@ -375,11 +371,11 @@ template<> std::string etk::to_string<vec2>(const vec2& _obj) {
|
||||
str += ")";
|
||||
return str;
|
||||
}
|
||||
template<> std::u32string etk::to_u32string<vec2>(const vec2& _obj) {
|
||||
template<> std::u32string to_u32string<vec2>(const vec2& _obj) {
|
||||
return etk::to_u32string(etk::to_string(_obj));
|
||||
}
|
||||
|
||||
template<> std::string etk::to_string<ivec2>(const ivec2& _obj) {
|
||||
template<> std::string to_string<ivec2>(const ivec2& _obj) {
|
||||
std::string str;
|
||||
str = "(";
|
||||
str += etk::to_string(_obj.x());
|
||||
@ -388,11 +384,11 @@ template<> std::string etk::to_string<ivec2>(const ivec2& _obj) {
|
||||
str += ")";
|
||||
return str;
|
||||
}
|
||||
template<> std::u32string etk::to_u32string<ivec2>(const ivec2& _obj) {
|
||||
template<> std::u32string to_u32string<ivec2>(const ivec2& _obj) {
|
||||
return etk::to_u32string(etk::to_string(_obj));
|
||||
}
|
||||
|
||||
template<> std::string etk::to_string<uivec2>(const uivec2& _obj) {
|
||||
template<> std::string to_string<uivec2>(const uivec2& _obj) {
|
||||
std::string str;
|
||||
str = "(";
|
||||
str += etk::to_string(_obj.x());
|
||||
@ -401,11 +397,11 @@ template<> std::string etk::to_string<uivec2>(const uivec2& _obj) {
|
||||
str += ")";
|
||||
return str;
|
||||
}
|
||||
template<> std::u32string etk::to_u32string<uivec2>(const uivec2& _obj) {
|
||||
template<> std::u32string to_u32string<uivec2>(const uivec2& _obj) {
|
||||
return etk::to_u32string(etk::to_string(_obj));
|
||||
}
|
||||
|
||||
template<> std::string etk::to_string<bvec2>(const bvec2& _obj) {
|
||||
template<> std::string to_string<bvec2>(const bvec2& _obj) {
|
||||
std::string str;
|
||||
str = "(";
|
||||
str += etk::to_string(_obj.x());
|
||||
@ -414,39 +410,39 @@ template<> std::string etk::to_string<bvec2>(const bvec2& _obj) {
|
||||
str += ")";
|
||||
return str;
|
||||
}
|
||||
template<> std::u32string etk::to_u32string<bvec2>(const bvec2& _obj) {
|
||||
template<> std::u32string to_u32string<bvec2>(const bvec2& _obj) {
|
||||
return etk::to_u32string(etk::to_string(_obj));
|
||||
}
|
||||
|
||||
template<> bool etk::from_string<vec2>(vec2& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<vec2>(vec2& _variableRet, const std::string& _value) {
|
||||
_variableRet = vec2(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<vec2>(vec2& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<vec2>(vec2& _variableRet, const std::u32string& _value) {
|
||||
return from_string(_variableRet, etk::to_string(_value));
|
||||
}
|
||||
|
||||
template<> bool etk::from_string<ivec2>(ivec2& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<ivec2>(ivec2& _variableRet, const std::string& _value) {
|
||||
_variableRet = ivec2(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<ivec2>(ivec2& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<ivec2>(ivec2& _variableRet, const std::u32string& _value) {
|
||||
return from_string(_variableRet, etk::to_string(_value));
|
||||
}
|
||||
|
||||
template<> bool etk::from_string<uivec2>(uivec2& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<uivec2>(uivec2& _variableRet, const std::string& _value) {
|
||||
_variableRet = uivec2(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<uivec2>(uivec2& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<uivec2>(uivec2& _variableRet, const std::u32string& _value) {
|
||||
return from_string(_variableRet, etk::to_string(_value));
|
||||
}
|
||||
|
||||
template<> bool etk::from_string<bvec2>(bvec2& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<bvec2>(bvec2& _variableRet, const std::string& _value) {
|
||||
_variableRet = bvec2(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<bvec2>(bvec2& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<bvec2>(bvec2& _variableRet, const std::u32string& _value) {
|
||||
return from_string(_variableRet, etk::to_string(_value));
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -110,8 +110,8 @@ vec3 quaternionToEulerXYZ(const btQuaternion& _quat) {
|
||||
atan2(2.0*(xxx*yyy + zzz*www), (xxx2-yyy2-zzz2+www2) ) );
|
||||
}
|
||||
|
||||
|
||||
template<> std::string etk::to_string<vec3>(const vec3& _obj) {
|
||||
namespace etk {
|
||||
template<> std::string to_string<vec3>(const vec3& _obj) {
|
||||
std::string str;
|
||||
str = "(";
|
||||
str += etk::to_string(_obj.x());
|
||||
@ -122,11 +122,11 @@ template<> std::string etk::to_string<vec3>(const vec3& _obj) {
|
||||
str += ")";
|
||||
return str;
|
||||
}
|
||||
template<> std::u32string etk::to_u32string<vec3>(const vec3& _obj) {
|
||||
template<> std::u32string to_u32string<vec3>(const vec3& _obj) {
|
||||
return etk::to_u32string(etk::to_string(_obj));
|
||||
}
|
||||
|
||||
template<> std::string etk::to_string<ivec3>(const ivec3& _obj) {
|
||||
template<> std::string to_string<ivec3>(const ivec3& _obj) {
|
||||
std::string str;
|
||||
str = "(";
|
||||
str += etk::to_string(_obj.x());
|
||||
@ -137,11 +137,11 @@ template<> std::string etk::to_string<ivec3>(const ivec3& _obj) {
|
||||
str += ")";
|
||||
return str;
|
||||
}
|
||||
template<> std::u32string etk::to_u32string<ivec3>(const ivec3& _obj) {
|
||||
template<> std::u32string to_u32string<ivec3>(const ivec3& _obj) {
|
||||
return etk::to_u32string(etk::to_string(_obj));
|
||||
}
|
||||
|
||||
template<> std::string etk::to_string<uivec3>(const uivec3& _obj) {
|
||||
template<> std::string to_string<uivec3>(const uivec3& _obj) {
|
||||
std::string str;
|
||||
str = "(";
|
||||
str += etk::to_string(_obj.x());
|
||||
@ -152,11 +152,11 @@ template<> std::string etk::to_string<uivec3>(const uivec3& _obj) {
|
||||
str += ")";
|
||||
return str;
|
||||
}
|
||||
template<> std::u32string etk::to_u32string<uivec3>(const uivec3& _obj) {
|
||||
template<> std::u32string to_u32string<uivec3>(const uivec3& _obj) {
|
||||
return etk::to_u32string(etk::to_string(_obj));
|
||||
}
|
||||
|
||||
template<> std::string etk::to_string<bvec3>(const bvec3& _obj) {
|
||||
template<> std::string to_string<bvec3>(const bvec3& _obj) {
|
||||
std::string str;
|
||||
str = "(";
|
||||
str += etk::to_string(_obj.x());
|
||||
@ -167,11 +167,11 @@ template<> std::string etk::to_string<bvec3>(const bvec3& _obj) {
|
||||
str += ")";
|
||||
return str;
|
||||
}
|
||||
template<> std::u32string etk::to_u32string<bvec3>(const bvec3& _obj) {
|
||||
template<> std::u32string to_u32string<bvec3>(const bvec3& _obj) {
|
||||
return etk::to_u32string(etk::to_string(_obj));
|
||||
}
|
||||
|
||||
template<> bool etk::from_string<vec3>(vec3& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<vec3>(vec3& _variableRet, const std::string& _value) {
|
||||
float floats[3];
|
||||
floats[0] = 0;
|
||||
floats[1] = 0;
|
||||
@ -210,11 +210,11 @@ template<> bool etk::from_string<vec3>(vec3& _variableRet, const std::string& _v
|
||||
TK_VERBOSE("Parse : '" << _value << "' ==> " << _variableRet);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<vec3>(vec3& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<vec3>(vec3& _variableRet, const std::u32string& _value) {
|
||||
return from_string(_variableRet, etk::to_string(_value));
|
||||
}
|
||||
|
||||
template<> bool etk::from_string<ivec3>(ivec3& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<ivec3>(ivec3& _variableRet, const std::string& _value) {
|
||||
int32_t floats[3];
|
||||
floats[0] = 0;
|
||||
floats[1] = 0;
|
||||
@ -253,11 +253,11 @@ template<> bool etk::from_string<ivec3>(ivec3& _variableRet, const std::string&
|
||||
TK_VERBOSE("Parse : '" << _value << "' ==> " << _variableRet);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<ivec3>(ivec3& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<ivec3>(ivec3& _variableRet, const std::u32string& _value) {
|
||||
return from_string(_variableRet, etk::to_string(_value));
|
||||
}
|
||||
|
||||
template<> bool etk::from_string<uivec3>(uivec3& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<uivec3>(uivec3& _variableRet, const std::string& _value) {
|
||||
uint32_t floats[3];
|
||||
floats[0] = 0;
|
||||
floats[1] = 0;
|
||||
@ -296,11 +296,11 @@ template<> bool etk::from_string<uivec3>(uivec3& _variableRet, const std::string
|
||||
TK_VERBOSE("Parse : '" << _value << "' ==> " << _variableRet);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<uivec3>(uivec3& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<uivec3>(uivec3& _variableRet, const std::u32string& _value) {
|
||||
return from_string(_variableRet, etk::to_string(_value));
|
||||
}
|
||||
|
||||
template<> bool etk::from_string<bvec3>(bvec3& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<bvec3>(bvec3& _variableRet, const std::string& _value) {
|
||||
bool floats[3];
|
||||
floats[0] = false;
|
||||
floats[1] = false;
|
||||
@ -339,6 +339,7 @@ template<> bool etk::from_string<bvec3>(bvec3& _variableRet, const std::string&
|
||||
TK_VERBOSE("Parse : '" << _value << "' ==> " << _variableRet);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<bvec3>(bvec3& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<bvec3>(bvec3& _variableRet, const std::u32string& _value) {
|
||||
return from_string(_variableRet, etk::to_string(_value));
|
||||
}
|
||||
};
|
||||
|
136
etk/stdTools.cpp
136
etk/stdTools.cpp
@ -230,8 +230,8 @@ bool utf8::theoricFirst(const char _input) {
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "etk"
|
||||
|
||||
template<> std::string etk::to_string<std::u32string>(const std::u32string& _input) {
|
||||
namespace etk {
|
||||
template<> std::string to_string<std::u32string>(const std::u32string& _input) {
|
||||
std::string out;
|
||||
for (size_t iii=0; iii<_input.size(); ++iii) {
|
||||
char output[10];
|
||||
@ -240,7 +240,7 @@ template<> std::string etk::to_string<std::u32string>(const std::u32string& _inp
|
||||
}
|
||||
return out;
|
||||
}
|
||||
template<> std::string etk::to_string<char32_t>(const char32_t& _input) {
|
||||
template<> std::string to_string<char32_t>(const char32_t& _input) {
|
||||
std::string out;
|
||||
char output[10];
|
||||
u32char::convertUtf8(_input, output);
|
||||
@ -248,71 +248,71 @@ template<> std::string etk::to_string<char32_t>(const char32_t& _input) {
|
||||
return out;
|
||||
}
|
||||
|
||||
template<> std::string etk::to_string<std::string>(const std::string& _val) {
|
||||
template<> std::string to_string<std::string>(const std::string& _val) {
|
||||
return _val;
|
||||
}
|
||||
template<> std::string etk::to_string<bool>(const bool& _val) {
|
||||
template<> std::string to_string<bool>(const bool& _val) {
|
||||
if (_val == true) {
|
||||
return "true";
|
||||
}
|
||||
return "false";
|
||||
}
|
||||
template<> std::string etk::to_string<int8_t>(const int8_t& _val) {
|
||||
template<> std::string to_string<int8_t>(const int8_t& _val) {
|
||||
char tmpVal[256];
|
||||
sprintf(tmpVal, "%d", _val);
|
||||
return tmpVal;
|
||||
}
|
||||
template<> std::string etk::to_string<int16_t>(const int16_t& _val) {
|
||||
template<> std::string to_string<int16_t>(const int16_t& _val) {
|
||||
char tmpVal[256];
|
||||
sprintf(tmpVal, "%d", _val);
|
||||
return tmpVal;
|
||||
}
|
||||
template<> std::string etk::to_string<int32_t>(const int32_t& _val) {
|
||||
template<> std::string to_string<int32_t>(const int32_t& _val) {
|
||||
char tmpVal[256];
|
||||
sprintf(tmpVal, "%d", _val);
|
||||
return tmpVal;
|
||||
}
|
||||
template<> std::string etk::to_string<int64_t>(const int64_t& _val) {
|
||||
template<> std::string to_string<int64_t>(const int64_t& _val) {
|
||||
char tmpVal[256];
|
||||
sprintf(tmpVal, "%ld", _val);
|
||||
return tmpVal;
|
||||
}
|
||||
template<> std::string etk::to_string<uint8_t>(const uint8_t& _val) {
|
||||
template<> std::string to_string<uint8_t>(const uint8_t& _val) {
|
||||
char tmpVal[256];
|
||||
sprintf(tmpVal, "%u", _val);
|
||||
return tmpVal;
|
||||
}
|
||||
template<> std::string etk::to_string<uint16_t>(const uint16_t& _val) {
|
||||
template<> std::string to_string<uint16_t>(const uint16_t& _val) {
|
||||
char tmpVal[256];
|
||||
sprintf(tmpVal, "%u", _val);
|
||||
return tmpVal;
|
||||
}
|
||||
template<> std::string etk::to_string<uint32_t>(const uint32_t& _val) {
|
||||
template<> std::string to_string<uint32_t>(const uint32_t& _val) {
|
||||
char tmpVal[256];
|
||||
sprintf(tmpVal, "%u", _val);
|
||||
return tmpVal;
|
||||
}
|
||||
template<> std::string etk::to_string<uint64_t>(const uint64_t& _val) {
|
||||
template<> std::string to_string<uint64_t>(const uint64_t& _val) {
|
||||
char tmpVal[256];
|
||||
sprintf(tmpVal, "%lu", _val);
|
||||
return tmpVal;
|
||||
}
|
||||
template<> std::string etk::to_string<float>(const float& _val) {
|
||||
template<> std::string to_string<float>(const float& _val) {
|
||||
char tmpVal[256];
|
||||
sprintf(tmpVal, "%f", _val);
|
||||
return tmpVal;
|
||||
}
|
||||
template<> std::string etk::to_string<double>(const double& _val) {
|
||||
template<> std::string to_string<double>(const double& _val) {
|
||||
char tmpVal[256];
|
||||
sprintf(tmpVal, "%f", _val);
|
||||
return tmpVal;
|
||||
}
|
||||
template<> std::string etk::to_string<long double>(const long double& _val) {
|
||||
template<> std::string to_string<long double>(const long double& _val) {
|
||||
char tmpVal[256];
|
||||
sprintf(tmpVal, "%Lf", _val);
|
||||
return tmpVal;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
static std::u32string transform_to_u32string(const char* _input) {
|
||||
if (_input == NULL) {
|
||||
@ -365,49 +365,54 @@ static std::u32string transform_to_u32string(const char* _input) {
|
||||
}
|
||||
return out;
|
||||
}
|
||||
template<> std::u32string etk::to_u32string<char*>(char* const & _input) {
|
||||
|
||||
namespace etk {
|
||||
template<> std::u32string to_u32string<char*>(char* const & _input) {
|
||||
return transform_to_u32string(_input);
|
||||
}
|
||||
|
||||
template<> std::u32string etk::to_u32string<std::string>(const std::string& _input) {
|
||||
template<> std::u32string to_u32string<std::string>(const std::string& _input) {
|
||||
return transform_to_u32string(_input.c_str());
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<> std::u32string etk::to_u32string<int8_t>(const int8_t& _val) {
|
||||
template<> std::u32string to_u32string<int8_t>(const int8_t& _val) {
|
||||
return etk::to_u32string(etk::to_string(_val));
|
||||
};
|
||||
template<> std::u32string etk::to_u32string<int16_t>(const int16_t& _val) {
|
||||
template<> std::u32string to_u32string<int16_t>(const int16_t& _val) {
|
||||
return etk::to_u32string(etk::to_string(_val));
|
||||
};
|
||||
template<> std::u32string etk::to_u32string<int32_t>(const int32_t& _val) {
|
||||
template<> std::u32string to_u32string<int32_t>(const int32_t& _val) {
|
||||
return etk::to_u32string(etk::to_string(_val));
|
||||
};
|
||||
template<> std::u32string etk::to_u32string<int64_t>(const int64_t& _val) {
|
||||
template<> std::u32string to_u32string<int64_t>(const int64_t& _val) {
|
||||
return etk::to_u32string(etk::to_string(_val));
|
||||
};
|
||||
template<> std::u32string etk::to_u32string<uint8_t>(const uint8_t& _val) {
|
||||
template<> std::u32string to_u32string<uint8_t>(const uint8_t& _val) {
|
||||
return etk::to_u32string(etk::to_string(_val));
|
||||
};
|
||||
template<> std::u32string etk::to_u32string<uint16_t>(const uint16_t& _val) {
|
||||
template<> std::u32string to_u32string<uint16_t>(const uint16_t& _val) {
|
||||
return etk::to_u32string(etk::to_string(_val));
|
||||
};
|
||||
template<> std::u32string etk::to_u32string<uint32_t>(const uint32_t& _val) {
|
||||
template<> std::u32string to_u32string<uint32_t>(const uint32_t& _val) {
|
||||
return etk::to_u32string(etk::to_string(_val));
|
||||
};
|
||||
template<> std::u32string etk::to_u32string<uint64_t>(const uint64_t& _val) {
|
||||
template<> std::u32string to_u32string<uint64_t>(const uint64_t& _val) {
|
||||
return etk::to_u32string(etk::to_string(_val));
|
||||
};
|
||||
template<> std::u32string etk::to_u32string<float>(const float& _val) {
|
||||
template<> std::u32string to_u32string<float>(const float& _val) {
|
||||
return etk::to_u32string(etk::to_string(_val));
|
||||
};
|
||||
template<> std::u32string etk::to_u32string<double>(const double& _val) {
|
||||
template<> std::u32string to_u32string<double>(const double& _val) {
|
||||
return etk::to_u32string(etk::to_string(_val));
|
||||
};
|
||||
template<> std::u32string etk::to_u32string<long double>(const long double& _val) {
|
||||
template<> std::u32string to_u32string<long double>(const long double& _val) {
|
||||
return etk::to_u32string(etk::to_string(_val));
|
||||
};
|
||||
template<> std::u32string to_u32string<bool>(const bool& _val) {
|
||||
if (_val == true) {
|
||||
return U"true";
|
||||
}
|
||||
return U"false";
|
||||
}
|
||||
};
|
||||
|
||||
bool etk::string_to_bool(const std::u32string& _str) {
|
||||
if( true == compare_no_case(_str, U"true")
|
||||
@ -463,13 +468,6 @@ bool etk::string_to_bool(const std::string& _str) {
|
||||
return false;
|
||||
}
|
||||
|
||||
template<> std::u32string etk::to_u32string<bool>(const bool& _val) {
|
||||
if (_val == true) {
|
||||
return U"true";
|
||||
}
|
||||
return U"false";
|
||||
}
|
||||
|
||||
bool etk::compare_no_case(const std::u32string& _obj, const std::u32string& _val) {
|
||||
if (_val.size() != _obj.size()) {
|
||||
return false;
|
||||
@ -884,113 +882,113 @@ void etk::sort(std::vector<std::u32string *> &_list) {
|
||||
_list.insert(_list.begin()+findPos, tmpList[iii]);
|
||||
}
|
||||
}
|
||||
|
||||
template<> bool etk::from_string<std::u32string>(std::u32string& _variableRet, const std::string& _value) {
|
||||
namespace etk {
|
||||
template<> bool from_string<std::u32string>(std::u32string& _variableRet, const std::string& _value) {
|
||||
_variableRet = etk::to_u32string(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<std::string>(std::string& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<std::string>(std::string& _variableRet, const std::string& _value) {
|
||||
_variableRet = _value;
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<int8_t>(int8_t& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<int8_t>(int8_t& _variableRet, const std::string& _value) {
|
||||
_variableRet = string_to_int8_t(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<int16_t>(int16_t& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<int16_t>(int16_t& _variableRet, const std::string& _value) {
|
||||
_variableRet = string_to_int16_t(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<int32_t>(int32_t& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<int32_t>(int32_t& _variableRet, const std::string& _value) {
|
||||
_variableRet = string_to_int32_t(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<int64_t>(int64_t& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<int64_t>(int64_t& _variableRet, const std::string& _value) {
|
||||
_variableRet = string_to_int64_t(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<uint8_t>(uint8_t& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<uint8_t>(uint8_t& _variableRet, const std::string& _value) {
|
||||
_variableRet = string_to_uint8_t(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<uint16_t>(uint16_t& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<uint16_t>(uint16_t& _variableRet, const std::string& _value) {
|
||||
_variableRet = string_to_uint16_t(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<uint32_t>(uint32_t& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<uint32_t>(uint32_t& _variableRet, const std::string& _value) {
|
||||
_variableRet = string_to_uint32_t(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<uint64_t>(uint64_t& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<uint64_t>(uint64_t& _variableRet, const std::string& _value) {
|
||||
_variableRet = string_to_uint64_t(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<float>(float& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<float>(float& _variableRet, const std::string& _value) {
|
||||
_variableRet = string_to_float(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<double>(double& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<double>(double& _variableRet, const std::string& _value) {
|
||||
_variableRet = string_to_double(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<long double>(long double& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<long double>(long double& _variableRet, const std::string& _value) {
|
||||
_variableRet = string_to_long_double(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<bool>(bool& _variableRet, const std::string& _value) {
|
||||
template<> bool from_string<bool>(bool& _variableRet, const std::string& _value) {
|
||||
_variableRet = string_to_bool(_value);
|
||||
return true;
|
||||
}
|
||||
|
||||
template<> bool etk::from_string<int8_t>(int8_t& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<int8_t>(int8_t& _variableRet, const std::u32string& _value) {
|
||||
_variableRet = string_to_int8_t(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<int16_t>(int16_t& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<int16_t>(int16_t& _variableRet, const std::u32string& _value) {
|
||||
_variableRet = string_to_int16_t(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<int32_t>(int32_t& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<int32_t>(int32_t& _variableRet, const std::u32string& _value) {
|
||||
_variableRet = string_to_int32_t(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<int64_t>(int64_t& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<int64_t>(int64_t& _variableRet, const std::u32string& _value) {
|
||||
_variableRet = string_to_int64_t(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<uint8_t>(uint8_t& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<uint8_t>(uint8_t& _variableRet, const std::u32string& _value) {
|
||||
_variableRet = string_to_uint8_t(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<uint16_t>(uint16_t& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<uint16_t>(uint16_t& _variableRet, const std::u32string& _value) {
|
||||
_variableRet = string_to_uint16_t(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<uint32_t>(uint32_t& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<uint32_t>(uint32_t& _variableRet, const std::u32string& _value) {
|
||||
_variableRet = string_to_uint32_t(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<uint64_t>(uint64_t& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<uint64_t>(uint64_t& _variableRet, const std::u32string& _value) {
|
||||
_variableRet = string_to_uint64_t(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<float>(float& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<float>(float& _variableRet, const std::u32string& _value) {
|
||||
_variableRet = string_to_float(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<double>(double& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<double>(double& _variableRet, const std::u32string& _value) {
|
||||
_variableRet = string_to_double(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<long double>(long double& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<long double>(long double& _variableRet, const std::u32string& _value) {
|
||||
_variableRet = string_to_long_double(_value);
|
||||
return true;
|
||||
}
|
||||
template<> bool etk::from_string<bool>(bool& _variableRet, const std::u32string& _value) {
|
||||
template<> bool from_string<bool>(bool& _variableRet, const std::u32string& _value) {
|
||||
_variableRet = string_to_bool(_value);
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
std::ostream& std::operator <<(std::ostream& _os, const std::string& _obj) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user