- Id
alias Id = size_t
- UntypedData
alias UntypedData = immutable(void)[]
The typed used to represent the archived data in an untyped form.
- ErrorCallback
alias ErrorCallback = void delegate(SerializationException exception)
This is the type of an error callback which is called when an unexpected event occurs.
- errorCallback
ErrorCallback errorCallback()
This callback will be called when an unexpected event occurs, i.e. an expected element
is missing in the unarchiving process.
- errorCallback
ErrorCallback errorCallback(ErrorCallback errorCallback)
This callback will be called when an unexpected event occurs, i.e. an expected element
is missing in the unarchiving process.
- beginArchiving
void beginArchiving()
Starts the archiving process. Call this method before archiving any values.
- beginUnarchiving
void beginUnarchiving(UntypedData data)
Begins the unarchiving process. Call this method before unarchiving any values.
- untypedData
UntypedData untypedData()
Returns the data stored in the archive in an untyped form.
- reset
void reset()
Resets the archive. This resets the archive in a state making it ready to start
a new archiving process.
- archiveArray
void archiveArray(Array array, string type, string key, Id id, void delegate() dg)
- archiveAssociativeArray
void archiveAssociativeArray(string keyType, string valueType, size_t length, string key, Id id, void delegate() dg)
Archives an associative array.
- archiveAssociativeArrayKey
void archiveAssociativeArrayKey(string key, void delegate() dg)
Archives an associative array key.
- archiveAssociativeArrayValue
void archiveAssociativeArrayValue(string key, void delegate() dg)
Archives an associative array value.
- archiveEnum
void archiveEnum(bool value, string baseType, string key, Id id)
void archiveEnum(byte value, string baseType, string key, Id id)
void archiveEnum(char value, string baseType, string key, Id id)
void archiveEnum(dchar value, string baseType, string key, Id id)
void archiveEnum(int value, string baseType, string key, Id id)
void archiveEnum(long value, string baseType, string key, Id id)
void archiveEnum(short value, string baseType, string key, Id id)
void archiveEnum(ubyte value, string baseType, string key, Id id)
void archiveEnum(uint value, string baseType, string key, Id id)
void archiveEnum(ulong value, string baseType, string key, Id id)
void archiveEnum(ushort value, string baseType, string key, Id id)
void archiveEnum(wchar value, string baseType, string key, Id id)
Archives the given value.
- archiveBaseClass
void archiveBaseClass(string type, string key, Id id)
- archiveNull
void archiveNull(string type, string key)
Archives a null pointer or reference.
- archiveObject
void archiveObject(string runtimeType, string type, string key, Id id, void delegate() dg)
Archives an object, either a class or an interface.
- archivePointer
void archivePointer(string key, Id id, void delegate() dg)
- archiveReference
void archiveReference(string key, Id id)
- archiveSlice
void archiveSlice(Slice slice, Id sliceId, Id arrayId)
- archiveStruct
void archiveStruct(string type, string key, Id id, void delegate() dg)
- archive
void archive(string value, string key, Id id)
void archive(wstring value, string key, Id id)
void archive(dstring value, string key, Id id)
void archive(bool value, string key, Id id)
void archive(byte value, string key, Id id)
void archive(char value, string key, Id id)
void archive(dchar value, string key, Id id)
void archive(double value, string key, Id id)
void archive(float value, string key, Id id)
void archive(int value, string key, Id id)
void archive(long value, string key, Id id)
void archive(real value, string key, Id id)
void archive(short value, string key, Id id)
void archive(ubyte value, string key, Id id)
void archive(uint value, string key, Id id)
void archive(ulong value, string key, Id id)
void archive(ushort value, string key, Id id)
void archive(wchar value, string key, Id id)
Archives the given value.
- unarchiveArray
Id unarchiveArray(string key, void delegate(size_t length) dg)
Unarchives the value associated with the given key as an array.
- unarchiveArray
void unarchiveArray(Id id, void delegate(size_t length) dg)
Unarchives the value associated with the given id as an array.
- unarchiveAssociativeArray
Id unarchiveAssociativeArray(string key, void delegate(size_t length) dg)
Unarchives the value associated with the given id as an associative array.
- unarchiveAssociativeArrayKey
void unarchiveAssociativeArrayKey(string key, void delegate() dg)
Unarchives an associative array key.
- unarchiveAssociativeArrayValue
void unarchiveAssociativeArrayValue(string key, void delegate() dg)
Unarchives an associative array value.
- unarchiveEnumBool
bool unarchiveEnumBool(string key, Id id)
- unarchiveEnumByte
byte unarchiveEnumByte(string key, Id id)
- unarchiveEnumChar
char unarchiveEnumChar(string key, Id id)
- unarchiveEnumDchar
dchar unarchiveEnumDchar(string key, Id id)
- unarchiveEnumInt
int unarchiveEnumInt(string key, Id id)
- unarchiveEnumLong
long unarchiveEnumLong(string key, Id id)
- unarchiveEnumShort
short unarchiveEnumShort(string key, Id id)
- unarchiveEnumUbyte
ubyte unarchiveEnumUbyte(string key, Id id)
- unarchiveEnumUint
uint unarchiveEnumUint(string key, Id id)
- unarchiveEnumUlong
ulong unarchiveEnumUlong(string key, Id id)
- unarchiveEnumUshort
ushort unarchiveEnumUshort(string key, Id id)
- unarchiveEnumWchar
wchar unarchiveEnumWchar(string key, Id id)
Unarchives the value associated with the given key as a bool.
- unarchiveEnumBool
bool unarchiveEnumBool(Id id)
- unarchiveEnumByte
byte unarchiveEnumByte(Id id)
- unarchiveEnumChar
char unarchiveEnumChar(Id id)
- unarchiveEnumDchar
dchar unarchiveEnumDchar(Id id)
- unarchiveEnumInt
int unarchiveEnumInt(Id id)
- unarchiveEnumLong
long unarchiveEnumLong(Id id)
- unarchiveEnumShort
short unarchiveEnumShort(Id id)
- unarchiveEnumUbyte
ubyte unarchiveEnumUbyte(Id id)
- unarchiveEnumUint
uint unarchiveEnumUint(Id id)
- unarchiveEnumUlong
ulong unarchiveEnumUlong(Id id)
- unarchiveEnumUshort
ushort unarchiveEnumUshort(Id id)
- unarchiveEnumWchar
wchar unarchiveEnumWchar(Id id)
Unarchives the value associated with the given id as a bool.
- unarchiveBaseClass
void unarchiveBaseClass(string key)
Unarchives the base class associated with the given key.
- unarchiveObject
void unarchiveObject(string key, Id id, Object result, void delegate() dg)
Unarchives the object associated with the given key.
- unarchivePointer
Id unarchivePointer(string key, void delegate() dg)
Unarchives the pointer associated with the given key.
- unarchiveReference
Id unarchiveReference(string key)
Unarchives the reference associated with the given key.
- unarchiveSlice
Slice unarchiveSlice(string key)
Unarchives the slice associated with the given key.
- unarchiveStruct
Id unarchiveStruct(string key, void delegate() dg)
Unarchives the struct associated with the given key.
- unarchiveStruct
void unarchiveStruct(Id id, void delegate() dg)
Unarchives the struct associated with the given id.
- unarchiveString
string unarchiveString(Id id)
- unarchiveWstring
wstring unarchiveWstring(Id id)
- unarchiveDstring
dstring unarchiveDstring(Id id)
Unarchives the string associated with the given id.
- unarchiveString
string unarchiveString(string key, Id id)
- unarchiveWstring
wstring unarchiveWstring(string key, Id id)
- unarchiveDstring
dstring unarchiveDstring(string key, Id id)
Unarchives the string associated with the given key.
- unarchiveBool
bool unarchiveBool(string key, Id id)
- unarchiveByte
byte unarchiveByte(string key, Id id)
- unarchiveChar
char unarchiveChar(string key, Id id)
- unarchiveDchar
dchar unarchiveDchar(string key, Id id)
- unarchiveDouble
double unarchiveDouble(string key, Id id)
- unarchiveFloat
float unarchiveFloat(string key, Id id)
- unarchiveInt
int unarchiveInt(string key, Id id)
- unarchiveLong
long unarchiveLong(string key, Id id)
- unarchiveReal
real unarchiveReal(string key, Id id)
- unarchiveShort
short unarchiveShort(string key, Id id)
- unarchiveUbyte
ubyte unarchiveUbyte(string key, Id id)
- unarchiveUint
uint unarchiveUint(string key, Id id)
- unarchiveUlong
ulong unarchiveUlong(string key, Id id)
- unarchiveUshort
ushort unarchiveUshort(string key, Id id)
- unarchiveWchar
wchar unarchiveWchar(string key, Id id)
Unarchives the value associated with the given key.
- unarchiveBool
bool unarchiveBool(Id id)
- unarchiveByte
byte unarchiveByte(Id id)
- unarchiveChar
char unarchiveChar(Id id)
- unarchiveDchar
dchar unarchiveDchar(Id id)
- unarchiveDouble
double unarchiveDouble(Id id)
- unarchiveFloat
float unarchiveFloat(Id id)
- unarchiveInt
int unarchiveInt(Id id)
- unarchiveLong
long unarchiveLong(Id id)
- unarchiveReal
real unarchiveReal(Id id)
- unarchiveShort
short unarchiveShort(Id id)
- unarchiveUbyte
ubyte unarchiveUbyte(Id id)
- unarchiveUint
uint unarchiveUint(Id id)
- unarchiveUlong
ulong unarchiveUlong(Id id)
- unarchiveUshort
ushort unarchiveUshort(Id id)
- unarchiveWchar
wchar unarchiveWchar(Id id)
Unarchives the value associated with the given id.
- postProcessArray
void postProcessArray(Id id)
Performs post processing of the array associated with the given id.
This class serves as an optional base class for archive implementations. It contains some utility methods that can be helpful when creating a new archive implementation.
Most of the examples below are assumed to be in a sub class to this class and with string as the data type.