TROPostMessageSerializer

Overview

The TROPostMessageSerializer class implements a serializer that encodes and decodes data in the format suitable to be transferred using the HTTP POST command. It introduces no new visible members compared to its superclass. Please refer to the TROSerializer documentation for a detailed description of the class memebers.
This class is used internally inside the TROPostMessage class, it is not intended to be used by users.

Location

 

constructor Create

Creates a new instance.

constructor Create

BeginReadObject  protected override

Validates a serialized object and prepares it for reading.

procedure BeginReadObject(const aName: string; aCustom: IROCustomStreamableType; var LevelRef: IUnknown; var IsValidType: boolean; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • aCustom: Object
  • LevelRef: Reference to owner object.
  • IsValidType: Output parameter, setting this to false along with returning nil to the anObject parameter indicates that the object cannot be created because the object type is unknown. Normally should return true.
  • ArrayElementId: If the object being read is an array element, its index is contained in this parameter, otherwise it is -1.

BeginWriteObject  protected override

Prepares a serialized object for writting.

procedure BeginWriteObject(const aName: string; aCustom: IROCustomStreamableType; var LevelRef: IUnknown; var IsValidType: boolean; out IsAssigned: Boolean; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • aCustom: Object
  • LevelRef: Reference to owner object.
  • IsValidType: Output parameter, setting this to false indicates that the object cannot be written because the object type is unknown. Should return true.
  • IsAssigned: Output parameter, indicates that the object about to be written is considered assigned.
  • ArrayElementId: If the object being written is an array element, its index is contained in this parameter, otherwise it is -1.

BinaryType

Selects what format will be used to encode binary data, Hex or Base64.

property BinaryType: TROPostMessageBinaryType read write

CleanupClassName  protected    (declared in TROSerializer)

function CleanupClassName(aClassName: string): string

Parameters:

  • aClassName:

Clear

Empties the object.

procedure Clear

DefaultNamespaces    (declared in TROSerializer)

Default namespace

property DefaultNamespaces: TStrings read write

EndReadObject  protected override

Performs finalization work after structure was read.

procedure EndReadObject(const aName: string; aCustom: IROCustomStreamableType; const LevelRef: IUnknown)

Parameters:

  • aName: Name of the object that has been read.
  • aCustom: Object
  • LevelRef: Reference to owner object.

EndWriteObject  protected override

Performs finalization work after structure was written.

procedure EndWriteObject(const aName: string; aCustom: IROCustomStreamableType; const LevelRef: IUnknown)

Parameters:

  • aName: Name of the object that has been written.
  • aCustom: Object
  • LevelRef: Reference to owner object.

GetArrayElementName (PTypeInfo, pointer): string  overload virtual    (declared in TROSerializer)

Returns the name that is used for the array element instance when (de)serializing. Used for message formats where entities are named, such as SOAP.

function GetArrayElementName(anItemType: PTypeInfo; anItemReference: pointer): string

Parameters:

  • anItemType: Runtime type information for the element type.
  • anItemReference: Points to the array element.

GetArrayElementName (string): string  overload virtual    (declared in TROSerializer)

Returns the name that is used for the array element instance when (de)serializing

function GetArrayElementName(anItemType: string): string

Parameters:

  • anItemType: Runtime type information for the element type.

IsROCustomStreamable  protected    (declared in TROSerializer)

Determines if the instance is custom streamable by testing for the IROCustomStreamableType interface implementation.

function IsROCustomStreamable(aClass: TClass): Boolean

Parameters:

  • aClass: Class to test.

LoadFromStream

Loads data from stream.

procedure LoadFromStream(aStream: TStream; aMultiLine: Boolean)

Parameters:

  • aStream: Stream
  • aMultiLine: Multi line

Message

property Message: TStringList read write

Prefix

Gets or sets a prefix for the current namespace.

property Prefix: string read write

Read    (declared in TROSerializer)

The general method to read any data.

procedure Read(const aName: string; aTypeInfo: PTypeInfo; var Ptr: ; ArrayElementId: integer; Attributes: TParamAttributes)

Parameters:

  • aName: Name of the object to read.
  • aTypeInfo: Runtime type information for the data to read.
  • Ptr: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.
  • Attributes: Attributes

ReadArray  override

Reads an array value.

function ReadArray(const aName: string; aClass: TClass; var Ref: ; ArrayElementId: integer): Boolean

Parameters:

  • aName: Name of the object to read.
  • aClass: Class of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadBinary  override

Reads a Binary value.

procedure ReadBinary(const aName: string; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadDateTime  override

Reads a TDateTime value.

procedure ReadDateTime(const aName: string; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadDecimal  override

Reads a Decimal value.

procedure ReadDecimal(const aName: string; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadDouble  override

Reads a Double value.

procedure ReadDouble(const aName: string; aFloatType: TFloatType; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • aFloatType: Specifies the exact floating point type to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadEnumerated  override

Reads an enumerated value.

procedure ReadEnumerated(const aName: string; anEnumTypeInfo: PTypeInfo; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • anEnumTypeInfo: Runtime type information for the enuymerated type to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadException  override

Reads an Exception value.

procedure ReadException(const aName: string; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadGuid  override

Reads a GUID value.

procedure ReadGuid(const aName: string; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadInt64  override

Reads a Int64 value.

procedure ReadInt64(const aName: string; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadInteger  override

Reads a Integer value (32 bits or less).

procedure ReadInteger(const aName: string; anOrdType: TOrdType; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • anOrdType: Specifies the exact integer point type to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadItem

function ReadItem(const aName: string; aArrayElementId: integer): ROAnsiString

Parameters:

  • aName:
  • aArrayElementId:

ReadLegacyString  override

Reads a legacy string (AnsiString or UTF8String) value.

procedure ReadLegacyString(const aName: string; var Ref: ; ExtraAttributes: TParamAttributes; ArrayElementId: integer; iMaxLength: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ExtraAttributes: specified what string should be read (AnsiString or UTF8String)
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.
  • iMaxLength: Specifies the maximum string length to read, is set to -1 when no restriction is required.

ReadObject  protected override    (declared in TROSerializer)

Reads data of any object type.

procedure ReadObject(obj: TObject)

Parameters:

  • obj: given object

ReadROCustomStreamable  protected    (declared in TROSerializer)

Reads a custom streamable object.

procedure ReadROCustomStreamable(const aName: string; aCustom: TObject; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • aCustom: Object
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadStruct  override

Reads a Struct value.

function ReadStruct(const aName: string; aClass: TClass; var Ref: ; ArrayElementId: integer): Boolean

Parameters:

  • aName: Name of the object to read.
  • aClass: Class of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadUnicodeString  override

Reads a UnicodeString value.

procedure ReadUnicodeString(const aName: string; var Ref: ; ArrayElementId: integer; iMaxLength: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.
  • iMaxLength: Specifies the maximum string length to read, is set to -1 when no restriction is required.

ReadVariant  override

Reads a Variant value.

procedure ReadVariant(const aName: string; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadXml  override

Reads a XML value.

procedure ReadXml(const aName: string; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

RecordStrictOrder    (declared in TROSerializer)

Indicates whether the field order of the structures must be maintained the same order as in the RODL. If set to false, alphabetical order is used for the fields.

property RecordStrictOrder: Boolean read write

SaveToStream

Saves message to stream

procedure SaveToStream(aStream: TStream; aMultiLine: Boolean)

Parameters:

  • aStream: Stream
  • aMultiLine: Multi line

Write    (declared in TROSerializer)

The general method to serialize any data.

procedure Write(const aName: string; aTypeInfo: PTypeInfo; const Ref: ; ArrayElementId: integer; Attributes: TParamAttributes)

Parameters:

  • aName: Name of the object to write.
  • aTypeInfo: Runtime type information of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.
  • Attributes: Attributes

WriteArray  override

Writes an array value.

procedure WriteArray(const aName: string; const Ref: ; aClass: TClass; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • aClass: Class of the object to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteBinary  override

Writes a Binary value.

procedure WriteBinary(const aName: string; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteDateTime  override

Writes a TDateTime value.

procedure WriteDateTime(const aName: string; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteDecimal  override

Writes a Decimal value.

procedure WriteDecimal(const aName: string; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteDouble  override

Writes a Double value.

procedure WriteDouble(const aName: string; aFloatType: TFloatType; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • aFloatType: Specifies the exact floating point data type to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteEnumerated  override

Writes an enumerated value.

procedure WriteEnumerated(const aName: string; anEnumTypeInfo: PTypeInfo; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • anEnumTypeInfo: Runtime type information of the enumerated type.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteException  override

Writes an Exception value.

procedure WriteException(const aName: string; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteGuid  override

Writes a GUID value.

procedure WriteGuid(const aName: string; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteInt64  override

Writes a Int64 value.

procedure WriteInt64(const aName: string; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteInteger  override

Writes a Integer value (32 bits or less).

procedure WriteInteger(const aName: string; anOrdType: TOrdType; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • anOrdType: Specifies the exact integer data type to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteItem

procedure WriteItem(const aName: string; aString: ROAnsiString; aArrayElementId: integer)

Parameters:

  • aName:
  • aString:
  • aArrayElementId:

WriteLegacyString  override

Writes a legacy string (AnsiString or UTF8String) value.

procedure WriteLegacyString(const aName: string; const Ref: ; ExtraAttributes: TParamAttributes; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ExtraAttributes: specified what string should be written (AnsiString or UTF8String)
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteObject  protected override    (declared in TROSerializer)

Writes data of any object type.

procedure WriteObject(obj: TObject)

Parameters:

  • obj: Object instance whose properties will be serialized.

WriteROCustomStreamable  protected    (declared in TROSerializer)

Writes a custom streamable object.

procedure WriteROCustomStreamable(const aName: string; aCustom: TObject; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • aCustom: Object
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteStruct  override

Writes a Struct value.

procedure WriteStruct(const aName: string; const Ref: ; aClass: TClass; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • aClass: Class of the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteUnicodeString  override

Writes a UnicodeString value.

procedure WriteUnicodeString(const aName: string; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteVariant  override

Writes a Variant value.

procedure WriteVariant(const aName: string; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteXml  override

Writes a XML value.

procedure WriteXml(const aName: string; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

 

BinaryType

Selects what format will be used to encode binary data, Hex or Base64.

property BinaryType: TROPostMessageBinaryType read write

DefaultNamespaces    (declared in TROSerializer)

Default namespace

property DefaultNamespaces: TStrings read write

Message

property Message: TStringList read write

Prefix

Gets or sets a prefix for the current namespace.

property Prefix: string read write

RecordStrictOrder    (declared in TROSerializer)

Indicates whether the field order of the structures must be maintained the same order as in the RODL. If set to false, alphabetical order is used for the fields.

property RecordStrictOrder: Boolean read write

 

constructor Create

Creates a new instance.

constructor Create

BeginReadObject  protected override

Validates a serialized object and prepares it for reading.

procedure BeginReadObject(const aName: string; aCustom: IROCustomStreamableType; var LevelRef: IUnknown; var IsValidType: boolean; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • aCustom: Object
  • LevelRef: Reference to owner object.
  • IsValidType: Output parameter, setting this to false along with returning nil to the anObject parameter indicates that the object cannot be created because the object type is unknown. Normally should return true.
  • ArrayElementId: If the object being read is an array element, its index is contained in this parameter, otherwise it is -1.

BeginWriteObject  protected override

Prepares a serialized object for writting.

procedure BeginWriteObject(const aName: string; aCustom: IROCustomStreamableType; var LevelRef: IUnknown; var IsValidType: boolean; out IsAssigned: Boolean; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • aCustom: Object
  • LevelRef: Reference to owner object.
  • IsValidType: Output parameter, setting this to false indicates that the object cannot be written because the object type is unknown. Should return true.
  • IsAssigned: Output parameter, indicates that the object about to be written is considered assigned.
  • ArrayElementId: If the object being written is an array element, its index is contained in this parameter, otherwise it is -1.

CleanupClassName  protected    (declared in TROSerializer)

function CleanupClassName(aClassName: string): string

Parameters:

  • aClassName:

Clear

Empties the object.

procedure Clear

EndReadObject  protected override

Performs finalization work after structure was read.

procedure EndReadObject(const aName: string; aCustom: IROCustomStreamableType; const LevelRef: IUnknown)

Parameters:

  • aName: Name of the object that has been read.
  • aCustom: Object
  • LevelRef: Reference to owner object.

EndWriteObject  protected override

Performs finalization work after structure was written.

procedure EndWriteObject(const aName: string; aCustom: IROCustomStreamableType; const LevelRef: IUnknown)

Parameters:

  • aName: Name of the object that has been written.
  • aCustom: Object
  • LevelRef: Reference to owner object.

GetArrayElementName (PTypeInfo, pointer): string  overload virtual    (declared in TROSerializer)

Returns the name that is used for the array element instance when (de)serializing. Used for message formats where entities are named, such as SOAP.

function GetArrayElementName(anItemType: PTypeInfo; anItemReference: pointer): string

Parameters:

  • anItemType: Runtime type information for the element type.
  • anItemReference: Points to the array element.

GetArrayElementName (string): string  overload virtual    (declared in TROSerializer)

Returns the name that is used for the array element instance when (de)serializing

function GetArrayElementName(anItemType: string): string

Parameters:

  • anItemType: Runtime type information for the element type.

IsROCustomStreamable  protected    (declared in TROSerializer)

Determines if the instance is custom streamable by testing for the IROCustomStreamableType interface implementation.

function IsROCustomStreamable(aClass: TClass): Boolean

Parameters:

  • aClass: Class to test.

LoadFromStream

Loads data from stream.

procedure LoadFromStream(aStream: TStream; aMultiLine: Boolean)

Parameters:

  • aStream: Stream
  • aMultiLine: Multi line

Read    (declared in TROSerializer)

The general method to read any data.

procedure Read(const aName: string; aTypeInfo: PTypeInfo; var Ptr: ; ArrayElementId: integer; Attributes: TParamAttributes)

Parameters:

  • aName: Name of the object to read.
  • aTypeInfo: Runtime type information for the data to read.
  • Ptr: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.
  • Attributes: Attributes

ReadArray  override

Reads an array value.

function ReadArray(const aName: string; aClass: TClass; var Ref: ; ArrayElementId: integer): Boolean

Parameters:

  • aName: Name of the object to read.
  • aClass: Class of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadBinary  override

Reads a Binary value.

procedure ReadBinary(const aName: string; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadDateTime  override

Reads a TDateTime value.

procedure ReadDateTime(const aName: string; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadDecimal  override

Reads a Decimal value.

procedure ReadDecimal(const aName: string; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadDouble  override

Reads a Double value.

procedure ReadDouble(const aName: string; aFloatType: TFloatType; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • aFloatType: Specifies the exact floating point type to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadEnumerated  override

Reads an enumerated value.

procedure ReadEnumerated(const aName: string; anEnumTypeInfo: PTypeInfo; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • anEnumTypeInfo: Runtime type information for the enuymerated type to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadException  override

Reads an Exception value.

procedure ReadException(const aName: string; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadGuid  override

Reads a GUID value.

procedure ReadGuid(const aName: string; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadInt64  override

Reads a Int64 value.

procedure ReadInt64(const aName: string; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadInteger  override

Reads a Integer value (32 bits or less).

procedure ReadInteger(const aName: string; anOrdType: TOrdType; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • anOrdType: Specifies the exact integer point type to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadItem

function ReadItem(const aName: string; aArrayElementId: integer): ROAnsiString

Parameters:

  • aName:
  • aArrayElementId:

ReadLegacyString  override

Reads a legacy string (AnsiString or UTF8String) value.

procedure ReadLegacyString(const aName: string; var Ref: ; ExtraAttributes: TParamAttributes; ArrayElementId: integer; iMaxLength: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ExtraAttributes: specified what string should be read (AnsiString or UTF8String)
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.
  • iMaxLength: Specifies the maximum string length to read, is set to -1 when no restriction is required.

ReadObject  protected override    (declared in TROSerializer)

Reads data of any object type.

procedure ReadObject(obj: TObject)

Parameters:

  • obj: given object

ReadROCustomStreamable  protected    (declared in TROSerializer)

Reads a custom streamable object.

procedure ReadROCustomStreamable(const aName: string; aCustom: TObject; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • aCustom: Object
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadStruct  override

Reads a Struct value.

function ReadStruct(const aName: string; aClass: TClass; var Ref: ; ArrayElementId: integer): Boolean

Parameters:

  • aName: Name of the object to read.
  • aClass: Class of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadUnicodeString  override

Reads a UnicodeString value.

procedure ReadUnicodeString(const aName: string; var Ref: ; ArrayElementId: integer; iMaxLength: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.
  • iMaxLength: Specifies the maximum string length to read, is set to -1 when no restriction is required.

ReadVariant  override

Reads a Variant value.

procedure ReadVariant(const aName: string; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

ReadXml  override

Reads a XML value.

procedure ReadXml(const aName: string; var Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to read.
  • Ref: Output parameter, should point to the deserialized instance.
  • ArrayElementId: If the object about to be read is an array element, its index is contained in this parameter, otherwise it is -1.

SaveToStream

Saves message to stream

procedure SaveToStream(aStream: TStream; aMultiLine: Boolean)

Parameters:

  • aStream: Stream
  • aMultiLine: Multi line

Write    (declared in TROSerializer)

The general method to serialize any data.

procedure Write(const aName: string; aTypeInfo: PTypeInfo; const Ref: ; ArrayElementId: integer; Attributes: TParamAttributes)

Parameters:

  • aName: Name of the object to write.
  • aTypeInfo: Runtime type information of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.
  • Attributes: Attributes

WriteArray  override

Writes an array value.

procedure WriteArray(const aName: string; const Ref: ; aClass: TClass; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • aClass: Class of the object to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteBinary  override

Writes a Binary value.

procedure WriteBinary(const aName: string; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteDateTime  override

Writes a TDateTime value.

procedure WriteDateTime(const aName: string; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteDecimal  override

Writes a Decimal value.

procedure WriteDecimal(const aName: string; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteDouble  override

Writes a Double value.

procedure WriteDouble(const aName: string; aFloatType: TFloatType; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • aFloatType: Specifies the exact floating point data type to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteEnumerated  override

Writes an enumerated value.

procedure WriteEnumerated(const aName: string; anEnumTypeInfo: PTypeInfo; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • anEnumTypeInfo: Runtime type information of the enumerated type.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteException  override

Writes an Exception value.

procedure WriteException(const aName: string; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteGuid  override

Writes a GUID value.

procedure WriteGuid(const aName: string; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteInt64  override

Writes a Int64 value.

procedure WriteInt64(const aName: string; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteInteger  override

Writes a Integer value (32 bits or less).

procedure WriteInteger(const aName: string; anOrdType: TOrdType; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • anOrdType: Specifies the exact integer data type to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteItem

procedure WriteItem(const aName: string; aString: ROAnsiString; aArrayElementId: integer)

Parameters:

  • aName:
  • aString:
  • aArrayElementId:

WriteLegacyString  override

Writes a legacy string (AnsiString or UTF8String) value.

procedure WriteLegacyString(const aName: string; const Ref: ; ExtraAttributes: TParamAttributes; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ExtraAttributes: specified what string should be written (AnsiString or UTF8String)
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteObject  protected override    (declared in TROSerializer)

Writes data of any object type.

procedure WriteObject(obj: TObject)

Parameters:

  • obj: Object instance whose properties will be serialized.

WriteROCustomStreamable  protected    (declared in TROSerializer)

Writes a custom streamable object.

procedure WriteROCustomStreamable(const aName: string; aCustom: TObject; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • aCustom: Object
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteStruct  override

Writes a Struct value.

procedure WriteStruct(const aName: string; const Ref: ; aClass: TClass; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • aClass: Class of the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteUnicodeString  override

Writes a UnicodeString value.

procedure WriteUnicodeString(const aName: string; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteVariant  override

Writes a Variant value.

procedure WriteVariant(const aName: string; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.

WriteXml  override

Writes a XML value.

procedure WriteXml(const aName: string; const Ref: ; ArrayElementId: integer)

Parameters:

  • aName: Name of the object to write.
  • Ref: Points to the instance to serialize.
  • ArrayElementId: If the object to write is an array element, its index is contained in this parameter, otherwise it is -1.