|
Home / Open source / Terimber 2.0
xmlconfig Class Referenceclass encapsulates the xml config file as an INI or registry keys
More...
#include <xmlconfig.h>
List of all members.
|
Public Member Functions |
| | xmlconfig (const char *filename, const char *path, const char *key) |
| | constructor
|
| | ~xmlconfig () |
| | destructor
|
| void | make_path (string_t &path, const char *subkey) const |
| | constructs the full path root+subkey
|
| void | set (const char *subkey, const char *name, const char *val) |
| | sets value as string if it does not exist - creates a new one
|
| void | set (const char *subkey, const char *name, int val) |
| | sets value as integer if it does not exist - creates a new one
|
| bool | get (const char *subkey, const char *name, string_t &val) const |
| | gets value as string returns false if property does not exist
|
| bool | get (const char *subkey, const char *name, int &val) const |
| | gets value as integer returns false if property does not exist
|
| void | getset (const char *subkey, const char *name, string_t &val) |
| | gets value as string if property does not exist it will be created
|
| void | getset (const char *subkey, const char *name, int &val) |
| | gets value as integer if property does not exist it will be created
|
| bool | getlist (const char *subkey, const char *name, xmlconfiglist_t &val) |
| void | setlist (const char *subkey, const char *name, const xmlconfiglist_t &val) |
| void | getsetlist (const char *subkey, const char *name, xmlconfiglist_t &val) |
Private Attributes |
| xml_designer_impl | _parser |
| | xml designer
|
| string_t | _filename |
| | file name
|
| string_t | _root |
| | xml root path
|
Detailed Description
class encapsulates the xml config file as an INI or registry keys
Definition at line 42 of file xmlconfig.h.
Constructor & Destructor Documentation
| xmlconfig::xmlconfig |
( |
const char * |
filename, |
|
|
const char * |
path, |
|
|
const char * |
key | |
|
) |
| | [inline] |
constructor
- Parameters:
-
| filename |
file name |
| path |
optional xml xpath from root element |
| key |
optional additional element under xpath |
Definition at line 46 of file xmlconfig.h.
References _filename, _parser, _root, xml_designer_impl::add_child(), base_string< T >::assign(), ELEMENT_NODE, xml_designer_impl::get_name(), base_string< T >::length(), xml_designer_impl::load(), xml_designer_impl::select_root(), and xml_designer_impl::select_xpath().
| xmlconfig::~xmlconfig |
( |
|
) |
[inline] |
Member Function Documentation
| void xmlconfig::make_path |
( |
string_t & |
path, |
|
|
const char * |
subkey | |
|
) |
| | const [inline] |
| void xmlconfig::set |
( |
const char * |
subkey, |
|
|
const char * |
name, |
|
|
const char * |
val | |
|
) |
| | [inline] |
| void xmlconfig::set |
( |
const char * |
subkey, |
|
|
const char * |
name, |
|
|
int |
val | |
|
) |
| | [inline] |
sets value as integer if it does not exist - creates a new one
- Parameters:
-
| subkey |
optinal subkey |
| name |
property name |
| val |
property value |
Definition at line 210 of file xmlconfig.h.
References str_template::strprint().
| bool xmlconfig::get |
( |
const char * |
subkey, |
|
|
const char * |
name, |
|
|
string_t & |
val | |
|
) |
| | const [inline] |
| bool xmlconfig::get |
( |
const char * |
subkey, |
|
|
const char * |
name, |
|
|
int & |
val | |
|
) |
| | const [inline] |
gets value as integer returns false if property does not exist
- Parameters:
-
| subkey |
optional subkey |
| name |
property name |
| val |
[out] property value |
Definition at line 244 of file xmlconfig.h.
References base_string< T >::length().
| void xmlconfig::getset |
( |
const char * |
subkey, |
|
|
const char * |
name, |
|
|
string_t & |
val | |
|
) |
| | [inline] |
gets value as string if property does not exist it will be created
- Parameters:
-
| subkey |
optional subkey |
| name |
property name |
| val |
[in, out] property value |
Definition at line 258 of file xmlconfig.h.
| void xmlconfig::getset |
( |
const char * |
subkey, |
|
|
const char * |
name, |
|
|
int & |
val | |
|
) |
| | [inline] |
gets value as integer if property does not exist it will be created
- Parameters:
-
| subkey |
optional subkey |
| name |
property name |
| val |
[in, out] property value |
Definition at line 270 of file xmlconfig.h.
| bool xmlconfig::getlist |
( |
const char * |
subkey, |
|
|
const char * |
name, |
|
|
xmlconfiglist_t & |
val | |
|
) |
| | [inline] |
- Parameters:
-
| subkey |
optional subkey |
| name |
list name |
| val |
[out] property list |
Definition at line 280 of file xmlconfig.h.
References _parser, ELEMENT_NODE, xml_designer_impl::get_name(), xml_designer_impl::get_type(), xml_designer_impl::get_value(), make_path(), os_minus_one, xml_designer_impl::select_attribute_by_name(), xml_designer_impl::select_first_child(), xml_designer_impl::select_next_sibling(), xml_designer_impl::select_parent(), xml_designer_impl::select_root(), xml_designer_impl::select_xpath(), and str_template::strnocasecmp().
Referenced by getsetlist().
| void xmlconfig::setlist |
( |
const char * |
subkey, |
|
|
const char * |
name, |
|
|
const xmlconfiglist_t & |
val | |
|
) |
| | [inline] |
- Parameters:
-
| subkey |
optional subkey |
| name |
list name |
| val |
[out] property list |
Definition at line 330 of file xmlconfig.h.
References _parser, _root, xml_designer_impl::add_child(), ATTRIBUTE_NODE, ELEMENT_NODE, xml_designer_impl::get_name(), xml_designer_impl::get_type(), xml_designer_impl::get_value(), make_path(), os_minus_one, xml_designer_impl::select_attribute_by_name(), xml_designer_impl::select_first_child(), xml_designer_impl::select_next_sibling(), xml_designer_impl::select_parent(), xml_designer_impl::select_root(), xml_designer_impl::select_xpath(), str_template::strnocasecmp(), and xml_designer_impl::update_value().
Referenced by getsetlist().
| void xmlconfig::getsetlist |
( |
const char * |
subkey, |
|
|
const char * |
name, |
|
|
xmlconfiglist_t & |
val | |
|
) |
| | [inline] |
Member Data Documentation
The documentation for this class was generated from the following file:
|
|