InterfaceParser Class Reference

Parser used to get information out of interface template. More...

#include <interfaces/generator/parser.h>

List of all members.

Public Member Functions

 InterfaceParser (std::string config_filename)
 Constructor.
 ~InterfaceParser ()
 Destructor.
std::vector< InterfaceFieldgetFields (xmlpp::Node *node)
 Get parsed fields.
std::vector< InterfacePseudoMapgetPseudoMaps (xmlpp::Node *node, std::vector< InterfaceField > &fields)
 Get parsed pseudo maps.
void parse ()
 Parse config.
void printFields (std::vector< InterfaceField > &fields)
 Print fields.
void printPseudoMaps (std::vector< InterfacePseudoMap > &pseudo_maps)
 Print pseudo maps.
void print ()
 Print parsed data.
void printParsed (std::vector< InterfaceConstant > &constants, std::vector< InterfaceEnumConstant > &enum_constants, std::vector< InterfaceField > &data_fields, std::vector< InterfacePseudoMap > &pseudo_maps, std::vector< InterfaceMessage > &messages)
 Print parsed config.
std::string getInterfaceName ()
 Get interface name.
std::string getInterfaceAuthor ()
 Get interface author.
std::string getInterfaceYear ()
 Get interface copyright year.
std::string getInterfaceCreationDate ()
 Get interface creation date as string Only valid after parse().
std::vector< InterfaceConstantgetConstants ()
 Get constants.
std::vector< InterfaceEnumConstantgetEnumConstants ()
 Get enum constants.
std::vector< InterfaceFieldgetDataFields ()
 Get data fields.
std::vector< InterfacePseudoMapgetPseudoMaps ()
 Get data pseudo maps.
std::string getDataComment ()
 Get data comment.
std::vector< InterfaceMessagegetMessages ()
 Get messages.


Detailed Description

Parser used to get information out of interface template.

Uses XML parser internally.

Definition at line 40 of file parser.h.


Constructor & Destructor Documentation

InterfaceParser::InterfaceParser ( std::string  config_filename  ) 

Constructor.

Parameters:
config_filename file name of config (interface template)

Definition at line 44 of file parser.cpp.

InterfaceParser::~InterfaceParser (  ) 

Destructor.

Definition at line 58 of file parser.cpp.


Member Function Documentation

std::vector< InterfaceConstant > InterfaceParser::getConstants (  ) 

Get constants.

Only valid after parse().

Returns:
constants.

Definition at line 683 of file parser.cpp.

std::string InterfaceParser::getDataComment (  ) 

Get data comment.

Only valid after parse().

Returns:
data comment.

Definition at line 727 of file parser.cpp.

std::vector< InterfaceField > InterfaceParser::getDataFields (  ) 

Get data fields.

Only valid after parse().

Returns:
data fields.

Definition at line 705 of file parser.cpp.

std::vector< InterfaceEnumConstant > InterfaceParser::getEnumConstants (  ) 

Get enum constants.

Only valid after parse().

Returns:
enum constants.

Definition at line 694 of file parser.cpp.

std::vector< InterfaceField > InterfaceParser::getFields ( xmlpp::Node *  node  ) 

Get parsed fields.

Get fields stored below the given node.

Parameters:
node root node where to start searching
Returns:
vector of field representations.

Definition at line 70 of file parser.cpp.

References fawkes::Exception::print_trace(), InterfaceField::setAttribute(), InterfaceField::setComment(), and InterfaceField::valid().

Referenced by parse().

std::string InterfaceParser::getInterfaceAuthor (  ) 

Get interface author.

Only valid after parse().

Returns:
interface author.

Definition at line 650 of file parser.cpp.

std::string InterfaceParser::getInterfaceCreationDate (  ) 

Get interface creation date as string Only valid after parse().

Returns:
interface creation date

Definition at line 672 of file parser.cpp.

std::string InterfaceParser::getInterfaceName (  ) 

Get interface name.

Only valid after parse().

Returns:
interface name.

Definition at line 639 of file parser.cpp.

std::string InterfaceParser::getInterfaceYear (  ) 

Get interface copyright year.

Only valid after parse().

Returns:
interface copyright year

Definition at line 661 of file parser.cpp.

std::vector< InterfaceMessage > InterfaceParser::getMessages (  ) 

Get messages.

Only valid after parse().

Returns:
messages.

Definition at line 738 of file parser.cpp.

std::vector< InterfacePseudoMap > InterfaceParser::getPseudoMaps (  ) 

Get data pseudo maps.

Only valid after parse().

Returns:
pseudo maps

Definition at line 716 of file parser.cpp.

Referenced by parse().

std::vector< InterfacePseudoMap > InterfaceParser::getPseudoMaps ( xmlpp::Node *  node,
std::vector< InterfaceField > &  fields 
)

Get parsed pseudo maps.

Get pseudo maps stored below the given node.

Parameters:
node root node where to start searching
fields vector of parsed fields, used to detect name clashes
Returns:
vector of pseudo map representations.

Definition at line 129 of file parser.cpp.

References InterfacePseudoMap::addRef(), fawkes::Exception::print_trace(), and InterfacePseudoMap::valid().

void InterfaceParser::parse (  ) 

Parse config.

Definition at line 337 of file parser.cpp.

References InterfaceEnumConstant::addItem(), getFields(), getPseudoMaps(), fawkes::Exception::print_trace(), and InterfaceMessage::setFields().

void InterfaceParser::print (  ) 

Print parsed data.

Definition at line 329 of file parser.cpp.

References printParsed().

void InterfaceParser::printFields ( std::vector< InterfaceField > &  fields  ) 

Print fields.

Print fields to stdout.

Parameters:
fields fields to print

Definition at line 235 of file parser.cpp.

Referenced by printParsed().

void InterfaceParser::printParsed ( std::vector< InterfaceConstant > &  constants,
std::vector< InterfaceEnumConstant > &  enum_constants,
std::vector< InterfaceField > &  data_fields,
std::vector< InterfacePseudoMap > &  pseudo_maps,
std::vector< InterfaceMessage > &  messages 
)

Print parsed config.

Parameters:
constants parsed constants
enum_constants parsed enum_constants
data_fields parsed data fields
pseudo_maps pseudo maps
messages parsed messages.

Definition at line 295 of file parser.cpp.

References printFields(), and printPseudoMaps().

Referenced by print().

void InterfaceParser::printPseudoMaps ( std::vector< InterfacePseudoMap > &  pseudo_maps  ) 

Print pseudo maps.

Parameters:
pseudo_maps pseudo maps to print

Definition at line 268 of file parser.cpp.

Referenced by printParsed().


The documentation for this class was generated from the following files:
Generated on Tue Feb 22 13:31:32 2011 for Fawkes API by  doxygen 1.4.7