39 memcpy(
data_.data(), &value,
sizeof(char));
43 data_(sizeof(unsigned char))
45 memcpy(
data_.data(), &value,
sizeof(
unsigned char));
51 memcpy(
data_.data(), &value,
sizeof(short));
55 data_(sizeof(unsigned short))
57 memcpy(
data_.data(), &value,
sizeof(
unsigned short));
63 memcpy(
data_.data(), &value,
sizeof(int));
67 data_(sizeof(unsigned int))
69 memcpy(
data_.data(), &value,
sizeof(
unsigned int));
75 memcpy(
data_.data(), &value,
sizeof(float));
81 memcpy(
data_.data(), &value,
sizeof(double));
86 std::string str(value);
87 data_.resize(str.size()+1);
88 memcpy(
data_.data(), str.data(), str.size()+1);
94 memcpy(
data_.data(), value.data(), value.size()+1);
103 else if(
data_.size())
105 return memcmp(
data_.data(), std::vector<unsigned char>(
data_.size(), 0).data(),
data_.size()) != 0;
119 memcpy(&v,
data_.data(),
sizeof(char));
175 unsigned int tmp =
toUInt();
196 memcpy(&v,
data_.data(),
sizeof(
unsigned char));
207 v = (
unsigned char)tmp;
219 v = (
unsigned char)tmp;
231 v = (
unsigned char)tmp;
243 v = (
unsigned char)tmp;
252 unsigned int tmp =
toUInt();
255 v = (
unsigned char)tmp;
273 memcpy(&v,
data_.data(),
sizeof(short));
321 unsigned int tmp =
toUInt();
339 unsigned short v = 0;
342 memcpy(&v,
data_.data(),
sizeof(
unsigned short));
353 v = (
unsigned short)tmp;
373 v = (
unsigned short)tmp;
385 v = (
unsigned short)tmp;
394 unsigned int tmp =
toUInt();
397 v = (
unsigned short)tmp;
415 memcpy(&v,
data_.data(),
sizeof(int));
455 unsigned int tmp =
toUInt();
476 memcpy(&v,
data_.data(),
sizeof(
unsigned int));
487 v = (
unsigned int)tmp;
507 v = (
unsigned int)tmp;
527 v = (
unsigned int)tmp;
545 memcpy(&v,
data_.data(),
sizeof(float));
574 memcpy(&v,
data_.data(),
sizeof(double));
595 v = std::string((
const char *)
data_.data());
603 v =
toBool()?
"true":
"false";
GLM_FUNC_DECL genType min(genType const &x, genType const &y)
bool UTILITE_EXP uStr2Bool(const char *str)
float toFloat(bool *ok=0) const
Some conversion functions.
unsigned char toUChar(bool *ok=0) const
short toShort(bool *ok=0) const
std::vector< unsigned char > data_
int toInt(bool *ok=0) const
unsigned int toUInt(bool *ok=0) const
unsigned short toUShort(bool *ok=0) const
double toDouble(bool *ok=0) const
char toChar(bool *ok=0) const
GLM_FUNC_DECL genType max(genType const &x, genType const &y)
std::string toStr(bool *ok=0) const
std::string UTILITE_EXP uNumber2Str(unsigned int number)