TXMLToRODL
Overview
The TXMLToRODL class is a specialization of the TRODLReader class for decoding
streamed RODL data in the XML format into a TRODLLibrary instance. You may use it to load
RODL files, resources, etc.
Use case
Take a look at this excerpt from the 'uRODL.pas' file:
function ReadRODLFromFile(aReaderClass: TRODLReaderClass; const aFileName: string): TRODLLibrary;
begin
with aReaderClass.Create do try
result := ReadFromFile(aFileName);
finally
Free;
end;
end;
It
may be used as
//...
var
lib: TRODLLibrary;
begin
lib := ReadRODLFromFile(TXMLToRODL,
'...');
//...
Location
- Unit: uXMLToRODL.pas
- Ancestry: TRODLReader | TXMLToRODL
Instance Methods
constructor Create virtual (declared in TRODLReader)
Creates a new instance.
constructor Create
constructor Create (TRODLLibrary, boolean) reintroduce overload
Initializes the instance with the given parameters.
constructor Create(iAddToExisting: TRODLLibrary; iRecreateGuids: boolean)
Parameters:
- iAddToExisting: Instance to append data to or
Nil
to create a new TRODLLibrary instance - iRecreateGuids: If false this method uses the value of the 'UID' attribute from the source XML, if true it generates a new GUID while loading
LoadFileToLibrary
Loads XML data from the iFilename
file into the iLibrary
.
procedure LoadFileToLibrary(iFilename: string; iLibrary: TRODLLibrary; iRodlUse: TRODLUse)
Parameters:
- iFilename: Name of the source file
- iLibrary: Target instance to load data
- iRodlUse: Represents a reference to an existing RODL file
Read (declared in TRODLReader)
function Read(aStream: TStream; const aFilename: string): TRODLLibrary
Parameters:
- aStream:
- aFilename:
ReadFromFile (declared in TRODLReader)
function ReadFromFile(const aFileName: string): TRODLLibrary
Parameters:
- aFileName:
ReadFromString (ROUTF8String, string): TRODLLibrary overload
Loads XML data from the aString
in-memory data and returns a new TRODLLibrary instance.
function ReadFromString(const anUTF8String: ROUTF8String; const aFilename: string): TRODLLibrary
Parameters: