libmoost
|
#include <simple_parser.hpp>
Classes | |
struct | tree_node |
Public Types | |
typedef boost::shared_ptr < tree_node > | shared_node_t |
typedef tree_node::tree_branch_t | tree_branch_t |
Public Member Functions | |
void | load (const std::string &fileName, bool makeLowercaseTags=false) |
const tree_branch_t & | get_root () const |
Private Member Functions | |
void | recursive_parse_tag (const std::string &header, std::istream &xmlFile, boost::shared_ptr< tree_node > &pCurrNode, bool makeLowercaseTags=false) |
bool | parse_token (std::istream &xmlFile, std::string &token, bool &isComment) |
Private Attributes | |
tree_branch_t | m_root |
A very simple xml parser, generally used to parse config files
Definition at line 101 of file simple_parser.hpp.
typedef boost::shared_ptr<tree_node> moost::xml::simple_parser::shared_node_t |
Definition at line 125 of file simple_parser.hpp.
Definition at line 126 of file simple_parser.hpp.
const tree_branch_t& moost::xml::simple_parser::get_root | ( | ) | const [inline] |
Returns the root of the xml document.
Definition at line 142 of file simple_parser.hpp.
void moost::xml::simple_parser::load | ( | const std::string & | fileName, |
bool | makeLowercaseTags = false |
||
) | [inline] |
Loads the xml file and parse it.
fileName | the name of the file to load and parse |
makeLowercaseTags | if true it will turn the tags (i.e. <foo>) into lowercase |
Definition at line 178 of file simple_parser.hpp.
bool moost::xml::simple_parser::parse_token | ( | std::istream & | xmlFile, |
std::string & | token, | ||
bool & | isComment | ||
) | [inline, private] |
Recursively parse the xml file. Will return true if the token was IN the token, false if it was OUTSIDE the token, i.e. with opening "<" and closing ">" <test>hello</test> test -> true hello -> false
xmlFile | the file to parse |
token | the returned parsed token |
isComment | in if it's in a comment block |
Definition at line 211 of file simple_parser.hpp.
void moost::xml::simple_parser::recursive_parse_tag | ( | const std::string & | header, |
std::istream & | xmlFile, | ||
boost::shared_ptr< tree_node > & | pCurrNode, | ||
bool | makeLowercaseTags = false |
||
) | [inline, private] |
Recursively parse a given tag.
header | the header of the tag to parse. Used to make sure that the tog will be closed. |
pCurrNode | the node to be parsed makeLowercaseTags if true it will turn the tags (i.e. <foo>) into lowercase |
Definition at line 260 of file simple_parser.hpp.
Definition at line 173 of file simple_parser.hpp.