Class TidElement

Unit

Declaration

type TidElement = class(TXOMObject)

Description

TidElement

Hierarchy

  • TXOMObject
  • TidElement

Overview

Fields

Public FValue: Variant;

Methods

Public destructor Destroy; override;
Public procedure AfterConstruction; override;
Public procedure BeforeDestruction; override;
Public procedure Assign (_Source: TObject); override;
Public function GetAttr(const AAttribute: WideString): Variant;
Public procedure SetAttr(const AAttribute: WideString; const Value: Variant);
Public function GetProp (const AProperty: WideString): Variant; reintroduce;
Public procedure SetProp (const AProperty: WideString; const AValue: Variant); reintroduce;
Public function AddProperty(const AProperty: WideString; const AValue: Variant): TidElement;
Public function AddProp(const AProperty: WideString; const AValue: Variant): TidElement;
Public function AddBinaryProp(const AProperty: WideString; const AStream: TStream): TidElement;
Public function AddBinaryPropObject(const AProperty: WideString; const AObject: TObject): TidElement;
Public function ReadBinaryPropObject(const AProperty: WideString; const AObject: TObject): Boolean;
Public function BinaryPropSize(const AProperty: WideString): Int64;
Public function DelProp(const AProperty: WideString): Boolean;
Public function AddAttr (const AAttribute: WideString; const AValue: Variant): TidElement;
Public function DelAttr (const AAttribute: WideString): Boolean;
Public procedure StoreXOMProps (AObject: TPersistent; APropsList: TList);
Public procedure StoreXOMObject (AObject: TXOMObject);
Public procedure StoreXOMClass (AClass: TXOMClass);
Public procedure StoreXOMModel (AModel: TXOMModel);
Public procedure RestoreXOMProps (AObject: TPersistent; APropsList: TList);
Public procedure RestoreXOMObject (AObject: TXOMObject);
Public procedure RestoreXOMClass (AClass: TXOMClass);
Public procedure RestoreXOMModel (AModel: TXOMModel);
Public procedure LoadFromXMLStream(AXmlStream: TStream); virtual;
Public procedure LoadFromXML(const AXmlStr: String); virtual;
Public procedure LoadFromXMLFile(const AFileName: WideString); virtual;
Public procedure SaveAsXMLStream(AXmlStream: TStream); virtual;
Public procedure SaveAsJSONStream(AJsonStream: TStream; ASelfIncluded: Boolean = True); virtual;
Public function SaveAsXML: String; virtual;
Public function SaveAsJSON(ASelfIncluded: Boolean = True): String; virtual;
Public function SaveAsXMLFile (const AFilename: WideString): Boolean; virtual;
Public function SaveAsJSONFile (const AFilename: WideString): Boolean; virtual;
Public function SaveAsFormattedXMLFile (const AFilename: WideString): Boolean; virtual;
Public procedure LoadFromJSON(const AJSONStr: AnsiString; AIntoJSONcontainer: Boolean = True); virtual;
Public procedure WideLoadFromJSON(const AJSONStr: WideString; AIntoJSONcontainer: Boolean = True); virtual;
Public procedure LoadFromJSONStream (const AStream: TStream; AIntoJSONcontainer: Boolean = True); virtual;
Public procedure LoadFromJSONFile (const AFileName: WideString); virtual;
Public procedure LoadFromDOP( ADopStr: WideString); virtual;
Public procedure LoadFromDOPFile(const AFileName: WideString); virtual;
Public procedure Reset; virtual;
Public procedure Clear; virtual;
Public function IndexOfProp (const AProperty: WideString): Integer; virtual;
Public function IndexOfAttr (const AAttribute: WideString): Integer; virtual;
Public procedure Merge (AElem: TidElement);
Public procedure MergeTo (AElem: TidElement);
Public function EnumElems (const AProperty: WideString; AResult: TList; ARecursive: Boolean = False): Boolean;
Public function EnumProps (const AProperty: WideString; AResult: TList; ARecursive: Boolean = False): Boolean;
Public function EnumValues (const AValue: Variant; AResult: TList; ARecursive: Boolean = False): Boolean;
Public function EnumPropsWithPropValue (const AValue: Variant; AResult: TList; ARecursive: Boolean = False): Boolean;
Public function EnumPropsWithAttrValue (const AValue: Variant; AResult: TList; ARecursive: Boolean = False): Boolean;
Public function FindProp (const AProperty: WideString): TidElement;
Public function FindPropValue (const AProperty: WideString; const AValue: Variant; ARecursive: Boolean = True): TidElement; virtual;
Public function FindValue (const AValue: Variant; AOffsetElem: TidElement = nil): TidElement;
Public function FindAttr (const AAttr: WideString): TidElement;
Public function FindHierarchyProp (AHierarchy: TxomStrings; ACreateIfNew: Boolean = False): TidElement;
Public function FindHierarchyDotProp (const ADotHierarchy: WideString; ACreateIfNew: Boolean = False): TidElement;
Public function FindHierarchyCSVProp (const ACSVHierarchy: WideString; ACreateIfNew: Boolean = False): TidElement;
Public function FindPropWithAttrVal(const AAttrName: WideString; const AAttrVal: Variant): TidElement;

