Skip to content

Is it possible to construct a json string object from a binary buffer? #1553

Description

@Getfree

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: questionstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updated

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions