TROXmlRpcSerializer
Overview
The TROXmlRpcSerializer class is a specialization of the TROSerializer class
that provides methods for data serialization/deserialization.
This class is used inernally by the TROXmlRpcMessage class to process message data in XML-RPC format.
There is no need to use this class directly; instead, you can use the TROXmlRpcMessage class to provide support for XML-RPC messages.
Location
- Unit: uROXmlRpcMessage.pas
- Ancestry: TROBaseSerializer | TROSerializer | TROXmlRpcSerializer
constructor Create
Creates a new instance.
constructor Create
aMethodName
Represents the name of the service's method that needs to be serialized.
property aMethodName: string read write
aType
Specifies the TROXmlRpcType of the message.
property aType: TROXmlRpcType read write
BeginReadObject protected override
Locates the aName
node and puts its content into Ref
as UnicodeString
.
procedure BeginReadObject(const aName: string; aCustom: IROCustomStreamableType; var aLevelRef: IUnknown; var aIsValidType: Boolean; ArrayElementId: Integer)
Parameters:
- aName: Item name
- aCustom:
- aLevelRef: Not used
- aIsValidType:
False
ifaClass
does not belong to the mentioned list - ArrayElementId: Not used
BeginWriteObject protected override
Locates the aName
node and puts its content into Ref
as UnicodeString
.
procedure BeginWriteObject(const aName: string; aCustom: IROCustomStreamableType; var aLevelRef: IUnknown; var aIsValidType: Boolean; out aIsAssigned: Boolean; ArrayElementId: Integer)
Parameters:
- aName: Item name
- aCustom:
- aLevelRef: Not used
- aIsValidType:
True
ifanObject
belongs to the mentioned list - aIsAssigned: Always true
- ArrayElementId: Not used
CleanupClassName protected (declared in TROSerializer)
function CleanupClassName(aClassName: string): string
Parameters:
- aClassName:
DefaultNamespaces (declared in TROSerializer)
Default namespace
property DefaultNamespaces: TStrings read write
EndReadObject protected override
Locates the aName
node and puts its content into Ref
as UnicodeString
.
procedure EndReadObject(const aName: string; aCustom: IROCustomStreamableType; const aLevelRef: IUnknown)
Parameters:
- aName: Not used
- aCustom:
- aLevelRef: Not used
EndWriteObject protected override
Locates the aName
node and puts its content into Ref
as UnicodeString
.
procedure EndWriteObject(const aName: string; aCustom: IROCustomStreamableType; const aLevelRef: IUnknown)
Parameters:
- aName: Not used
- aCustom:
- aLevelRef: Not used
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.
InitializeRead
Locates the aName
node and puts its content into Ref
as UnicodeString
.
procedure InitializeRead(Source: TStream)
Parameters:
- Source: Data source
InitializeWrite
Prepares the internal state and output XML nodes according to aType
.
procedure InitializeWrite(aType: TROXmlRpcType; aMethodName: string)
Parameters:
- aType: Value of TROXmlRpcType
- aMethodName: (Interface) method
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.
MaxStringSize (declared in TROSerializer)
property MaxStringSize: Integer 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.
ReadArrayWithErrorHandling (declared in TROSerializer)
function ReadArrayWithErrorHandling(const aName: string; aClass: TClass; var Value: ; ArrayElementId: Integer): Boolean
Parameters:
- aName:
- aClass:
- Value:
- ArrayElementId:
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.
ReadBinaryWithErrorHandling (declared in TROSerializer)
procedure ReadBinaryWithErrorHandling(const aName: string; var Value: Binary; ArrayElementId: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
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.
ReadDateTimeWithErrorHandling (declared in TROSerializer)
procedure ReadDateTimeWithErrorHandling(const aName: string; var Value: TDateTime; ArrayElementId: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
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.
ReadDecimalWithErrorHandling (declared in TROSerializer)
procedure ReadDecimalWithErrorHandling(const aName: string; var Value: Decimal; ArrayElementId: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
ReadDecimalWithErrorHandling_cpp (declared in TROSerializer)
procedure ReadDecimalWithErrorHandling_cpp(const aName: string; var Value: Variant; ArrayElementId: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
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.
ReadDoubleWithErrorHandling (declared in TROSerializer)
procedure ReadDoubleWithErrorHandling(const aName: string; aFloatType: TFloatType; var Ref: ; ArrayElementId: Integer)
Parameters:
- aName:
- aFloatType:
- Ref:
- ArrayElementId:
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.
ReadEnumeratedWithErrorHandling (declared in TROSerializer)
procedure ReadEnumeratedWithErrorHandling(const aName: string; anEnumTypeInfo: PTypeInfo; var Ref: ; ArrayElementId: Integer)
Parameters:
- aName:
- anEnumTypeInfo:
- Ref:
- ArrayElementId:
ReadException (string, , Integer) overload 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.
ReadException (Integer, string) reintroduce overload
Reads an Exception value.
procedure ReadException(var aCode: Integer; var aMsg: string)
Parameters:
- aCode: Returns exception code
- aMsg: Returns the exception message
ReadExceptionWithErrorHandling (declared in TROSerializer)
procedure ReadExceptionWithErrorHandling(const aName: string; var Value: ; ArrayElementId: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
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.
ReadGuidWithErrorHandling (declared in TROSerializer)
procedure ReadGuidWithErrorHandling(const aName: string; var Value: TGuidString; ArrayElementId: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
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.
ReadInt64WithErrorHandling (declared in TROSerializer)
procedure ReadInt64WithErrorHandling(const aName: string; var Value: Int64; ArrayElementId: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
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.
ReadIntegerWithErrorHandling (declared in TROSerializer)
procedure ReadIntegerWithErrorHandling(const aName: string; anOrdType: TOrdType; var Ref: ; ArrayElementId: Integer)
Parameters:
- aName:
- anOrdType:
- Ref:
- ArrayElementId:
ReadLegacyString override
procedure ReadLegacyString(const aName: string; var Ref: ; ExtraAttributes: TParamAttributes; ArrayElementId: Integer; aMaxLength: Integer)
Parameters:
- aName:
- Ref:
- ExtraAttributes:
- ArrayElementId:
- aMaxLength:
ReadLegacyStringWithErrorHandling (declared in TROSerializer)
procedure ReadLegacyStringWithErrorHandling(const aName: string; var Value: string; ExtraAttributes: TParamAttributes; ArrayElementId: Integer; aMaxLength: Integer)
Parameters:
- aName:
- Value:
- ExtraAttributes:
- ArrayElementId:
- aMaxLength:
ReadObject (TObject) protected override (declared in TROSerializer)
Deserializes data of any object type.
procedure ReadObject(aObject: TObject)
Parameters:
- aObject: Object instance whose properties will be deserialized.
ReadObject (TObject) protected virtual abstract (declared in TROBaseSerializer)
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.
ReadStructWithErrorHandling (declared in TROSerializer)
function ReadStructWithErrorHandling(const aName: string; aClass: TClass; var Value: ; ArrayElementId: Integer): Boolean
Parameters:
- aName:
- aClass:
- Value:
- ArrayElementId:
ReadUnicodeString override
Locates the aName
node and puts its content into Ref
as UnicodeString
.
procedure ReadUnicodeString(const aName: string; var Ref: ; ArrayElementId: Integer; aMaxLength: Integer)
Parameters:
- aName: Element name
- Ref: Destination
- ArrayElementId: Not used
- aMaxLength: Not used
ReadUnicodeStringWithErrorHandling (declared in TROSerializer)
procedure ReadUnicodeStringWithErrorHandling(const aName: string; var Value: UnicodeString; ArrayElementId: Integer; aMaxLength: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
- aMaxLength:
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.
ReadVariantWithErrorHandling (declared in TROSerializer)
procedure ReadVariantWithErrorHandling(const aName: string; var Value: Variant; ArrayElementId: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
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.
ReadXmlWithErrorHandling (declared in TROSerializer)
procedure ReadXmlWithErrorHandling(const aName: string; var Value: IXMLNode; ArrayElementId: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
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 (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 (Integer, string) reintroduce overload
Creates a 'struct' node and puts aCode
into the 'faultCode' and aMsg
into the 'faultString' subnodes.
procedure WriteException(aCode: Integer; aMsg: string)
Parameters:
- aCode: Exception code
- aMsg: Exception message
WriteException (string, , Integer) overload 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.
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 (TObject) protected override (declared in TROSerializer)
Deserializes data of any object type.
procedure WriteObject(aObject: TObject)
Parameters:
- aObject: Object instance whose properties will be deserialized.
WriteObject (TObject) protected virtual abstract (declared in TROBaseSerializer)
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.
WriteToStream
Locates the aName
node and puts its content into Ref
as UnicodeString
.
procedure WriteToStream(Dest: TStream)
Parameters:
- Dest: Data source
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.
aMethodName
Represents the name of the service's method that needs to be serialized.
property aMethodName: string read write
aType
Specifies the TROXmlRpcType of the message.
property aType: TROXmlRpcType read write
DefaultNamespaces (declared in TROSerializer)
Default namespace
property DefaultNamespaces: TStrings read write
MaxStringSize (declared in TROSerializer)
property MaxStringSize: Integer 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
constructor Create
Creates a new instance.
constructor Create
BeginReadObject protected override
Locates the aName
node and puts its content into Ref
as UnicodeString
.
procedure BeginReadObject(const aName: string; aCustom: IROCustomStreamableType; var aLevelRef: IUnknown; var aIsValidType: Boolean; ArrayElementId: Integer)
Parameters:
- aName: Item name
- aCustom:
- aLevelRef: Not used
- aIsValidType:
False
ifaClass
does not belong to the mentioned list - ArrayElementId: Not used
BeginWriteObject protected override
Locates the aName
node and puts its content into Ref
as UnicodeString
.
procedure BeginWriteObject(const aName: string; aCustom: IROCustomStreamableType; var aLevelRef: IUnknown; var aIsValidType: Boolean; out aIsAssigned: Boolean; ArrayElementId: Integer)
Parameters:
- aName: Item name
- aCustom:
- aLevelRef: Not used
- aIsValidType:
True
ifanObject
belongs to the mentioned list - aIsAssigned: Always true
- ArrayElementId: Not used
CleanupClassName protected (declared in TROSerializer)
function CleanupClassName(aClassName: string): string
Parameters:
- aClassName:
EndReadObject protected override
Locates the aName
node and puts its content into Ref
as UnicodeString
.
procedure EndReadObject(const aName: string; aCustom: IROCustomStreamableType; const aLevelRef: IUnknown)
Parameters:
- aName: Not used
- aCustom:
- aLevelRef: Not used
EndWriteObject protected override
Locates the aName
node and puts its content into Ref
as UnicodeString
.
procedure EndWriteObject(const aName: string; aCustom: IROCustomStreamableType; const aLevelRef: IUnknown)
Parameters:
- aName: Not used
- aCustom:
- aLevelRef: Not used
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.
InitializeRead
Locates the aName
node and puts its content into Ref
as UnicodeString
.
procedure InitializeRead(Source: TStream)
Parameters:
- Source: Data source
InitializeWrite
Prepares the internal state and output XML nodes according to aType
.
procedure InitializeWrite(aType: TROXmlRpcType; aMethodName: string)
Parameters:
- aType: Value of TROXmlRpcType
- aMethodName: (Interface) method
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.
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.
ReadArrayWithErrorHandling (declared in TROSerializer)
function ReadArrayWithErrorHandling(const aName: string; aClass: TClass; var Value: ; ArrayElementId: Integer): Boolean
Parameters:
- aName:
- aClass:
- Value:
- ArrayElementId:
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.
ReadBinaryWithErrorHandling (declared in TROSerializer)
procedure ReadBinaryWithErrorHandling(const aName: string; var Value: Binary; ArrayElementId: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
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.
ReadDateTimeWithErrorHandling (declared in TROSerializer)
procedure ReadDateTimeWithErrorHandling(const aName: string; var Value: TDateTime; ArrayElementId: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
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.
ReadDecimalWithErrorHandling (declared in TROSerializer)
procedure ReadDecimalWithErrorHandling(const aName: string; var Value: Decimal; ArrayElementId: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
ReadDecimalWithErrorHandling_cpp (declared in TROSerializer)
procedure ReadDecimalWithErrorHandling_cpp(const aName: string; var Value: Variant; ArrayElementId: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
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.
ReadDoubleWithErrorHandling (declared in TROSerializer)
procedure ReadDoubleWithErrorHandling(const aName: string; aFloatType: TFloatType; var Ref: ; ArrayElementId: Integer)
Parameters:
- aName:
- aFloatType:
- Ref:
- ArrayElementId:
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.
ReadEnumeratedWithErrorHandling (declared in TROSerializer)
procedure ReadEnumeratedWithErrorHandling(const aName: string; anEnumTypeInfo: PTypeInfo; var Ref: ; ArrayElementId: Integer)
Parameters:
- aName:
- anEnumTypeInfo:
- Ref:
- ArrayElementId:
ReadException (string, , Integer) overload 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.
ReadException (Integer, string) reintroduce overload
Reads an Exception value.
procedure ReadException(var aCode: Integer; var aMsg: string)
Parameters:
- aCode: Returns exception code
- aMsg: Returns the exception message
ReadExceptionWithErrorHandling (declared in TROSerializer)
procedure ReadExceptionWithErrorHandling(const aName: string; var Value: ; ArrayElementId: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
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.
ReadGuidWithErrorHandling (declared in TROSerializer)
procedure ReadGuidWithErrorHandling(const aName: string; var Value: TGuidString; ArrayElementId: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
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.
ReadInt64WithErrorHandling (declared in TROSerializer)
procedure ReadInt64WithErrorHandling(const aName: string; var Value: Int64; ArrayElementId: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
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.
ReadIntegerWithErrorHandling (declared in TROSerializer)
procedure ReadIntegerWithErrorHandling(const aName: string; anOrdType: TOrdType; var Ref: ; ArrayElementId: Integer)
Parameters:
- aName:
- anOrdType:
- Ref:
- ArrayElementId:
ReadLegacyString override
procedure ReadLegacyString(const aName: string; var Ref: ; ExtraAttributes: TParamAttributes; ArrayElementId: Integer; aMaxLength: Integer)
Parameters:
- aName:
- Ref:
- ExtraAttributes:
- ArrayElementId:
- aMaxLength:
ReadLegacyStringWithErrorHandling (declared in TROSerializer)
procedure ReadLegacyStringWithErrorHandling(const aName: string; var Value: string; ExtraAttributes: TParamAttributes; ArrayElementId: Integer; aMaxLength: Integer)
Parameters:
- aName:
- Value:
- ExtraAttributes:
- ArrayElementId:
- aMaxLength:
ReadObject (TObject) protected override (declared in TROSerializer)
Deserializes data of any object type.
procedure ReadObject(aObject: TObject)
Parameters:
- aObject: Object instance whose properties will be deserialized.
ReadObject (TObject) protected virtual abstract (declared in TROBaseSerializer)
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.
ReadStructWithErrorHandling (declared in TROSerializer)
function ReadStructWithErrorHandling(const aName: string; aClass: TClass; var Value: ; ArrayElementId: Integer): Boolean
Parameters:
- aName:
- aClass:
- Value:
- ArrayElementId:
ReadUnicodeString override
Locates the aName
node and puts its content into Ref
as UnicodeString
.
procedure ReadUnicodeString(const aName: string; var Ref: ; ArrayElementId: Integer; aMaxLength: Integer)
Parameters:
- aName: Element name
- Ref: Destination
- ArrayElementId: Not used
- aMaxLength: Not used
ReadUnicodeStringWithErrorHandling (declared in TROSerializer)
procedure ReadUnicodeStringWithErrorHandling(const aName: string; var Value: UnicodeString; ArrayElementId: Integer; aMaxLength: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
- aMaxLength:
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.
ReadVariantWithErrorHandling (declared in TROSerializer)
procedure ReadVariantWithErrorHandling(const aName: string; var Value: Variant; ArrayElementId: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
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.
ReadXmlWithErrorHandling (declared in TROSerializer)
procedure ReadXmlWithErrorHandling(const aName: string; var Value: IXMLNode; ArrayElementId: Integer)
Parameters:
- aName:
- Value:
- ArrayElementId:
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 (Integer, string) reintroduce overload
Creates a 'struct' node and puts aCode
into the 'faultCode' and aMsg
into the 'faultString' subnodes.
procedure WriteException(aCode: Integer; aMsg: string)
Parameters:
- aCode: Exception code
- aMsg: Exception message
WriteException (string, , Integer) overload 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.
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 (TObject) protected override (declared in TROSerializer)
Deserializes data of any object type.
procedure WriteObject(aObject: TObject)
Parameters:
- aObject: Object instance whose properties will be deserialized.
WriteObject (TObject) protected virtual abstract (declared in TROBaseSerializer)
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.
WriteToStream
Locates the aName
node and puts its content into Ref
as UnicodeString
.
procedure WriteToStream(Dest: TStream)
Parameters:
- Dest: Data source
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.