Properties

Public property Properties[constAProperty:WideString]: Variant read GetProp write SetProp;
Public property Prop[constAProperty:WideString]: Variant read GetProp write SetProp;
Public property Values[constAProperty:WideString]: Variant read GetProp write SetProp;
Public property Attr[constAAttribute:WideString]: Variant read GetAttr write SetAttr;
Public property PropAttr[constAPropAttr:WideString]: Variant read GetPropAttr write SetPropAttr;
Public property PropAttrVal[APropAttrVal:WideString]: TidElement read GetPropAttrVal;
Public property Elem[constAName:WideString]: TidElement read GetElem;
Public property AttrElem[constAName:WideString]: TidElement read GetAttrElem;
Public property Data: TObject read FData write FData;
Public property Data2: TObject read FData2 write FData2;
Public property Data3: TObject read FData3 write FData3;
Public property OwnedData: TObject read FOwnedData write SetOwnedData;
Public property OwnedData2: TObject read FOwnedData2 write SetOwnedData2;
Public property BinaryValue: TStream read FBinaryValue;
Public property _BinaryValue: TStream read FBinaryValue write FBinaryValue;
Public property _Elements: TidElements read FElements write FElements;
Public property OnHandle: TNotifyEvent read FOnHandle write FOnHandle;
Public property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;
Published property Value: Variant read FValue write FValue stored False;
Published property TypedXML: Boolean read FTypedXML write FTypedXML;
Published property SaveWithHeader: Boolean read FSaveWithHeader write FSaveWithHeader;
Published property AllowDuplicates: Boolean read FAllowDuplicates write FAllowDuplicates;
Published property UTF8Encoded: Boolean read FUTF8Encoded write FUTF8Encoded;
Published property IsBinary: Boolean read GetIsBinary write SetIsBinary;
Published property Elements: TidElements read GetElements write FElements;
Published property Attributes: TidElements read GetAttributes write FAttributes;
Published property JustABunchOfObjects: Boolean read FJustABunchOfObjects write FJustABunchOfObjects;
Published property Tag: PtrInt read FTag write FTag;
Published property Count: Integer read GetCount stored False;
Published property PropCount: Integer read GetCount stored False;
Published property AttrCount: Integer read GetAttrCount stored False;

Description

Fields

Public FValue: Variant;
 

Methods

Public destructor Destroy; override;

must be public

Public procedure AfterConstruction; override;
 
Public procedure BeforeDestruction; override;
 
Public procedure Assign (_Source: TObject); override;
 
Public function GetAttr(const AAttribute: WideString): Variant;
 
Public procedure SetAttr(const AAttribute: WideString; const Value: Variant);
 
Public function GetProp (const AProperty: WideString): Variant; reintroduce;
 
Public procedure SetProp (const AProperty: WideString; const AValue: Variant); reintroduce;

hide TXOMObject.GetProp

Public function AddProperty(const AProperty: WideString; const AValue: Variant): TidElement;

hide TXOMOBject.SetProp identical to AddProp

Public function AddProp(const AProperty: WideString; const AValue: Variant): TidElement;

add a property with its value

Public function AddBinaryProp(const AProperty: WideString; const AStream: TStream): TidElement;

add a binary property with its stream

Public function AddBinaryPropObject(const AProperty: WideString; const AObject: TObject): TidElement;

add a binary property with its stream from a TXOMObject or TXOMClass

Public function ReadBinaryPropObject(const AProperty: WideString; const AObject: TObject): Boolean;

read a TXOMObject or TXOMClass from a binary property

