tpersist.md 1.7 KB


id: tpersist title: TPersist

sidebar_label: TPersist

Object Persistence.

Methods

Method Serialize:String(obj:Object)

Serializes the specified Object into a String.


Method SerializeToString:String(obj:Object)

Serializes an Object to a String.


Method SerializeToFile(obj:Object, filename:String)

Serializes an Object to the file filename.


Method SerializeToDoc:TxmlDoc(obj:Object)

Serializes an Object to a TxmlDoc structure.

It is up to the user to free the returned TxmlDoc object.


Method SerializeToStream(obj:Object, stream:TStream)

Serializes an Object to a Stream.

It is up to the user to close the stream.


Method ToString:String()

Returns the serialized object as a string.


Method DeSerialize:Object(data:Object)

De-serializes text into an Object structure.

Accepts a TxmlDoc, TStream or a String (of data).


Method DeSerializeFromDoc:Object(xmlDoc:TxmlDoc)

De-serializes doc into an Object structure.

It is up to the user to free the supplied TxmlDoc.


Method DeSerializeFromFile:Object(filename:Object)

De-serializes the file filename into an Object structure.


Method DeSerializeFromStream:Object(stream:TStream)

De-serializes stream into an Object structure.


Globals

Global format:Int = False

Serialized formatting.

Set to True to have the data formatted nicely. Default is False - off.


Global compressed:Int = False

Compressed serialization.

Set to True to compress the serialized data. Default is False - no compression.


Consts

Const BMO_VERSION:Int = 8

File format version