MCPcopy Create free account
hub / github.com/PDAL/PDAL / value

Function value

pdal/Metadata.hpp:372–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370
371template<typename T>
372T value(const std::string& type, const std::string& value)
373{
374 if (type == "base64Binary")
375 {
376 std::vector<uint8_t> encVal = Utils::base64_decode(value);
377 encVal.resize(sizeof(T));
378 return *(reinterpret_cast<T *>(encVal.data()));
379 }
380
381 T t{};
382 if (!Utils::fromString(value, t))
383 throw value_error();
384 return t;
385}
386
387template<>
388inline bool value(const std::string& type, const std::string& value)

Callers 3

checkInvariantMethod · 0.85
checkInvariantMethod · 0.85
jsonValueFunction · 0.85

Calls 5

value_errorClass · 0.85
resizeMethod · 0.80
fromStringFunction · 0.70
nameFunction · 0.70
dataMethod · 0.45

Tested by

no test coverage detected