Public function BinaryPropSize(const AProperty: WideString): Int64;

read the size of a binary property

Public function DelProp(const AProperty: WideString): Boolean;

delete a named property

Public function AddAttr (const AAttribute: WideString; const AValue: Variant): TidElement;

add an attribute with its value

Public function DelAttr (const AAttribute: WideString): Boolean;

delete a named attribute

Public procedure StoreXOMProps (AObject: TPersistent; APropsList: TList);

stream out a (X)OMProps to this element

Public procedure StoreXOMObject (AObject: TXOMObject);

stream out an XOMObject to this element

Public procedure StoreXOMClass (AClass: TXOMClass);

stream out an XOMClass to this element

Public procedure StoreXOMModel (AModel: TXOMModel);

stream out an XOMClass to this element

Public procedure RestoreXOMProps (AObject: TPersistent; APropsList: TList);

stream in a (X)OMProps from this element

Public procedure RestoreXOMObject (AObject: TXOMObject);

stream in an XOMObject from this element (should be filled with content from StoreXOMObject)

Public procedure RestoreXOMClass (AClass: TXOMClass);

stream in an XOMClass from this element (should be filled with content from StoreXOMClass)

Public procedure RestoreXOMModel (AModel: TXOMModel);

stream in an XOMModel from this element (should be filled with content from StoreXOMModel)

Public procedure LoadFromXMLStream(AXmlStream: TStream); virtual;

load the content from a XML stream

Public procedure LoadFromXML(const AXmlStr: String); virtual;

load the content from a XML string

Public procedure LoadFromXMLFile(const AFileName: WideString); virtual;

load the content from a XML file

Public procedure SaveAsXMLStream(AXmlStream: TStream); virtual;

save the content as XMP to stream

Public procedure SaveAsJSONStream(AJsonStream: TStream; ASelfIncluded: Boolean = True); virtual;

save the content as JSON to stream

Public function SaveAsXML: String; virtual;

store the content as XML and return the XML string

Public function SaveAsJSON(ASelfIncluded: Boolean = True): String; virtual;

store the content as JSON and return the JSON string

Public function SaveAsXMLFile (const AFilename: WideString): Boolean; virtual;

store the XML content to a file

Public function SaveAsJSONFile (const AFilename: WideString): Boolean; virtual;

store the JSON content to a file

Public function SaveAsFormattedXMLFile (const AFilename: WideString): Boolean; virtual;

store the nice (better readable) formatted XML content to a file

Public procedure LoadFromJSON(const AJSONStr: AnsiString; AIntoJSONcontainer: Boolean = True); virtual;

load the content from a JSON string

Public procedure WideLoadFromJSON(const AJSONStr: WideString; AIntoJSONcontainer: Boolean = True); virtual;
 
Public procedure LoadFromJSONStream (const AStream: TStream; AIntoJSONcontainer: Boolean = True); virtual;
 
Public procedure LoadFromJSONFile (const AFileName: WideString); virtual;
 
Public procedure LoadFromDOP( ADopStr: WideString); virtual;

load the content from a DOP string (DOP = DxO Optical Pro)

Public procedure LoadFromDOPFile(const AFileName: WideString); virtual;

load the content from a DOP file (DOP = DxO Optical Pro)

Public procedure Reset; virtual;

clear the element content

Public procedure Clear; virtual;

clear the element content (identical to Reset)

Public function IndexOfProp (const AProperty: WideString): Integer; virtual;

find the index of a property; 0-offset; -1 = not found

Public function IndexOfAttr (const AAttribute: WideString): Integer; virtual;

find the index of an attribute; 0-offset; -1 = not found

Public procedure Merge (AElem: TidElement);

merge a specific element with all properties and attributes with this element

Public procedure MergeTo (AElem: TidElement);

merge this element with all properties and attributes with a specific element

Public function EnumElems (const AProperty: WideString; AResult: TList; ARecursive: Boolean = False): Boolean;

find all elements with identical names and return the found elements in a TList

Public function EnumProps (const AProperty: WideString; AResult: TList; ARecursive: Boolean = False): Boolean;

identical to EnumElems

Public function EnumValues (const AValue: Variant; AResult: TList; ARecursive: Boolean = False): Boolean;

find all elements with a specific value; optionally specify that the elemnt should be search hierarchically

Public function EnumPropsWithPropValue (const AValue: Variant; AResult: TList; ARecursive: Boolean = False): Boolean;

