ocean.io.serialize.StringStructSerializer

Serializer, to be used with the StructSerializer in ocean.io.serialize.StructSerializer, which dumps a struct to a string.

Usage example (in conjunction with ocean.io.serialize.StructSerializer):

// Example struct to serialize
struct Data
{
    struct Id
    {
        cstring name;
        hash_t id;
    }

    Id[] ids;
    cstring name;
    uint count;
    float money;
}

// Set up some data in a struct
Data data;
test.ids = [Data.Id("hi", 23), Data.Id("hello", 17)];

// Create serializer object
scope ser = new StringStructSerializer!(char)();

// A string buffer
char[] output;

// Dump struct to buffer via serializer
ser.serialize(output, data);

Members

Classes

SerializerException
class SerializerException

SerializerException

StringStructSerializer
class StringStructSerializer(Char)

String struct serializer

Meta

License

Boost Software License Version 1.0. See LICENSE_BOOST.txt for details. Alternatively, this file may be distributed under the terms of the Tango 3-Clause BSD License (see LICENSE_BSD.txt for details).