ocean.io.serialize.PHPSerializer

Serializer, to be used with the StructSerializer, which converts a struct so that a php client can read it

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
    {
        char[] name;
        hash_t id;
    }

    Id[] ids;
    char[] 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 PHPStructSerializer!(char)();

// output buffer
ubyte[] output;

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

Members

Classes

PHPSerializer
class PHPSerializer

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).