|
hydrogen 1.1.1
|
XMLNode is a subclass of QDomNode with read and write values methods. More...
#include <Xml.h>
Public Member Functions | |
| XMLNode () | |
| basic constructor More... | |
| XMLNode (QDomNode node) | |
| to wrap a QDomNode More... | |
| XMLNode | createNode (const QString &name) |
| create a new XMLNode that has to be appended into de XMLDoc More... | |
| int | read_int (const QString &node, int default_value, bool inexistent_ok=true, bool empty_ok=true) |
| reads an integer stored into a child node More... | |
| bool | read_bool (const QString &node, bool default_value, bool inexistent_ok=true, bool empty_ok=true) |
| reads a boolean stored into a child node More... | |
| float | read_float (const QString &node, float default_value, bool inexistent_ok=true, bool empty_ok=true) |
| reads a float stored into a child node More... | |
| QString | read_string (const QString &node, const QString &default_value, bool inexistent_ok=true, bool empty_ok=true) |
| reads a string stored into a child node More... | |
| QString | read_attribute (const QString &attribute, const QString &default_value, bool inexistent_ok, bool empty_ok) |
| reads an attribute from the node More... | |
| QString | read_text (bool empty_ok) |
| reads the text (content) from the node More... | |
| void | write_int (const QString &node, const int value) |
| write an integer into a child node More... | |
| void | write_bool (const QString &node, const bool value) |
| write a boolean into a child node More... | |
| void | write_float (const QString &node, const float value) |
| write a float into a child node More... | |
| void | write_string (const QString &node, const QString &value) |
| write a string into a child node More... | |
| void | write_attribute (const QString &attribute, const QString &value) |
| write a string as an attribute of the node More... | |
Public Member Functions inherited from Object | |
| ~Object () | |
| destructor More... | |
| Object (const Object &obj) | |
| copy constructor More... | |
| Object (const char *class_name) | |
| constructor More... | |
| const char * | class_name () const |
| return the class name More... | |
| virtual QString | toQString (const QString &sPrefix, bool bShort=true) const |
| Formatted string version for debugging purposes. More... | |
| void | Print (bool bShort=true) const |
| Prints content of toQString() via DEBUGLOG. More... | |
Private Member Functions | |
| QString | read_child_node (const QString &node, bool inexistent_ok, bool empty_ok) |
| reads a string stored into a child node More... | |
| void | write_child_node (const QString &node, const QString &text) |
| write a string into a child node More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Object | |
| static void | set_count (bool flag) |
| enable/disable class instances counting More... | |
| static bool | count_active () |
| return true if class instances counting is enabled More... | |
| static unsigned | objects_count () |
| return the number of objects More... | |
| static void | write_objects_map_to (std::ostream &out) |
| output the full objects map to a given ostream More... | |
| static void | write_objects_map_to_cerr () |
| output objects map to stderr More... | |
| static int | bootstrap (Logger *logger, bool count=false) |
| must be called before any Object instantiation ! More... | |
| static Logger * | logger () |
| return the logger instance More... | |
Static Public Attributes inherited from Object | |
| static QString | sPrintIndention = " " |
| String used to format the debugging string output of some core classes. More... | |
Static Protected Attributes inherited from Object | |
| static Logger * | __logger = nullptr |
| logger instance pointer More... | |
XMLNode is a subclass of QDomNode with read and write values methods.
| XMLNode | ( | ) |
basic constructor
| XMLNode | ( | QDomNode | node | ) |
to wrap a QDomNode
| XMLNode createNode | ( | const QString & | name | ) |
| QString read_attribute | ( | const QString & | attribute, |
| const QString & | default_value, | ||
| bool | inexistent_ok, | ||
| bool | empty_ok | ||
| ) |
reads an attribute from the node
| attribute | the name of the attribute to read |
| default_value | the value returned if something goes wrong |
| inexistent_ok | if set to false output a DEBUG log line if the attribute doesn't exists |
| empty_ok | if set to false output a DEBUG log line if the attribute is empty |
| bool read_bool | ( | const QString & | node, |
| bool | default_value, | ||
| bool | inexistent_ok = true, |
||
| bool | empty_ok = true |
||
| ) |
reads a boolean stored into a child node
| node | the name of the child node to read into |
| default_value | the value returned if something goes wrong |
| inexistent_ok | if set to false output a DEBUG log line if the node doesn't exists |
| empty_ok | if set to false output a DEBUG log line if the child node is empty |
|
private |
reads a string stored into a child node
| node | the name of the child node to read into |
| inexistent_ok | if set to false output a DEBUG log line if the node doesn't exists |
| empty_ok | if set to false output a DEBUG log line if the child node is empty |
| float read_float | ( | const QString & | node, |
| float | default_value, | ||
| bool | inexistent_ok = true, |
||
| bool | empty_ok = true |
||
| ) |
reads a float stored into a child node
| node | the name of the child node to read into |
| default_value | the value returned if something goes wrong |
| inexistent_ok | if set to false output a DEBUG log line if the node doesn't exists |
| empty_ok | if set to false output a DEBUG log line if the child node is empty |
| int read_int | ( | const QString & | node, |
| int | default_value, | ||
| bool | inexistent_ok = true, |
||
| bool | empty_ok = true |
||
| ) |
reads an integer stored into a child node
| node | the name of the child node to read into |
| default_value | the value returned if something goes wrong |
| inexistent_ok | if set to false output a DEBUG log line if the node doesn't exists |
| empty_ok | if set to false output a DEBUG log line if the child node is empty |
| QString read_string | ( | const QString & | node, |
| const QString & | default_value, | ||
| bool | inexistent_ok = true, |
||
| bool | empty_ok = true |
||
| ) |
reads a string stored into a child node
| node | the name of the child node to read into |
| default_value | the value returned if something goes wrong |
| inexistent_ok | if set to false output a DEBUG log line if the node doesn't exists |
| empty_ok | if set to false output a DEBUG log line if the child node is empty |
| QString read_text | ( | bool | empty_ok | ) |
reads the text (content) from the node
| empty_ok | if set to false output a DEBUG log line if the node is empty |
| void write_attribute | ( | const QString & | attribute, |
| const QString & | value | ||
| ) |
write a string as an attribute of the node
| attribute | the name of the attribute to create |
| value | the value to write in the attribute |
| void write_bool | ( | const QString & | node, |
| const bool | value | ||
| ) |
write a boolean into a child node
| node | the name of the child node to create |
| value | the value to write |
|
private |
write a string into a child node
| node | the name of the child node to create |
| text | the text to write |
| void write_float | ( | const QString & | node, |
| const float | value | ||
| ) |
write a float into a child node
| node | the name of the child node to create |
| value | the value to write |
| void write_int | ( | const QString & | node, |
| const int | value | ||
| ) |
write an integer into a child node
| node | the name of the child node to create |
| value | the value to write |
| void write_string | ( | const QString & | node, |
| const QString & | value | ||
| ) |
write a string into a child node
| node | the name of the child node to create |
| value | the value to write |