find all elements that have a sub property defined with a specific value; optionally specify that the elemnt should be search hierarchically

Public function EnumPropsWithAttrValue (const AValue: Variant; AResult: TList; ARecursive: Boolean = False): Boolean;

find all elements that have an attribute defined with a specific value; optionally specify that the elemnt should be search hierarchically

Public function FindProp (const AProperty: WideString): TidElement;

find a specific property by its name (not hierarchical)

Public function FindPropValue (const AProperty: WideString; const AValue: Variant; ARecursive: Boolean = True): TidElement; virtual;

find the elements that has a prop with specific value

Public function FindValue (const AValue: Variant; AOffsetElem: TidElement = nil): TidElement;

find the first elements with a specific value;

Public function FindAttr (const AAttr: WideString): TidElement;

find a specific attribute by its name (not hierarchical)

Public function FindHierarchyProp (AHierarchy: TxomStrings; ACreateIfNew: Boolean = False): TidElement;

find a specific prop as defined by a hierarchy as stored in AHierarchy

Public function FindHierarchyDotProp (const ADotHierarchy: WideString; ACreateIfNew: Boolean = False): TidElement;
 
Public function FindHierarchyCSVProp (const ACSVHierarchy: WideString; ACreateIfNew: Boolean = False): TidElement;
 
Public function FindPropWithAttrVal(const AAttrName: WideString; const AAttrVal: Variant): TidElement;

find a specfic property that has a specific attribute with a specific value

Properties

Public property Properties[constAProperty:WideString]: Variant read GetProp write SetProp;
 
Public property Prop[constAProperty:WideString]: Variant read GetProp write SetProp;
 
Public property Values[constAProperty:WideString]: Variant read GetProp write SetProp;
 
Public property Attr[constAAttribute:WideString]: Variant read GetAttr write SetAttr;
 
Public property PropAttr[constAPropAttr:WideString]: Variant read GetPropAttr write SetPropAttr;

retrieve a property with a specific attribute; specify the PropAttr as Property|Attribute

Public property PropAttrVal[APropAttrVal:WideString]: TidElement read GetPropAttrVal;

retrieve a property with a specific attribute value; specify the PropAttr as Property|Attribute=value

Public property Elem[constAName:WideString]: TidElement read GetElem;
 
Public property AttrElem[constAName:WideString]: TidElement read GetAttrElem;
 
Public property Data: TObject read FData write FData;
 
Public property Data2: TObject read FData2 write FData2;
 
Public property Data3: TObject read FData3 write FData3;
 
Public property OwnedData: TObject read FOwnedData write SetOwnedData;
 
Public property OwnedData2: TObject read FOwnedData2 write SetOwnedData2;
 
Public property BinaryValue: TStream read FBinaryValue;
 
Public property _BinaryValue: TStream read FBinaryValue write FBinaryValue;
 
Public property _Elements: TidElements read FElements write FElements;
 
Public property OnHandle: TNotifyEvent read FOnHandle write FOnHandle;

use OnHandle event in derived classes. It does nothing here

Public property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;
 
Published property Value: Variant read FValue write FValue stored False;
 
Published property TypedXML: Boolean read FTypedXML write FTypedXML;

set TypedXML to false if you don't want to generate the _IDtype attributes (default = true)

Published property SaveWithHeader: Boolean read FSaveWithHeader write FSaveWithHeader;

set SaveWithHeader to tru to het the <?xml header line (default = true);

Published property AllowDuplicates: Boolean read FAllowDuplicates write FAllowDuplicates;

set AllowDuplicates when you want the element to accept properties with identical names (default = false)

Published property UTF8Encoded: Boolean read FUTF8Encoded write FUTF8Encoded;

set UTF8Encoded to false if you don't want to UTF-decode the content

Published property IsBinary: Boolean read GetIsBinary write SetIsBinary;
 
Published property Elements: TidElements read GetElements write FElements;
 
Published property Attributes: TidElements read GetAttributes write FAttributes;
 
Published property JustABunchOfObjects: Boolean read FJustABunchOfObjects write FJustABunchOfObjects;
 
Published property Tag: PtrInt read FTag write FTag;
 
Published property Count: Integer read GetCount stored False;

keep as published

Published property PropCount: Integer read GetCount stored False;
 
Published property AttrCount: Integer read GetAttrCount stored False;
 

Generated by PasDoc 0.15.0.