ContRap-Core
Public Member Functions | Protected Member Functions | Protected Attributes

crp::XMLPool Class Reference

Class XMLPool is a query class object for XML-trees. More...

#include <xmlpool.h>

Inheritance diagram for crp::XMLPool:
crp::XMLParser

Public Member Functions

 XMLPool (const std::string &text="")
 Creates a new parser.
virtual ~XMLPool ()
 Cleans up the memory.
std::string get_value (const std::string &key)
 Returns a value.
std::string * is_set (const std::string &key)
 Returns true if the key has an entry.
std::string to_string ()
 Prints the pool to a string.

Protected Member Functions

virtual bool start ()
 XML parser event functions.
virtual bool enter (const std::string &tag, std::map< std::string, std::string > &attributes, bool end)
 Event functions are called on entering, parsing and leaving tags.
virtual bool content (const std::string &tag, std::map< std::string, std::string > &attributes, const std::string &value, int count)
virtual bool leave (const std::string &tag, std::map< std::string, std::string > &attributes)

Protected Attributes

std::map< std::string,
std::string > 
entries
 Pool data structure.
std::stack< std::string > keys
 Currently parsed key.

Detailed Description

Class XMLPool is a query class object for XML-trees.


Constructor & Destructor Documentation

crp::XMLPool::XMLPool ( const std::string &  text = "")

Creates a new parser.

Parameters:
textXML-formatted string
virtual crp::XMLPool::~XMLPool ( ) [virtual]

Cleans up the memory.


Member Function Documentation

virtual bool crp::XMLPool::content ( const std::string &  tag,
std::map< std::string, std::string > &  attributes,
const std::string &  value,
int  count 
) [protected, virtual]

Reimplemented from crp::XMLParser.

virtual bool crp::XMLPool::enter ( const std::string &  tag,
std::map< std::string, std::string > &  attributes,
bool  end 
) [protected, virtual]

Event functions are called on entering, parsing and leaving tags.

A false returned by an event function results in an error break.

Reimplemented from crp::XMLParser.

std::string crp::XMLPool::get_value ( const std::string &  key)

Returns a value.

Parameters:
keyKey of the entry with tags separated by ':'
Returns:
String value of the entry
std::string* crp::XMLPool::is_set ( const std::string &  key)

Returns true if the key has an entry.

Parameters:
keyKey of the entry with tags separated by ':'
Returns:
Valid pointer if the value for the key is set and zero else
virtual bool crp::XMLPool::leave ( const std::string &  tag,
std::map< std::string, std::string > &  attributes 
) [protected, virtual]

Reimplemented from crp::XMLParser.

virtual bool crp::XMLPool::start ( ) [protected, virtual]

XML parser event functions.

Reimplemented from crp::XMLParser.

std::string crp::XMLPool::to_string ( )

Prints the pool to a string.

Returns:
String with pool contents

Field Documentation

std::map<std::string, std::string> crp::XMLPool::entries [protected]

Pool data structure.

std::stack<std::string> crp::XMLPool::keys [protected]

Currently parsed key.


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