MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / getValueUChar

Method getValueUChar

framework/serialization/serialize.cpp:328–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326void XMLSerializationNode::setValueUInt(unsigned int i) { node.text().set(i); }
327
328unsigned char XMLSerializationNode::getValueUChar()
329{
330 auto uint = node.text().as_uint();
331 if (uint > std::numeric_limits<unsigned char>::max())
332 {
333 throw SerializationException(format("Value %u is out of range of unsigned char type", uint),
334 this);
335 }
336 return static_cast<unsigned char>(uint);
337}
338
339void XMLSerializationNode::setValueUChar(unsigned char c) { node.text().set((unsigned int)c); }
340

Callers 1

serializeInFunction · 0.80

Calls 2

formatFunction · 0.85

Tested by

no test coverage detected