Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement : Merge two cbor streams #41

Open
prushp opened this issue Aug 4, 2016 · 1 comment
Open

Enhancement : Merge two cbor streams #41

prushp opened this issue Aug 4, 2016 · 1 comment

Comments

@prushp
Copy link

prushp commented Aug 4, 2016

-- I am creating a new request as the previous question about 'multiple arrays' was closed.

Thanks for the reply. How about a cbor_encode_merge() function? It is essentially the same thing as you proposed. However this will be more generic. Sort of a strcat function; we can have two arrays managed separately in their own streams and can be merged later.
Let's assume stream 1 is open and stream 2 is closed, I would like to call something like
cbor_encode_merge(stream1, stream2)
which can copy the map from stream2 in to stream1's tail.

@thiagomacieira
Copy link
Member

Like I said, this is a good idea. I'll see if I have time to implement this soon.

If not, it shouldn't be too difficult to do it. It's basically a memcpy of one stream's data to another, so we just need to figure out what parameters to add to the function and how to update the fields of the CborEncoder (especially the "added" field).

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

No branches or pull requests

2 participants