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

Method marshall

valdi_core/src/valdi_core/cpp/Marshalling/CppMarshaller.cpp:106–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104};
105
106void CppMarshaller::marshall(ExceptionTracker& exceptionTracker, const BytesView& value, Value& out) {
107 auto existingTypedArray = castOrNull<ValueTypedArray>(value.getSource());
108 if (existingTypedArray != nullptr && existingTypedArray->getBuffer().isStrictlyIdenticalTo(value)) {
109 out = Value(existingTypedArray);
110 return;
111 }
112
113 out = Value(makeShared<ValueTypedArray>(TypedArrayType::Uint8Array, value));
114}
115
116void CppMarshaller::unmarshall(ExceptionTracker& exceptionTracker, const Value& value, BytesView& out) {
117 auto typedArray = value.checkedTo<Ref<ValueTypedArray>>(exceptionTracker);

Callers

nothing calls this directly

Calls 2

isStrictlyIdenticalToMethod · 0.80
ValueClass · 0.50

Tested by

no test coverage detected