MCPcopy Create free account
hub / github.com/cpvrlab/ImagePlay / deserializeValue

Function deserializeValue

IPL/src/IPLProcessProperty.cpp:91–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91inline void deserializeValue(const std::string &data, bool &value)
92{
93 /*if (data.length() != 4)
94 {
95 value = false;
96 return;
97 }*/
98
99 //static const unsigned char nonAsciiMap = 1<<7;
100 std::string lowercase(data);
101 //tolower is undefined (i.e. might crash) for non-ASCII characters. Since we don't want to parse those, just xor them out
102 //std::transform(lowercase.begin(), lowercase.end(), lowercase.begin(), [](char c) { return c ^ nonAsciiMap; });
103 std::transform(lowercase.begin(), lowercase.end(), lowercase.begin(), tolower); //Transform to lower case
104 value = (lowercase.compare("true") == 0 || lowercase.compare("1") == 0);
105}
106
107inline void deserializeValue(const std::string &data, int &value)
108{

Callers 1

deserializePropertyFunction · 0.85

Calls 11

transformFunction · 0.85
DeserialationFailedClass · 0.85
IPLColorClass · 0.85
IPLPointClass · 0.85
compareMethod · 0.80
c_strMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
swapMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected