Class TDOMElementHelper
Unit
Declaration
type TDOMElementHelper = class helper(TObject) for TDOMElement
Description
Hierarchy
- TObject
- TDOMElementHelper
Overview
Methods
function AttributeString(const AttrName: string; var Value: string): boolean; overload; |
|
function AttributeURL(const AttrName: string; const BaseUrl: string; var URL: string): boolean; overload; |
|
function AttributeCardinal(const AttrName: string; var Value: Cardinal): boolean; overload; |
|
function AttributeInteger(const AttrName: string; var Value: Integer): boolean; overload; |
|
function AttributeInt64(const AttrName: string; var Value: Int64): boolean; overload; |
|
function AttributeQWord(const AttrName: string; var Value: QWord): boolean; overload; |
|
function AttributeSingle(const AttrName: string; var Value: Single): boolean; overload; |
|
function AttributeFloat(const AttrName: string; var Value: Float): boolean; overload; |
|
function AttributeBoolean(const AttrName: string; var Value: boolean): boolean; overload; |
|
function AttributeColor(const AttrName: string; var Value: TCastleColor): boolean; overload; |
|
function AttributeColorRGB(const AttrName: string; var Value: TCastleColorRGB): boolean; overload; |
|
function AttributeVector2(const AttrName: string; var Value: TVector2): boolean; overload; |
|
function AttributeVector3(const AttrName: string; var Value: TVector3): boolean; overload; |
|
function AttributeVector4(const AttrName: string; var Value: TVector4): boolean; overload; |
|
function AttributeString(const AttrName: string): string; overload; |
|
function AttributeURL(const AttrName: string; const BaseUrl: string): string; overload; |
|
function AttributeCardinal(const AttrName: string): Cardinal; overload; |
|
function AttributeInteger(const AttrName: string): Integer; overload; |
|
function AttributeInt64(const AttrName: string): Int64; overload; |
|
function AttributeQWord(const AttrName: string): QWord; overload; |
|
function AttributeSingle(const AttrName: string): Single; overload; |
|
function AttributeFloat(const AttrName: string): Float; overload; |
|
function AttributeBoolean(const AttrName: string): boolean; overload; |
|
function AttributeColor(const AttrName: string): TCastleColor; overload; |
|
function AttributeColorRGB(const AttrName: string): TCastleColorRGB; overload; |
|
function AttributeVector2(const AttrName: string): TVector2; overload; |
|
function AttributeVector3(const AttrName: string): TVector3; overload; |
|
function AttributeVector4(const AttrName: string): TVector4; overload; |
|
function AttributeStringDef(const AttrName: string; const DefaultValue: string): string; |
|
function AttributeCardinalDef(const AttrName: string; const DefaultValue: Cardinal): Cardinal; |
|
function AttributeIntegerDef(const AttrName: string; const DefaultValue: Integer): Integer; |
|
function AttributeInt64Def(const AttrName: string; const DefaultValue: Int64): Int64; |
|
function AttributeQWordDef(const AttrName: string; const DefaultValue: QWord): QWord; |
|
function AttributeSingleDef(const AttrName: string; const DefaultValue: Single): Single; |
|
function AttributeFloatDef(const AttrName: string; const DefaultValue: Float): Float; |
|
function AttributeBooleanDef(const AttrName: string; const DefaultValue: boolean): boolean; |
|
function AttributeColorDef(const AttrName: string; const DefaultValue: TCastleColor): TCastleColor; |
|
function AttributeColorRGBDef(const AttrName: string; const DefaultValue: TCastleColorRGB): TCastleColorRGB; |
|
function AttributeVector2Def(const AttrName: string; const DefaultValue: TVector2): TVector2; |
|
function AttributeVector3Def(const AttrName: string; const DefaultValue: TVector3): TVector3; |
|
function AttributeVector4Def(const AttrName: string; const DefaultValue: TVector4): TVector4; |
|
procedure AttributeSet(const AttrName: string; const Value: string); overload; |
|
procedure AttributeSet(const AttrName: string; const Value: boolean); overload; |
|
procedure AttributeSet(const AttrName: string; const Value: Integer); overload; |
|
procedure AttributeSet(const AttrName: string; const Value: Int64); overload; |
|
procedure AttributeSet(const AttrName: string; const Value: QWord); overload; |
|
procedure AttributeSet(const AttrName: string; const Value: Cardinal); overload; |
|
procedure AttributeSet(const AttrName: string; const Value: Single); overload; |
|
procedure AttributeSet(const AttrName: string; const Value: TVector2); overload; |
|
procedure AttributeSet(const AttrName: string; const Value: TVector3); overload; |
|
procedure AttributeSet(const AttrName: string; const Value: TVector4); overload; |
|
function Child(const ChildName: string; const Required: boolean = true): TDOMElement; |
|
function ChildElement(const ChildName: string; const Required: boolean = true): TDOMElement; |
|
function CreateChild(const ChildName: string): TDOMElement; |
|
function ChildrenIterator: TXMLElementIterator; overload; |
|
function ChildrenIterator(const ChildName: string): TXMLElementIterator; overload; |
|
function TextData: string; |
|
function TagName8: string; |
Description
Methods
function AttributeFloat(const AttrName: string; var Value: Float): boolean; overload; |
|
Read from Element attribute value as Float and returns Note: for powerful reading of float expressions, consider using |
function AttributeColor(const AttrName: string; var Value: TCastleColor): boolean; overload; |
|
Read from Element attribute value as color and returns |
function AttributeColorRGB(const AttrName: string; var Value: TCastleColorRGB): boolean; overload; |
|
Read from Element attribute value as RGB color and returns |
function AttributeVector2(const AttrName: string; var Value: TVector2): boolean; overload; |
|
Read from Element attribute as a 2D vector (2 floats), and returns Exceptions raised
|
function AttributeVector3(const AttrName: string; var Value: TVector3): boolean; overload; |
|
Read from Element attribute as a 3D vector (3 floats), and returns Exceptions raised
|
function AttributeVector4(const AttrName: string; var Value: TVector4): boolean; overload; |
|
Read from Element attribute as a 4D vector(4 floats, e.g. rotation), and returns Exceptions raised
|
function AttributeString(const AttrName: string): string; overload; |
|
Retrieves from Element given attribute as a string, raises EDOMAttributeMissing if missing. Note that the attribute is required, but it's value may still be empty if it's explicitly set to empty in XML (by Exceptions raised |
function AttributeURL(const AttrName: string; const BaseUrl: string): string; overload; |
|
Retrieves from Element given attribute as an absolute URL, raises EDOMAttributeMissing if missing. Returned URL is always absolute. The value in file may be a relative URL, it is resolved with respect to BaseUrl, that must be absolute. Exceptions raised |
function AttributeCardinal(const AttrName: string): Cardinal; overload; |
|
Retrieves from Element given attribute as a Cardinal, raises EDOMAttributeMissing if missing. Exceptions raised |
function AttributeInteger(const AttrName: string): Integer; overload; |
|
Retrieves from Element given attribute as an Integer, raises EDOMAttributeMissing if missing. Exceptions raised |
function AttributeInt64(const AttrName: string): Int64; overload; |
|
Retrieves from Element given attribute as an Int64, raises EDOMAttributeMissing if missing. Exceptions raised |
function AttributeQWord(const AttrName: string): QWord; overload; |
|
Retrieves from Element given attribute as an QWord, raises EDOMAttributeMissing if missing. Exceptions raised |
function AttributeSingle(const AttrName: string): Single; overload; |
|
Retrieves from Element given attribute as a Single, raises EDOMAttributeMissing if missing. Exceptions raised |
function AttributeFloat(const AttrName: string): Float; overload; |
|
Retrieves from Element given attribute as a Float, raises EDOMAttributeMissing if missing. Note: for powerful reading of float expressions, consider using Exceptions raised |
function AttributeBoolean(const AttrName: string): boolean; overload; |
|
Retrieves from Element given attribute as a boolean, raises EDOMAttributeMissing if missing or has invalid value. A boolean value is interpreted just like FPC's TXMLConfig objects: true is designated by word If attribute exists but it's value is not Exceptions raised |
function AttributeColor(const AttrName: string): TCastleColor; overload; |
|
Retrieves from Element given attribute as a color, raises EDOMAttributeMissing if missing or has invalid format. Exceptions raised |
function AttributeColorRGB(const AttrName: string): TCastleColorRGB; overload; |
|
Retrieves from Element given attribute as an RGB color, raises EDOMAttributeMissing if missing or has invalid format. Exceptions raised |
function AttributeVector2(const AttrName: string): TVector2; overload; |
|
Retrieves from Element given attribute as a 2D vector (2 floats), raises EDOMAttributeMissing if missing or has invalid format. Exceptions raised |
function AttributeVector3(const AttrName: string): TVector3; overload; |
|
Retrieves from Element given attribute as a 3D vector (3 floats), raises EDOMAttributeMissing if missing or has invalid format. Exceptions raised |
function AttributeVector4(const AttrName: string): TVector4; overload; |
|
Retrieves from Element given attribute as a 4D vector (4 floats, e.g. rotation), raises EDOMAttributeMissing if missing or has invalid format. Exceptions raised |
function AttributeCardinalDef(const AttrName: string; const DefaultValue: Cardinal): Cardinal; |
|
Retrieves from Element given attribute as a Cardinal, or a default value. |
function AttributeIntegerDef(const AttrName: string; const DefaultValue: Integer): Integer; |
|
Retrieves from Element given attribute as an Integer, or a default value. |
function AttributeInt64Def(const AttrName: string; const DefaultValue: Int64): Int64; |
|
Retrieves from Element given attribute as an Int64, or a default value. |
function AttributeQWordDef(const AttrName: string; const DefaultValue: QWord): QWord; |
|
Retrieves from Element given attribute as an QWord, or a default value. |
function AttributeSingleDef(const AttrName: string; const DefaultValue: Single): Single; |
|
Retrieves from Element given attribute as a Single, or a default value. |
function AttributeFloatDef(const AttrName: string; const DefaultValue: Float): Float; |
|
Retrieves from Element given attribute as a Float, or a default value. Note: for powerful reading of float expressions, consider using |
function AttributeColorDef(const AttrName: string; const DefaultValue: TCastleColor): TCastleColor; |
|
Retrieves from Element given attribute as a color, or a default value. |
function AttributeColorRGBDef(const AttrName: string; const DefaultValue: TCastleColorRGB): TCastleColorRGB; |
|
Retrieves from Element given attribute as an RGB color, or a default value. |
function AttributeVector2Def(const AttrName: string; const DefaultValue: TVector2): TVector2; |
|
Retrieves from Element given attribute as a 2D vector (2 floats), or a default value. Exceptions raised
|
function AttributeVector3Def(const AttrName: string; const DefaultValue: TVector3): TVector3; |
|
Retrieves from Element given attribute as a 3D vector (3 floats), or a default value. Exceptions raised
|
function AttributeVector4Def(const AttrName: string; const DefaultValue: TVector4): TVector4; |
|
Retrieves from Element given attribute as a 4D vector (4 floats), or a default value. Exceptions raised
|
procedure AttributeSet(const AttrName: string; const Value: string); overload; |
|
Set the attribute as string. Equivalent to standard SetAttribute in DOM unit, but provided here for consistency with other AttributeSet overloads. |
procedure AttributeSet(const AttrName: string; const Value: boolean); overload; |
|
Set the attribute as boolean, such that it's readable back by AttributeBoolean and AttributeBooleanDef. |
procedure AttributeSet(const AttrName: string; const Value: Integer); overload; |
|
Set the attribute as Integer, such that it's readable back by AttributeInteger and AttributeIntegerDef. |
procedure AttributeSet(const AttrName: string; const Value: Int64); overload; |
|
Set the attribute as Int64, such that it's readable back by AttributeInt64 and AttributeInt64Def. |
procedure AttributeSet(const AttrName: string; const Value: QWord); overload; |
|
Set the attribute as QWord, such that it's readable back by AttributeQWord and AttributeQWordDef. |
procedure AttributeSet(const AttrName: string; const Value: Cardinal); overload; |
|
Set the attribute as Cardinal, such that it's readable back by AttributeCardinal and AttributeCardinalDef. |
procedure AttributeSet(const AttrName: string; const Value: Single); overload; |
|
Set the attribute as Single, such that it's readable back by AttributeSingle and AttributeSingleDef. |
procedure AttributeSet(const AttrName: string; const Value: TVector2); overload; |
|
Set the attribute as TVector2, such that it's readable back by AttributeVector2 and AttributeVector2Def. |
procedure AttributeSet(const AttrName: string; const Value: TVector3); overload; |
|
Set the attribute as TVector3, such that it's readable back by AttributeVector3 and AttributeVector3Def. |
procedure AttributeSet(const AttrName: string; const Value: TVector4); overload; |
|
Set the attribute as TVector4, such that it's readable back by AttributeVector4 and AttributeVector4Def. |
function Child(const ChildName: string; const Required: boolean = true): TDOMElement; |
|
Get child element with given ChildName. For example use <level> <creatures> ... </creatures> <items> ... </items> </level>
There must be one and only one child element with this name. In case there's zero, or more than one such element, we will raise EDOMChildElementError (if Required is Exceptions raised
|
function ChildElement(const ChildName: string; const Required: boolean = true): TDOMElement; |
|
Same as Child. |
function CreateChild(const ChildName: string): TDOMElement; |
|
Create a new child element under this element, and return it. |
function ChildrenIterator: TXMLElementIterator; overload; |
|
Iterator over all children elements. Use like this: var I: TXMLElementIterator; begin I := Element.ChildrenIterator; try while I.GetNext do begin // ... here goes your code to process I.Current ... end; finally FreeAndNil(I) end; end; |
function ChildrenIterator(const ChildName: string): TXMLElementIterator; overload; |
|
Iterator over all children elements named ChildName. Use like this: var I: TXMLElementIterator; begin I := Element.ChildrenIterator('item'); try while I.GetNext do begin // ... here goes your code to process I.Current ... end; finally FreeAndNil(I) end; end; |
function TagName8: string; |
|
Tag name (element name). Expressed as an 8-bit string (in UTF-8 encoding), contrary to the TagName from FPC DOM unit that is a WideString (DOMString). |
Generated by PasDoc 0.16.0.