MCPcopy Create free account
hub / github.com/Snapchat/Valdi / deserializeValue

Function deserializeValue

valdi_core/src/valdi_core/cpp/Utils/ValueUtils.cpp:31–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29namespace Valdi {
30
31Value deserializeValue(const Byte* data, size_t size) {
32 auto str = StringCache::getGlobal().makeString(reinterpret_cast<const char*>(data), size);
33
34 Value out;
35
36 for (const auto& line : str.split('\n')) {
37 auto index = line.indexOf('=');
38 if (index) {
39 auto keyValue = line.split(*index);
40 out.setMapValue(keyValue.first, Value(keyValue.second));
41 }
42 }
43
44 return out;
45}
46
47Ref<ByteBuffer> serializeValue(const Value& value) {
48 auto out = makeShared<ByteBuffer>();

Callers 2

TESTFunction · 0.85
getFromCacheFunction · 0.85

Calls 5

getGlobalFunction · 0.85
makeStringMethod · 0.80
splitMethod · 0.80
ValueClass · 0.70
indexOfMethod · 0.45

Tested by 1

TESTFunction · 0.68