MCPcopy Create free account
hub / github.com/PlatformLab/NanoLog / unpack

Function unpack

runtime/Packer.h:245–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243
244template<typename T>
245inline typename std::enable_if<!std::is_floating_point<T>::value &&
246 !std::is_pointer<T>::value, T>::type
247unpack(const char **in, uint8_t packResult)
248{
249 int64_t packed = 0;
250
251 if (packResult <= 8) {
252 memcpy(&packed, (*in), packResult);
253 (*in) += packResult;
254 return static_cast<T>(packed);
255 }
256
257 int bytes = packResult == 0 ? 16 : (0x0f & (packResult - 8));
258 memcpy(&packed, (*in), bytes);
259 (*in) += bytes;
260
261 return static_cast<T>(-packed);
262}
263
264template<typename T>
265inline typename std::enable_if<std::is_pointer<T>::value, T>::type

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected