class ReflectExport( reflect ) StandardSerializer : public Serializer
A basic ascii text serializer.
StandardSerializer | A basic ascii text serializer. |
Functions | |
Begin | Writes a serialization start tag. |
End | Writes a serialization end tag, see Begin. |
Serialize(bool) | Writes “true”/”false”. |
Serialize(long) | Writes “%ld”, e.g., 3 -> “3” |
Serialize(unsigned long) | Writes “0x%lX”, e.g., 32u -> “0x20” |
Serialize(double) | Writes “%#g”. |
Serialize(const Dynamic *obj) | Writes “#<<obj->GetClass()->GetCategory()->Name()>>” and then defers to obj->GetClass()->GetCategory()->SerializeDynamic(obj, Reflector(*this)). |
Reference(const Dynamic *object) | Writes “@<<count>>” where count is the number of references made so far. |
SerializeText | Writes nbytes of text as a string with quotes around it and some standard escapes. |
SerializeData | Serializes nbytes of data as hex pairs A3 45 23 8F ... |
SerializeEnum | Writes the enum value as a bare string (no quotes). |
SerializeProperty | Writes the property by deferring to its Property::Serialize method. |
bool End( const SerializationTag & )
Writes a serialization end tag, see Begin.
bool Serialize( const Dynamic * object )
Writes “#<<obj->GetClass()->GetCategory()->Name()>>” and then defers to obj->GetClass()->GetCategory()->SerializeDynamic(obj, Reflector(*this)).
For instance, a Class * would serializes as
#Class "<<name of class>>"
and a persistent object would serialize as
#Persistent (<<type of object>> $x = 34; $s = "hello"; )
bool SerializeProperty( const void * object, const Property * prop )
Writes the property by deferring to its Property::Serialize method. TODO: Figure out how/if this can prevent slicing when using CompositeSerializers.
A basic ascii text serializer.
class ReflectExport( reflect ) StandardSerializer : public Serializer
Writes a serialization start tag.
bool Begin( const SerializationTag & )
Writes a serialization end tag, see Begin.
bool End( const SerializationTag & )
Writes “true”/”false”.
bool Serialize( bool )
Writes “%ld”, e.g., 3 -> “3”
bool Serialize( long )
Writes “0x%lX”, e.g., 32u -> “0x20”
bool Serialize( unsigned long )
Writes “%#g”.
bool Serialize( double )
Writes “#<<obj->GetClass()->GetCategory()->Name()>>” and then defers to obj->GetClass()->GetCategory()->SerializeDynamic(obj, Reflector(*this)).
bool Serialize( const Dynamic * object )
Writes “@<<count>>” where count is the number of references made so far.
bool Reference( const Dynamic * object )
Writes nbytes of text as a string with quotes around it and some standard escapes.
bool SerializeText( const char * text, unsigned nbytes )
Serializes nbytes of data as hex pairs A3 45 23 8F ...
bool SerializeData( const void * data, unsigned nbytes )
Writes the enum value as a bare string (no quotes).
bool SerializeEnum( int value, const EnumType * clazz )
Writes the property by deferring to its Property::Serialize method.
bool SerializeProperty( const void * object, const Property * prop )
Reads or writes the represented data using a Reflector.
virtual void Serialize( const void * in, void * out, Reflector & reflector ) const = 0
Defines the interface for serialization.
class ReflectExport( reflect ) Serializer
A basic ascii text deserializer.
class ReflectExport( reflect ) StandardDeserializer : public Deserializer