I need to serialize a binary string to CBOR.
I'm currently doing this:
void* binaryBuffer ;
std::string binString(binaryBuffer, 100000) ;
json jsStr = binString ;
json::to_cbor(jsStr) ;
binaryBuffer is first copied to binString and then binString is copied to jsStr.
Is it possible to construct jsStr directly from binaryBuffer, thus avoiding to copy the buffer twice?
I need to serialize a binary string to CBOR.
I'm currently doing this:
binaryBufferis first copied tobinStringand thenbinStringis copied tojsStr.Is it possible to construct
jsStrdirectly frombinaryBuffer, thus avoiding to copy the buffer twice?