PropertyNode — The node of property tree.
class PropertyNode : : public RefCountedWrappedObjectSernaApi::RefCountedWrappedObject { public: // construct/copy/destruct PropertyNode(SernaApiBase * = 0); PropertyNode(const SString &, const SString & = SString()); PropertyNode(const SString &, bool); PropertyNode(const SString &, int); PropertyNode(const SString &, double); ~PropertyNode(); // public member functions SString name() const; void setName(const SString &) ; SString getString() const; bool getBool(bool * = 0) const; int getInt(bool * = 0) const; void * getPtr(bool * = 0) const; double getDouble(bool * = 0) const; void setString(const SString &) ; void setBool(bool) ; void setInt(int) ; void setPtr(void *) ; void setDouble(double) ; void merge(const PropertyNode &, bool = false) ; PropertyNode copy(bool = false) const; PropertyNode getProperty(const SString &) const; PropertyNode getSafeProperty(const SString &) const; PropertyNode makeDescendant(const SString &) ; PropertyNode makeDescendant(const SString &, const SString &, bool = true) ; void addWatcher(PropertyNodeWatcher *) ; void removeWatcher(PropertyNodeWatcher *) ; void removeAllWatchers() ; void dump() const; bool save(const SString &) const; bool read(const SString &, bool = false) ; PropertyNode firstChild() const; PropertyNode lastChild() const; PropertyNode getChild(int) const; int countChildren() const; void appendChild(const PropertyNode &) ; void removeAllChildren() ; PropertyNode nextSibling() const; PropertyNode prevSibling() const; PropertyNode parent() const; PropertyNode root() const; void remove() ; void insertBefore(const PropertyNode &) ; void insertAfter(const PropertyNode &) ; void removeGroup(const PropertyNode &) ; int siblingIndex() const; SString getTreelocString(const PropertyNode & = PropertyNode()) const; PropertyNode getByTreelocString(const SString &) const; };
PropertyNode
public member functionsSString name() const;
Get property name.
Set (new) property name.
SString getString() const;
Get string value of property.
Get boolean property value.
Get integer property value.
Get pointer property value.
Get double property value.
Set (new) string value of property.
Set boolean value of property.
Set integer value of property.
Set pointer value of property.
Set double value of property.
Merge values from other property tree into current property tree. Change notifications are currently not sent during merge.
PropertyNode copy(bool recursive = false) const;
Make (possible recursive) copy of this property node.
PropertyNode getProperty(const SString & name) const;
Get child property by slash-delimited path.
PropertyNode getSafeProperty(const SString & name) const;
Safely get child property (never returns NULL, returns empty property).
PropertyNode makeDescendant(const SString & name) ;
Makes child property subtree (with path). Returns the leaf.
PropertyNode makeDescendant(const SString & name, const SString & value, bool override = true) ;
Makes child property subtree (with path). Returns the leaf.
Register watcher for this PropertyNode.
Removes watcher.
Removes all watchers.
Dump PropertyNode.
Save property tree to the given URL. Returns True on success.
Read property tree from the URL. If the merge attribute is false, then contents of the current property node are discarded; otherwise, existing property tree is merged with one which were read from file.
PropertyNode firstChild() const;
PropertyNode lastChild() const;
PropertyNode getChild(int n) const;
PropertyNode nextSibling() const;
PropertyNode prevSibling() const;
PropertyNode parent() const;
PropertyNode root() const;
SString getTreelocString(const PropertyNode & = PropertyNode()) const;
PropertyNode getByTreelocString(const SString & ) const;