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

Function marshallBinary

valdi_core/src/valdi_core/cpp/Utils/BridgeObject.cpp:92–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92Value marshallBinary(const std::vector<uint8_t>& value, const Ref<BridgeContext>& /*bridgeContext*/) {
93 auto bytes = makeShared<ByteBuffer>();
94 bytes->set(value.data(), value.data() + value.size());
95
96 return Value(makeShared<ValueTypedArray>(TypedArrayType::Uint8Array, bytes->toBytesView()));
97}
98
99std::string unmarshallString(const Value& value, const Ref<BridgeContext>& bridgeContext) {
100 return value.checkedTo<StringBox>(*bridgeContext).slowToString();

Callers

nothing calls this directly

Calls 5

ValueClass · 0.70
setMethod · 0.65
dataMethod · 0.45
sizeMethod · 0.45
toBytesViewMethod · 0.45

Tested by

no test coverage detected