S3FC project page | S3FC home page |
s3_config_node
s from an XML file.
More...
#include <s3_xml_config.h>
Inheritance diagram for s3_xml_config:
Public Methods | |
s3_xml_config (const std::string &n_config_file, bool create_file=false) throw (s3_generic_exception) | |
This constructor takes a single parameter which specify the XML file to parse. More... | |
~s3_xml_config () | |
Free all allocated objects. More... | |
s3_config_node & | get_rootnode () const |
Return the root node. More... | |
void | refresh () |
Refresh the configuration tree by reading the configuration file. More... | |
void | set_config_file (const std::string &n_config_file) |
Set the configuration filename to the supplied argument. More... | |
Static Public Methods | |
void | write_node (const std::string &filename, const s3_config_node &node) |
Save the configuration tree, rooted at node , as an XML file, named filename . More... | |
void | write_node (std::ostream &os, const s3_config_node &node, unsigned int depth=0) |
Write the specified node, in XML format, to the supplied ostream, at the specified depth. More... | |
void | write_spaces (std::ostream &os, unsigned int n) |
Protected Methods | |
void | dump_DOM_tree (const DOM_Node &domdoc) const |
Dump the parsed DOM tree to cerr. More... | |
Static Protected Methods | |
DOM_Document | parse (const std::string &filename) throw (s3_generic_exception, s3_xml_exception) |
Parse an XML file into a DOM tree. More... | |
s3_config_node * | build_tree (const DOM_Node &doc) |
Recursively build an s3_config_node tree from the supplied DOM document. More... | |
std::string | get_name (const DOM_Node &node) |
Return the name of the DOM node as a string. More... | |
std::string | get_value (const DOM_Node &node) |
Return the value of the DOM node as a string. More... | |
std::map< std::string, std::string > | get_attributes (const DOM_Node &node) |
Return the attributes of the DOM node as a hash of strings. More... | |
std::vector< s3_config_node * > | get_children (const DOM_Node &node) |
Return a list of pointers to orphaned child nodes. More... | |
std::string | domstr_to_string (const DOMString &dstr) |
Convert the DOMString to a string . More... | |
Protected Attributes | |
std::string | config_file |
The name of the XML config file to parse. More... | |
DOM_Document | doc |
The DOM document tree of the parsed XML file. More... | |
s3_config_node * | rootnode |
The rootnode. More... | |
Friends | |
class | error_handler |
s3_config_node
s from an XML file.
Definition at line 70 of file s3_xml_config.h.
|
This constructor takes a single parameter which specify the XML file to parse. The constructor will read the file, parse it and then store the result in a DOM tree.
Definition at line 45 of file s3_xml_config.cc. References S3FC_DBG. |
|
Free all allocated objects.
Definition at line 82 of file s3_xml_config.cc. References domstr_to_string, rootnode, and S3FC_DBG. |
|
Recursively build an s3_config_node tree from the supplied DOM document. You have been warned... Definition at line 245 of file s3_xml_config.cc. References get_attributes, get_children, get_name, and get_value. Referenced by get_children, and refresh. |
|
Convert the DOMString to a
Definition at line 346 of file s3_xml_config.cc. Referenced by s3_xml_config::error_handler::assemble_and_throw, get_attributes, get_name, get_value, and ~s3_xml_config. |
|
Dump the parsed DOM tree to cerr.
|
|
Return the attributes of the DOM node as a hash of strings.
Definition at line 308 of file s3_xml_config.cc. References domstr_to_string. Referenced by build_tree. |
|
Return a list of pointers to orphaned child nodes. The caller owns the instances pointed to.
Definition at line 329 of file s3_xml_config.cc. References build_tree. Referenced by build_tree. |
|
Return the name of the DOM node as a string.
Definition at line 269 of file s3_xml_config.cc. References domstr_to_string. Referenced by build_tree. |
|
Return the root node.
Implements s3_config_base. Definition at line 103 of file s3_xml_config.cc. References rootnode. |
|
Return the value of the DOM node as a string. The value is the concatenation of the values of all the text nodes, with runs of white space removed.
Definition at line 276 of file s3_xml_config.cc. References domstr_to_string. Referenced by build_tree. |
|
Parse an XML file into a DOM tree.
Definition at line 176 of file s3_xml_config.cc. Referenced by refresh. |
|
Refresh the configuration tree by reading the configuration file. Any nodes previously obtained from this instance should be regarded as invalid after this call returns. Implements s3_config_base. Definition at line 108 of file s3_xml_config.cc. References build_tree, config_file, doc, parse, and rootnode. |
|
Set the configuration filename to the supplied argument.
Definition at line 120 of file s3_xml_config.cc. References config_file. |
|
Write the specified node, in XML format, to the supplied ostream, at the specified depth. Invoke this function recursively on all children.
Definition at line 135 of file s3_xml_config.cc. References s3_config_node::get_attributes, s3_config_node::get_child, s3_config_node::get_name, s3_config_node::get_num_children, s3_config_node::get_value, write_node, and write_spaces. |
|
Save the configuration tree, rooted at
Definition at line 126 of file s3_xml_config.cc. Referenced by write_node. |
|
Definition at line 165 of file s3_xml_config.cc. Referenced by write_node. |
|
Definition at line 221 of file s3_xml_config.h. |
|
The name of the XML config file to parse.
Definition at line 76 of file s3_xml_config.h. Referenced by refresh, and set_config_file. |
|
The DOM document tree of the parsed XML file. The derived classes will use this instance variable directly. Definition at line 81 of file s3_xml_config.h. Referenced by refresh. |
|
The rootnode.
Definition at line 85 of file s3_xml_config.h. Referenced by get_rootnode, refresh, and ~s3_xml_config. |
Send comments to: s3fc@stonethree.com |
|