|
hydrogen 1.2.6
|
XMLNode is a subclass of QDomNode with read and write values methods. More...
#include <Xml.h>
Public Member Functions | |
| XMLNode () | |
| basic constructor | |
| XMLNode (QDomNode node) | |
| to wrap a QDomNode | |
| XMLNode | createNode (const QString &name) |
| create a new XMLNode that has to be appended into de XMLDoc | |
| QString | read_attribute (const QString &attribute, const QString &default_value, bool inexistent_ok, bool empty_ok, bool bSilent=false) |
| reads an attribute from the node | |
| bool | read_bool (const QString &node, bool default_value, bool *pFound, bool inexistent_ok=true, bool empty_ok=true, bool bSilent=false) |
| reads a boolean stored into a child node | |
| bool | read_bool (const QString &node, bool default_value, bool inexistent_ok=true, bool empty_ok=true, bool bSilent=false) |
| reads a boolean stored into a child node | |
| QColor | read_color (const QString &node, const QColor &defaultValue=QColor(97, 167, 251), bool inexistent_ok=true, bool empty_ok=true, bool bSilent=false) |
| float | read_float (const QString &node, float default_value, bool *pFound, bool inexistent_ok=true, bool empty_ok=true, bool bSilent=false) |
| float | read_float (const QString &node, float default_value, bool inexistent_ok=true, bool empty_ok=true, bool bSilent=false) |
| reads a float stored into a child node | |
| int | read_int (const QString &node, int default_value, bool inexistent_ok=true, bool empty_ok=true, bool bSilent=false) |
| reads an integer stored into a child node | |
| QString | read_string (const QString &node, const QString &default_value, bool inexistent_ok=true, bool empty_ok=true, bool bSilent=false) |
| reads a string stored into a child node | |
| QString | read_text (bool empty_ok, bool bSilent=false) |
| reads the text (content) from the node | |
| void | write_attribute (const QString &attribute, const QString &value) |
| write a string as an attribute of the node | |
| void | write_bool (const QString &node, const bool value) |
| write a boolean into a child node | |
| void | write_color (const QString &node, const QColor &color) |
| void | write_float (const QString &node, const float value) |
| write a float into a child node | |
| void | write_int (const QString &node, const int value) |
| write an integer into a child node | |
| void | write_string (const QString &node, const QString &value) |
| write a string into a child node | |
Public Member Functions inherited from Object< XMLNode > | |
| Object () | |
| Object (const Object< XMLNode > &other) | |
Public Member Functions inherited from Base | |
| Base () | |
| Base (const Base &other) | |
| virtual const char * | class_name () const |
| void | logBacktrace () const |
| Print the current stack at point into the debug log. | |
| void | Print (bool bShort=true) const |
| Prints content of toQString() via DEBUGLOG. | |
| virtual QString | toQString (const QString &sPrefix="", bool bShort=true) const |
| Formatted string version for debugging purposes. | |
Private Member Functions | |
| QString | read_child_node (const QString &node, bool inexistent_ok, bool empty_ok, bool bSilent=false) |
| reads a string stored into a child node | |
| void | write_child_node (const QString &node, const QString &text) |
| write a string into a child node | |
Additional Inherited Members | |
Static Public Member Functions inherited from Base | |
| static const char * | _class_name () |
| return the class name | |
| static QString | base_clock (const QString &sMsg) |
| Measures the current time and stores it in __last_clock. | |
| static QString | base_clock_in (const QString &sMsg) |
| static int | bootstrap (Logger *logger, bool count=false) |
| must be called before any Object instantiation ! | |
| static bool | count_active () |
| static int | getAliveObjectCount () |
| static object_map_t | getObjectMap () |
| static Logger * | logger () |
| return the logger instance | |
| static int | objects_count () |
| static void | printObjectMapDiff (object_map_t map) |
| Creates the difference between a snapshot of the object map and its current state and prints it to std::cout. | |
| static void | set_count (bool flag) |
| enable/disable class instances counting | |
| static void | write_objects_map_to (std::ostream &out, object_map_t *map=nullptr) |
| output the full objects map to a given ostream | |
| static void | write_objects_map_to_cerr () |
| output objects map to stderr | |
Static Public Attributes inherited from Base | |
| static QString | sPrintIndention = " " |
| String used to format the debugging string output of some core classes. | |
Protected Member Functions inherited from Object< XMLNode > | |
| ~Object () | |
Protected Member Functions inherited from Base | |
| ~Base () | |
Static Protected Member Functions inherited from Base | |
| static void | registerClass (const char *name, const atomic_obj_cpt_t *counters) |
Static Protected Attributes inherited from Base | |
| static bool | __count = false |
| should we count class instances | |
| static timeval | __last_clock = { 0, 0 } |
| static Logger * | __logger = nullptr |
| static bool | bLogColors = true |
XMLNode is a subclass of QDomNode with read and write values methods.
| XMLNode createNode | ( | const QString & | name | ) |
| QString read_attribute | ( | const QString & | attribute, |
| const QString & | default_value, | ||
| bool | inexistent_ok, | ||
| bool | empty_ok, | ||
| bool | bSilent = false ) |
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 |
| bSilent | Whether debug and info messages should be logged when anomalies are encountered while reading the XML nodes. |
| bool read_bool | ( | const QString & | node, |
| bool | default_value, | ||
| bool * | pFound, | ||
| bool | inexistent_ok = true, | ||
| bool | empty_ok = true, | ||
| bool | bSilent = false ) |
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 |
| pFound | Indicates whether the node was found. |
| 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 |
| bSilent | Whether debug and info messages should be logged when anomalies are encountered while reading the XML nodes. |
| bool read_bool | ( | const QString & | node, |
| bool | default_value, | ||
| bool | inexistent_ok = true, | ||
| bool | empty_ok = true, | ||
| bool | bSilent = false ) |
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 |
| bSilent | Whether debug and info messages should be logged when anomalies are encountered while reading the XML nodes. |
|
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 |
| bSilent | Whether debug and info messages should be logged when anomalies are encountered while reading the XML nodes. |
| QColor read_color | ( | const QString & | node, |
| const QColor & | defaultValue = QColor( 97, 167, 251 ), | ||
| bool | inexistent_ok = true, | ||
| bool | empty_ok = true, | ||
| bool | bSilent = false ) |
| float read_float | ( | const QString & | node, |
| float | default_value, | ||
| bool * | pFound, | ||
| bool | inexistent_ok = true, | ||
| bool | empty_ok = true, | ||
| bool | bSilent = false ) |
| float read_float | ( | const QString & | node, |
| float | default_value, | ||
| bool | inexistent_ok = true, | ||
| bool | empty_ok = true, | ||
| bool | bSilent = false ) |
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 |
| bSilent | Whether debug and info messages should be logged when anomalies are encountered while reading the XML nodes. |
| int read_int | ( | const QString & | node, |
| int | default_value, | ||
| bool | inexistent_ok = true, | ||
| bool | empty_ok = true, | ||
| bool | bSilent = false ) |
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 |
| bSilent | Whether debug and info messages should be logged when anomalies are encountered while reading the XML nodes. |
| QString read_string | ( | const QString & | node, |
| const QString & | default_value, | ||
| bool | inexistent_ok = true, | ||
| bool | empty_ok = true, | ||
| bool | bSilent = false ) |
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 |
| bSilent | Whether debug and info messages should be logged when anomalies are encountered while reading the XML nodes. |
| QString read_text | ( | bool | empty_ok, |
| bool | bSilent = false ) |
| void write_attribute | ( | const QString & | attribute, |
| const QString & | value ) |
| void write_bool | ( | const QString & | node, |
| const bool | value ) |
|
private |
| void write_color | ( | const QString & | node, |
| const QColor & | color ) |
| void write_float | ( | const QString & | node, |
| const float | value ) |
| void write_int | ( | const QString & | node, |
| const int | value ) |