TXMLConfig class
Implements a class used to access and maintain an XML configuration data file.
Declaration
TXMLConfig = class(TComponent)Inheritance
- TXMLConfig
- TComponent
- TPersistent
- TObject
Descends from it: TPropStorageXMLConfig TRttiXMLConfig
Description
TXMLConfig is a
TComponent descendant used to store
configuration data using XML format. TXMLConfig is a simpler mechanism for
accessing the content in an XML document. It uses path specifiers to describe
the hierarchy of elements and attribute values, instead of focusing on DOM
nodes. See the
TXMLConfig Path Syntax
topic for more information about path specifiers in TXMLConfig.
TXMLConfig provides method used to get or set the value for a path specifier in the XML document. Overloaded methods are includes to handle values using String, Integer, Extended, TRect, or Boolean data types. See the Using TXMLConfig topic for more information about using TXMLConfig.
See also
Properties
Modified | public | Indicates if the XML content in the class has been modified. |
Filename | published | File name used to read or write the XML content in the class instance. |
Document | published | XML document used for the class instance. |
ReadFlags | published | TXMLReaderFlags for the XML configuration file. |
WriteFlags | published | TXMLWriteFlags for the XML configuration file. |
Methods
Loaded | protected | Signals that LCL component streaming has been completed. |
ExtendedToStr | protected | Converts an extended value to its representation as a String. |
StrToExtended | protected | Converts the specified String value to an Extended data type. |
SizeOfTypeInfo | protected | Gets the number of bytes needed to store a value using the specified RTTI type. |
ValueWithTypeInfoToString | protected | Gets the string representation for the specified value as the specified type. |
StringToValueWithTypeInfo | protected | Converts the specified string value to a value using the specified type. |
ReadXMLFile | protected | Reads the XML content from the specified file into a TXMLDocument instance. |
WriteXMLFile | protected | Writes XML configuration data in Document to the specified file name. |
FreeDoc | protected | Frees the TXMLDocument instance for the XML configuration file. |
SetPathNodeCache | protected | Ensures a DOM node is present in the internal cache for the class instance. |
GetCachedPathNode | protected | Gets a cached DOM node starting at the specified position in the cache. |
InvalidateCacheTilEnd | protected | Removes DOM nodes from the internal cache starting at the specified ordinal position. |
InternalFindNode | protected | Searches for the DOM node with the specified path, and updates the node cache. |
InternalCleanNode | protected | Removes the specified node and all of its children from the Document. |
FindChildNode | protected | Finds (and optionally caches) a child node starting at the specified index position using the specified XPath node name and position. |
Create | public | Constructor for the class instance. |
CreateClean | public | Alternate constructor used to create the class without reading existing XML content in the specified file. |
CreateWithSource | public | Alternate constructor used to create the class using the XML content specified in Source. |
Destroy | public | Destructor for the class instance. |
Clear | public | Removes existing XML content in the Document property. |
Flush | public | Forces the XML content for the configuration file to be written to Filename. |
ReadFromStream | public | Reads the XML content in Document from the specified stream instance. |
WriteToStream | public | Writes the XML content for the configuration file to the specified stream instance. |
GetValue | public | Gets the value from the DOM node at the specified path in the XML configuration file. |
GetExtendedValue | public | Gets the value for a DOM node at the specified path as an extended data type. |
SetValue | public | Sets the value in a DOM node at the specified path. |
SetDeleteValue | public | Updates or removes the value stored at the specified path. |
SetExtendedValue | public | Sets the value in the DOM node at the specified path using an extended data type. |
SetDeleteExtendedValue | public | Updates or removes the Extended value at the specified path. |
DeletePath | public | Deletes the DOM node at the specified path in the Document. |
DeleteValue | public | Deletes the value stored in the DOM node at the specified path. |
FindNode | public | Retrieves the DOM node with the specified path. |
HasPath | public | Indicates if a DOM node exists for the specified path. |
HasChildPaths | public | Indicates if the DOM node at the specified path has child nodes. |
GetChildCount | public | Gets the number of child nodes used in the DOM node at the specified path. |
IsLegacyList | public | Indicates if the specified list was written using the format from a previous LazUtils version. |
GetListItemCount | public | Gets the number of values with the specified name found in the given path. |
GetListItemXPath | public | Gets the path specifier used to access a list item at the specified position. |
InvalidatePathCache | public | Removes cached DOM nodes for paths in the XML configuration file. |
Fields
doc | protected | Internal member with the TXMLDocument for the class instance. |
FModified | protected | Member used to indicate the configuration file has been modified. |
fDoNotLoadFromFile | protected | Member used to indicate that the data was created manually, and not loaded from a file or stream. |
fAutoLoadFromSource | protected | Member used to store String content loaded into the configuration file. |
fPathCache | protected | Not used/updated in the current implementation. |
fPathNodeCache | protected | Member used to cache DOM nodes accessed using paths in the class instance. |
Types and constants
TDomNodeArray | protected | Defines an array type used to store TDomNode instances. |
TNodeCache | protected | Advanced record type used to implement an array-based TDomNode cache. |
Inherited
From TComponent (73)
_AddRef _Release BeforeDestruction CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DefineProperties DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetChildren GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetParentComponent GetTypeInfo GetTypeInfoCount HasParent iicrGetComponent InsertComponent Invoke IsImplementorOf Loading Name Notification ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReadState ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetChildOrder SetDesigning SetDesignInstance SetInline SetName SetParentComponent SetSubComponent Tag ToString TToStringNameMode UpdateAction Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState
From TPersistent (5)
Assign AssignTo FPOAttachObserver FPODetachObserver FPONotifyObservers
From TObject (37)
AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
