Class TXMLConfig

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TXMLConfig = class(TComponent)

Description

Warning: this symbol is deprecated.

"APath" is the path and name of a value: A XML configuration file is hierachical. "/" is the path delimiter, the part after the last "/" is the name of the value. The path components will be mapped to XML elements, the name will be an element attribute.

Hierarchy

  • TComponent
  • TXMLConfig

Overview

Fields

Protected Doc: TXMLDocument;
Protected FModified: Boolean;

Methods

Protected procedure Loaded; override;
Protected function FindNode(const APath: String; PathHasValue: boolean): TDomNode;
Protected function Escape(const s: String): String;
Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public procedure Clear;
Public procedure Flush;
Public function GetValue(const APath, ADefault: String): String; overload;
Public function GetValue(const APath: String; ADefault: Integer): Integer; overload;
Public function GetValue(const APath: String; ADefault: Boolean): Boolean; overload;
Public procedure SetValue(const APath, AValue: String); overload;
Public procedure SetDeleteValue(const APath, AValue, DefValue: String); overload;
Public procedure SetValue(const APath: String; AValue: Integer); overload;
Public procedure SetDeleteValue(const APath: String; AValue, DefValue: Integer); overload;
Public procedure SetValue(const APath: String; AValue: Boolean); overload;
Public procedure SetDeleteValue(const APath: String; AValue, DefValue: Boolean); overload;
Public procedure DeletePath(const APath: string);
Public procedure DeleteValue(const APath: string);
Public procedure LoadFromStream(const Stream: TStream);
Public procedure SaveToStream(const Stream: TStream);

Properties

Public property Modified: Boolean read FModified;
Published property URL: String read FURL write SetURL;
Published property StartEmpty: Boolean read FStartEmpty write SetStartEmpty;
Published property UseEscaping: Boolean read FUseEscaping write FUseEscaping default True;
Published property RootName: DOMString read FRootName write SetRootName;

Description

Fields

Protected Doc: TXMLDocument;
 
Protected FModified: Boolean;
 

Methods

Protected procedure Loaded; override;
 
Protected function FindNode(const APath: String; PathHasValue: boolean): TDomNode;
 
Protected function Escape(const s: String): String;
 
Public constructor Create(AOwner: TComponent); override;
 
Public destructor Destroy; override;
 
Public procedure Clear;
 
Public procedure Flush;
 
Public function GetValue(const APath, ADefault: String): String; overload;

Writes the XML file

Public function GetValue(const APath: String; ADefault: Integer): Integer; overload;
 
Public function GetValue(const APath: String; ADefault: Boolean): Boolean; overload;
 
Public procedure SetValue(const APath, AValue: String); overload;
 
Public procedure SetDeleteValue(const APath, AValue, DefValue: String); overload;
 
Public procedure SetValue(const APath: String; AValue: Integer); overload;
 
Public procedure SetDeleteValue(const APath: String; AValue, DefValue: Integer); overload;
 
Public procedure SetValue(const APath: String; AValue: Boolean); overload;
 
Public procedure SetDeleteValue(const APath: String; AValue, DefValue: Boolean); overload;
 
Public procedure DeletePath(const APath: string);
 
Public procedure DeleteValue(const APath: string);
 
Public procedure LoadFromStream(const Stream: TStream);

Load and save config state to a TStream instance. Loading changes URL to empty, and does Flush before, so it works similarly to setting an URL. Saving does not change any state (it also ignores the Modified value), it unconditionally dumps the contents to stream.

Public procedure SaveToStream(const Stream: TStream);
 

Properties

Public property Modified: Boolean read FModified;
 
Published property URL: String read FURL write SetURL;
 
Published property StartEmpty: Boolean read FStartEmpty write SetStartEmpty;
 
Published property UseEscaping: Boolean read FUseEscaping write FUseEscaping default True;
 
Published property RootName: DOMString read FRootName write SetRootName;
 

Generated by PasDoc 0.13.0 on 2014-08-30 12:10:44