kastnermario / yaml-cpp

Automatically exported from code.google.com/p/yaml-cpp
MIT License
0 stars 0 forks source link

How to emit base-64 encoded binary? #79

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
There should be a way to emit base-64 encoded binary.

Original issue reported on code.google.com by jbe...@gmail.com on 28 Oct 2010 at 9:10

GoogleCodeExporter commented 8 years ago
Implemented, r425:

     emitter << YAML::Binary("Hello, World!", 13);

emits

     --- !!binary "SGVsbG8sIFdvcmxkIQ=="

One potential issue: we're using `char`, not `uint8_t`. So it's possible that 
the output is not correct on some platforms. I'm not sure what to do in this 
case.

Original comment by jbe...@gmail.com on 28 Oct 2010 at 11:08

GoogleCodeExporter commented 8 years ago
Maybe it's the place for htons/ntohs for cross-platform (I mean 
little/big-endian) compatibility? Saying, yaml will be stored in network byte 
order, and the library should convert binary data in a proper way.

Original comment by glu...@gmail.com on 8 Nov 2010 at 2:59

GoogleCodeExporter commented 8 years ago
@gluk47, what do you mean?

Original comment by jbe...@gmail.com on 8 Nov 2010 at 4:42