Thread portable class


Gate portable class


Timer class


Pool class


Terimber 2.0


About C++


Downloads Products & Services Support Clients Open Source About



Home / Open source / Terimber 2.0

xmlconfig Class Reference

class 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]

destructor

Definition at line 158 of file xmlconfig.h.

References _filename, _parser, and xml_designer_impl::save().


Member Function Documentation

void xmlconfig::make_path ( string_t path,
const char *  subkey 
) const [inline]

constructs the full path root+subkey

Parameters:
path  [out] full path
subkey  subkey

Definition at line 165 of file xmlconfig.h.

References _root.

Referenced by get(), getlist(), set(), and setlist().

void xmlconfig::set ( const char *  subkey,
const char *  name,
const char *  val 
) [inline]

sets value as string if it does not exist - creates a new one

Parameters:
subkey  optional subkey
name  property name
val  property value

Definition at line 181 of file xmlconfig.h.

References _parser, _root, xml_designer_impl::add_child(), ATTRIBUTE_NODE, ELEMENT_NODE, make_path(), xml_designer_impl::select_attribute_by_name(), xml_designer_impl::select_root(), xml_designer_impl::select_xpath(), and xml_designer_impl::update_value().

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]

gets value as string returns false if property does not exist

Parameters:
subkey  optional subkey
name  property name
val  [out] property value

Definition at line 223 of file xmlconfig.h.

References _parser, xml_designer_impl::get_value(), make_path(), xml_designer_impl::select_attribute_by_name(), xml_designer_impl::select_root(), and xml_designer_impl::select_xpath().

Referenced by daemon::notify(), and daemon::on_startup().

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.

void xmlconfig::getsetlist ( const char *  subkey,
const char *  name,
xmlconfiglist_t val 
) [inline]

Parameters:
subkey  optional subkey
name  list name
val  [out] property list

Definition at line 403 of file xmlconfig.h.

References getlist(), and setlist().


Member Data Documentation

xml designer

Definition at line 413 of file xmlconfig.h.

Referenced by get(), getlist(), set(), setlist(), xmlconfig(), and ~xmlconfig().

file name

Definition at line 414 of file xmlconfig.h.

Referenced by xmlconfig(), and ~xmlconfig().

xml root path

Definition at line 415 of file xmlconfig.h.

Referenced by make_path(), set(), setlist(), and xmlconfig().


The documentation for this class was generated from the following file:


© Copyright Terimber 2003-.