- Inherits from:
- Object
- Conforms to:
- DXMLHandler
- Declared in:
- DPropertyTree.h
Object
|
+---DPropertyTree
Class Description
The DPropertyTree class implements methods for storing and retrieving
properties in a xml file. There are methods for adding, removing, importing
and exporting properties.
- Last modified:
- 23-Jul-2006 (DPropertyTree.h)
Instance Variables
- private DTree *_properties
- the property tree
- private DTreeIterator *_iter
- the property tree iterator
- private DProperty *_root
- the root of the properties
- private DXMLReader *_reader
- the xml reader
- Constructors
- - (DPropertyTree *) init
- Initialise an empty property tree
- Returns:
- the object
- - (DPropertyTree *) init :(const char *) name
- Initialise a named property tree
- Parameters:
- name - the name of the property tree
- Returns:
- the object
- Copy related methods
- - shallowCopy
- Do a shallow copy of the property tree (not implemented)
- Returns:
- the object
- Destructor
- - free
- Free the property tree
- Returns:
- the object
- Member methods
- - (const char *) name
- Get the name of the tree
- Returns:
- the name of the tree
- - (DPropertyTree *) name :(const char *) name
- Set the name of the tree
- Parameters:
- name - the name of the tree
- Returns:
- the object
- Main methods
- - (DProperty *) group :(DProperty *) parent :(const char *) name
- Add a group to the property tree
- Parameters:
- parent - the parent (group) property
name - the group name
- Returns:
- the (new) group property (or nil)
- - (DProperty *) property :(DProperty *) parent :(const char *) name :(id <DTextable,DParsable>) value
- Add a property to the tree of properties
- Parameters:
- parent - the parent (group) property (or nil for root)
name - the property name
value - the reference to the value object
- Returns:
- the (new) property (or nil if parent not found)
- - (BOOL) read :(id <DTextReadable>) source :(const char *) name
- Import the properties
- Parameters:
- source - the properties source
name - the name of the source
- Returns:
- success
- - (BOOL) remove :(DProperty *) property
- Remove a property from the property tree
- Parameters:
- property - the property to be removed (and FREED)
- Returns:
- success (property is only freed if succesfull)
- - (BOOL) remove :(DProperty *) parent :(const char *) name
- Remove a property from the property tree
- Parameters:
- parent - the parent (group) property
name - the name of the property
- Returns:
- success (property is freed if succesfull)
- - (BOOL) write :(id <DTextWritable>) destination :(const char *) name
- Export the properties
- Parameters:
- destination - the destination for the property tree
name - the name of the destination
- Returns:
- success
- DXMLHandler protocol implementation (private methods)
- - (BOOL) attribute :(const DXMLChar *) attribute :(const DXMLChar *) value
- Process an attribute for an element (after a startElement)
- Parameters:
- attribute - the attribute
value - the value for the attribute
- Returns:
- success
- - (BOOL) characters :(const DXMLChar *) text
- Process a string of characters
- Parameters:
- text - the text of the characters
- Returns:
- success
- - (BOOL) comment :(const DXMLChar *) text
- Process a comment
- Parameters:
- text - the text of the comment
- Returns:
- success
- - (BOOL) endCDATA
- Process the end of a CDATA section
- Returns:
- success
- - (BOOL) endDocument
- Process the end of a document
- Returns:
- success
- - (BOOL) endElement
- Process the end of an element
- Returns:
- success
- - (BOOL) endNamespace
- End of a namespace declaration
- Returns:
- success
- - (void) error :(int) number :(const char *) name :(int) lineNumber :(int) columnNumber
- An error is found during the parsing of the file
- Parameters:
- number - the error number
name - the name of the config file
lineNumber - the line number in the config file
columnNumber - the column number in the config file
- Returns:
- success
- - (BOOL) processingInstruction :(const DXMLChar *) target :(const DXMLChar *) value
- Process a processing instruction
- Parameters:
- target - the target
value - the value
- Returns:
- success
- - (BOOL) startCDATA
- Process the start of a CDATA section
- Returns:
- success
- - (BOOL) startDocument :(const DXMLChar *) version :(const DXMLChar *) encoding :(int) standalone
- Process the start of a document
- Parameters:
- version - the version number
encoding - the encoding
standalone - is the xml document standalone ? (-1 = missing)
- Returns:
- success
- - (BOOL) startElement :(const DXMLChar *) name
- Process the start of an element
- Parameters:
- name - the name of the element
- Returns:
- success
- - (BOOL) startNamespace :(const DXMLChar *) prefix :(const DXMLChar *) uri
- Start of a namespace declaration
- Parameters:
- prefix - the prefix
uri - the uri
- Returns:
- success
- - (BOOL) unparsed :(const DXMLChar *) text
- Process unparsed text in the xml document (e.g. the DTD)
- Parameters:
- text - the unparsed text
- Returns:
- success
generated 25-Jul-2006 by ObjcDoc 3.0.0