Class TDOMElementHelper
Unit
Declaration
type TDOMElementHelper = class helper(TObject) for TDOMElement
Description
This item has no 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; |
|
procedure AttributeColorSet(const AttrName: String; const Value: TCastleColor); overload; |
|
procedure AttributeColorSet(const AttrName: String; const Value: TCastleColorRGB); overload; |
|
function Child(const ChildName: String; const Required: boolean = true; const WarnOnMultiple: boolean = true): TDOMElement; |
|
function ChildElement(const ChildName: String; const Required: boolean = true; const WarnOnMultiple: 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 This can read a color value in any of these formats:
In effect, you can write TCastleColor values to XML using AttributeSet or AttributeColorSet, they both can be read back using this method. |
function AttributeColorRGB(const AttrName: String; var Value: TCastleColorRGB): Boolean; overload; |
|
Read from Element attribute value as RGB color and returns This can read a color value in any of these formats:
In effect, you can write TCastleColorRGB values to XML using AttributeSet or AttributeColorSet, they both can be read back using this method. |
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. |
procedure AttributeColorSet(const AttrName: String; const Value: TCastleColor); overload; |
|
Set the attribute as TCastleColor converted to HEX string, such that it's readable back by AttributeColor and AttributeColorDef. |
procedure AttributeColorSet(const AttrName: String; const Value: TCastleColorRGB); overload; |
|
Set the attribute as TCastleColorRGB converted to HEX string, such that it's readable back by AttributeColorRGB and AttributeColorRGBDef. |
function Child(const ChildName: String; const Required: boolean = true; const WarnOnMultiple: 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 If there are multiple occurences and Required is Exceptions raised
|
function ChildElement(const ChildName: String; const Required: boolean = true; const WarnOnMultiple: 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-snapshot.