TOBI SignalServer  0.1
tobiss::XMLParser Class Reference

Class holding a xml document and doing basic xml parsing. More...

#include <xml_parser.h>

Public Member Functions

 XMLParser ()
 Default constructor.
 XMLParser (const std::string xml_file)
 Constructor.
virtual ~XMLParser ()
 Default destructor.
const ticpp::Iterator
< ticpp::Element > 
getSubjectElement () const
 Get an ticpp Element pointing to the <subject> node.
const ticpp::Iterator
< ticpp::Element > 
getServerSettingsElement () const
 Get an ticpp Element pointing to the <server_settings> node.
const ticpp::Iterator
< ticpp::Element > 
getHardwareElement (const unsigned int n) const
 Get the n-th ticpp Element pointing to an <hardware> node.
const ticpp::Iterator
< ticpp::Element > 
getHardwareElement (const std::string &s) const
 Get the ticpp Element pointing to the respective <hardware> node.
const std::string getHardwareElementName (const unsigned int n) const
 Get the name of the n-th <hardware> node.
unsigned int getNrOfHardwareElements () const
 Get the mode of the n-th <hardware> node.
std::map< std::string,
std::string > 
parseSubject ()
 Parse the <subject> section in the config file into a map.
std::map< std::string,
std::string > 
parseServerSettings ()
 Parse the <server_setting> section in the config file into a map.
bool usesDataFile ()
 Parse the <measurement_channels> section in the config file -- used for common channel settings.

Private Member Functions

void checkHardwareAttributes (std::map< std::string, std::string > &m)
 TODO.
bool isNumber (const std::string &s)
 Check, if a string represents a valid number.
bool equalsYesOrNo (const std::string &s)
void parseFileLocation (ticpp::Iterator< ticpp::Element > elem, std::map< std::string, std::string > &m)
 TODO -- move this method to other file.

Private Attributes

ticpp::Document doc_
 Holding the XML document.
ticpp::Iterator< ticpp::Element > subject_
 Iterator to the <subject> tag.
ticpp::Iterator< ticpp::Element > server_settings_
 Iterator to the <server_setting> tag.
ticpp::Iterator< ticpp::Element > file_reader_
 Iterator to the <file-reader> tag.
bool external_data_file_
std::map< std::string,
std::string > 
subject_map_
std::map< std::string,
std::string > 
server_settings_map_
std::vector< std::pair
< std::string, ticpp::Iterator
< ticpp::Element > > > 
hardware_
 A vector containing iterators to the respective <hardware> tags.
tia::Constants cst_
 A static object containing constants.

Detailed Description

Class holding a xml document and doing basic xml parsing.

Definition at line 70 of file xml_parser.h.


The documentation for this class was generated from the following files:
All Data Structures Files Functions Variables