Cerealed v0.2.0 - a(nother) D serialisation library
Atila Neves via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Tue Sep 9 00:45:11 PDT 2014
I'll take a look. It's easier to post this on github though.
Atila
On Monday, 8 September 2014 at 19:09:30 UTC, Vicente wrote:
> Hello Atila,
> I've seen that cerealed has made much progress, it's now at
> v0.5.0
> This post is for a feature request, I would like to use it with
> a struct like this:
>
> import cerealed;
>
> struct nested_associative_array { nested_associative_array[int]
> x; }
>
> struct some_struct {
> string[] x;
> int[][] y;
> nested_associative_array[] z;
> };
>
> void main(char[][] args) {
> some_struct original, restored;
>
> auto enc = Cerealiser();
> enc ~= original;
> auto dec = Decerealiser(enc.bytes);
> restored = dec.value!(some_struct);
>
> assert(original==restored);
> }
>
> The serialization process compiles fine, but the restoring part
> fails to compile.
> I've tried to figure out how to do it, but I am still a
> beginner on D.
> How difficult do you think it is?
> The alternative, orange, works fine, but the struct I'm trying
> to export to disk is a few hundreds of MB in size and orange
> takes hours to complete and may also run out of memory. Your
> implementation, instead, is really fast and efficient!
More information about the Digitalmars-d-announce
mailing list