libmoost
moost::xml::simple_parser Class Reference

#include <simple_parser.hpp>

List of all members.

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_tget_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

Detailed Description

A very simple xml parser, generally used to parse config files

Definition at line 101 of file simple_parser.hpp.


Member Typedef Documentation

Definition at line 125 of file simple_parser.hpp.


Member Function Documentation

Returns the root of the xml document.

Definition at line 142 of file simple_parser.hpp.

Here is the caller graph for this function:

void moost::xml::simple_parser::load ( const std::string &  fileName,
bool  makeLowercaseTags = false 
) [inline]

Loads the xml file and parse it.

Parameters:
fileNamethe name of the file to load and parse
makeLowercaseTagsif true it will turn the tags (i.e. <foo>) into lowercase

Definition at line 178 of file simple_parser.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters:
xmlFilethe file to parse
tokenthe returned parsed token
isCommentin if it's in a comment block

Definition at line 211 of file simple_parser.hpp.

Here is the caller graph for this function:

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.

Parameters:
headerthe header of the tag to parse. Used to make sure that the tog will be closed.
pCurrNodethe 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.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation


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