Class TDOMElementHelper

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TDOMElementHelper = class helper(TObject) for TDOMElement

Description

Hierarchy

  • TObject
  • TDOMElementHelper

Overview

Methods

Public function AttributeString(const AttrName: string; var Value: string): boolean;
Public function AttributeURL(const AttrName: string; const BaseUrl: string; var URL: string): boolean;
Public function AttributeCardinal(const AttrName: string; var Value: Cardinal): boolean;
Public function AttributeInteger(const AttrName: string; var Value: Integer): boolean;
Public function AttributeSingle(const AttrName: string; var Value: Single): boolean;
Public function AttributeFloat(const AttrName: string; var Value: Float): boolean;
Public function AttributeBoolean(const AttrName: string; var Value: boolean): boolean;
Public function AttributeString(const AttrName: string): string;
Public function AttributeURL(const AttrName: string; const BaseUrl: string): string;
Public function AttributeCardinal(const AttrName: string): Cardinal;
Public function AttributeInteger(const AttrName: string): Integer;
Public function AttributeSingle(const AttrName: string): Single;
Public function AttributeFloat(const AttrName: string): Float;
Public function AttributeBoolean(const AttrName: string): boolean;
Public function AttributeStringDef(const AttrName: string; const DefaultValue: string): string;
Public function AttributeCardinalDef(const AttrName: string; const DefaultValue: Cardinal): Cardinal;
Public function AttributeIntegerDef(const AttrName: string; const DefaultValue: Integer): Integer;
Public function AttributeSingleDef(const AttrName: string; const DefaultValue: Single): Single;
Public function AttributeFloatDef(const AttrName: string; const DefaultValue: Float): Float;
Public function AttributeBooleanDef(const AttrName: string; const DefaultValue: boolean): boolean;

Description

Methods

Public function AttributeString(const AttrName: string; var Value: string): boolean;

Read from Element attribute value and returns True, or (of there is no such attribute) returns False and does not modify Value. Value is a "var", not "out" param, because in the latter case it's guaranteed that the old Value will not be cleared.

Public function AttributeURL(const AttrName: string; const BaseUrl: string; var URL: string): boolean;

Read from Element attribute value as URL and returns True, or (of there is no such attribute) returns False and does not modify Value.

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.

Public function AttributeCardinal(const AttrName: string; var Value: Cardinal): boolean;

Read from Element attribute value as Cardinal and returns True, or (of there is no such attribute) returns False and does not modify Value.

Public function AttributeInteger(const AttrName: string; var Value: Integer): boolean;

Read from Element attribute value as Integer and returns True, or (of there is no such attribute) returns False and does not modify Value.

Public function AttributeSingle(const AttrName: string; var Value: Single): boolean;

Read from Element attribute value as Single and returns True, or (of there is no such attribute) returns False and does not modify Value.

Public function AttributeFloat(const AttrName: string; var Value: Float): boolean;

Read from Element attribute value as Float and returns True, or (of there is no such attribute) returns False and does not modify Value.

Public function AttributeBoolean(const AttrName: string; var Value: boolean): boolean;

Read from Element attribute value as Boolean and returns True, or (of there is no such attribute) returns False and does not modify Value.

A boolean value is interpreted just like FPC's TXMLConfig objects: true is designated by word true, false by word false, case is ignored. If attribute exists but it's value is not true or false, then returns False and doesn't modify Value paramater. So behaves just like the attribute didn't exist.

Public function AttributeString(const AttrName: string): string;

Retrieves from Element given attribute as a string, raises EDOMAttributeMissing if missing.

Exceptions raised
EDOMAttributeMissing
Public function AttributeURL(const AttrName: string; const BaseUrl: string): string;

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
EDOMAttributeMissing
Public function AttributeCardinal(const AttrName: string): Cardinal;

Retrieves from Element given attribute as a Cardinal, raises EDOMAttributeMissing if missing.

Exceptions raised
EDOMAttributeMissing
Public function AttributeInteger(const AttrName: string): Integer;

Retrieves from Element given attribute as an Integer, raises EDOMAttributeMissing if missing.

Exceptions raised
EDOMAttributeMissing
Public function AttributeSingle(const AttrName: string): Single;

Retrieves from Element given attribute as a Single, raises EDOMAttributeMissing if missing.

Exceptions raised
EDOMAttributeMissing
Public function AttributeFloat(const AttrName: string): Float;

Retrieves from Element given attribute as a Float, raises EDOMAttributeMissing if missing.

Exceptions raised
EDOMAttributeMissing
Public function AttributeBoolean(const AttrName: string): boolean;

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 true, false by word false, case is ignored.

If attribute exists but it's value is not true or false, then raises EDOMAttributeMissing. So behaves just like the attribute didn't exist.

Exceptions raised
EDOMAttributeMissing
Public function AttributeStringDef(const AttrName: string; const DefaultValue: string): string;

Retrieves from Element given attribute as a string, or a default value.

Public function AttributeCardinalDef(const AttrName: string; const DefaultValue: Cardinal): Cardinal;

Retrieves from Element given attribute as a Cardinal, or a default value.

Public function AttributeIntegerDef(const AttrName: string; const DefaultValue: Integer): Integer;

Retrieves from Element given attribute as an Integer, or a default value.

Public function AttributeSingleDef(const AttrName: string; const DefaultValue: Single): Single;

Retrieves from Element given attribute as a Single, or a default value.

Public function AttributeFloatDef(const AttrName: string; const DefaultValue: Float): Float;

Retrieves from Element given attribute as a Float, or a default value.

Public function AttributeBooleanDef(const AttrName: string; const DefaultValue: boolean): boolean;

Retrieves from Element given attribute as a boolean, returns a default value if missing or has invalid value.


Generated by PasDoc 0.14.0.