Class TrwXMLParser

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TrwXMLParser = class(TObject)

Description

Hierarchy

Overview

Fields

Private fInputStream: TStream;
Private FElementName: AnsiString;
Private FAttribs: TStringList;
Private FData: AnsiString;
Private FEndFound: boolean;
Private FValidRead: boolean;
Private FBuffer: PAnsiChar;
Private FStreamSize: integer;
Private FShowProgress: boolean;

Methods

Private procedure SetAttribs(const Value: TStringList);
Private procedure SetElementName(const Value: AnsiString);
Private procedure SetData(const Value: AnsiString);
Private procedure SetEndFound(const Value: boolean);
Private procedure SetValidRead(const Value: boolean);
Private procedure TrimSpaces;
Private procedure SetStreamSize(const Value: integer);
Private function ReadNameStr: AnsiString;
Private procedure ReadAttrStr(var AAttrib : AnsiString; var isLast: boolean);
Private function getNextChar: AnsiChar;
Private function CheckNextChar: AnsiChar;
Private procedure CharBack;
Private procedure ReadData;
Private procedure SetShowProgress(const Value: boolean);
Public constructor Create(Stream: TStream);
Public destructor Destroy; override;
Public procedure ReadNextElement; virtual;
Public function EOS: boolean;
Public function ValueOf(const aName: AnsiString): AnsiString;
Public function IntegerData: Integer;
Public function Int64Data: Int64;
Public function FloatData: Extended;

Properties

Public property ValidRead: boolean read FValidRead write SetValidRead;
Public property ElementName: AnsiString read FElementName write SetElementName;
Public property Attribs: TStringList read FAttribs write SetAttribs;
Public property Data: AnsiString read FData write SetData;
Public property EndFound: boolean read FEndFound write SetEndFound;
Public property StreamSize: integer read FStreamSize write SetStreamSize;
Public property ShowProgress: boolean read FShowProgress write SetShowProgress;

Description

Fields

Private fInputStream: TStream;

the stream which holds the XML formated DFM / component stream

Private FElementName: AnsiString;
 
Private FAttribs: TStringList;
 
Private FData: AnsiString;
 
Private FEndFound: boolean;
 
Private FValidRead: boolean;
 
Private FBuffer: PAnsiChar;
 
Private FStreamSize: integer;
 
Private FShowProgress: boolean;
 

Methods

Private procedure SetAttribs(const Value: TStringList);

property setter for the Attribs

Private procedure SetElementName(const Value: AnsiString);

property setter for the ElementName of the last read Element

Private procedure SetData(const Value: AnsiString);

property setter for the Data of the last read XML element

Private procedure SetEndFound(const Value: boolean);

property setter for if a end is found in the last read

Private procedure SetValidRead(const Value: boolean);

property setter for if the last read was valid

Private procedure TrimSpaces;

removes the spaces from the current line

Private procedure SetStreamSize(const Value: integer);

Property Setter

Private function ReadNameStr: AnsiString;

Reads a validName form the stream

Private procedure ReadAttrStr(var AAttrib : AnsiString; var isLast: boolean);

Read a full Attribute from the stream

Private function getNextChar: AnsiChar;
 
Private function CheckNextChar: AnsiChar;
 
Private procedure CharBack;
 
Private procedure ReadData;
 
Private procedure SetShowProgress(const Value: boolean);
 
Public constructor Create(Stream: TStream);

The constructor gets a Stream which hold the XML formatted DFM / Component stream

Public destructor Destroy; override;

The destructor cleans all temporary claimed memory.

Public procedure ReadNextElement; virtual;

Read the Next Element with all its Attribs and data if on the same line

Public function EOS: boolean;

This function returns true if we are at the end of the stream

Public function ValueOf(const aName: AnsiString): AnsiString;

Returns the value of Attribute

Public function IntegerData: Integer;

Returns the Data as a Integer

Public function Int64Data: Int64;

The Value can be a 64 bit integer

Public function FloatData: Extended;

Returns the Data as a Float

Properties

Public property ValidRead: boolean read FValidRead write SetValidRead;

True if the last read was ended with a valid Element

Public property ElementName: AnsiString read FElementName write SetElementName;

The name of the last read Element

Public property Attribs: TStringList read FAttribs write SetAttribs;

All attributes of the last read Element are saved in a stringlist

Public property Data: AnsiString read FData write SetData;

The Data in the form of a AnsiString

Public property EndFound: boolean read FEndFound write SetEndFound;

If the Element was closed then this property is true

Public property StreamSize: integer read FStreamSize write SetStreamSize;

The actual size of the stream.

Public property ShowProgress: boolean read FShowProgress write SetShowProgress;
 

Generated by PasDoc 0.12.1 on 2013-05-13 15:42:00