Fawkes API
Fawkes Development Version
|
Parser used to get information out of interface template. More...
#include <interfaces/generator/parser.h>
Parser used to get information out of interface template.
Uses XML parser internally.
InterfaceParser::InterfaceParser | ( | std::string | config_filename | ) |
Constructor.
config_filename | file name of config (interface template) |
Definition at line 46 of file parser.cpp.
InterfaceParser::~InterfaceParser | ( | ) |
Destructor.
Definition at line 60 of file parser.cpp.
std::vector< InterfaceConstant > InterfaceParser::getConstants | ( | ) |
Get constants.
Only valid after parse().
Definition at line 699 of file parser.cpp.
std::string InterfaceParser::getDataComment | ( | ) |
Get data comment.
Only valid after parse().
Definition at line 743 of file parser.cpp.
std::vector< InterfaceField > InterfaceParser::getDataFields | ( | ) |
Get data fields.
Only valid after parse().
Definition at line 721 of file parser.cpp.
std::vector< InterfaceEnumConstant > InterfaceParser::getEnumConstants | ( | ) |
Get enum constants.
Only valid after parse().
Definition at line 710 of file parser.cpp.
std::vector< InterfaceField > InterfaceParser::getFields | ( | xmlpp::Node * | node | ) |
Get parsed fields.
Get fields stored below the given node.
node | root node where to start searching |
Definition at line 72 of file parser.cpp.
References InterfaceField::setAttribute(), InterfaceField::getName(), InterfaceField::setComment(), InterfaceField::valid(), and fawkes::Exception::print_trace().
std::string InterfaceParser::getInterfaceAuthor | ( | ) |
Get interface author.
Only valid after parse().
Definition at line 666 of file parser.cpp.
std::string InterfaceParser::getInterfaceCreationDate | ( | ) |
Get interface creation date as string Only valid after parse().
Definition at line 688 of file parser.cpp.
std::string InterfaceParser::getInterfaceName | ( | ) |
Get interface name.
Only valid after parse().
Definition at line 655 of file parser.cpp.
std::string InterfaceParser::getInterfaceYear | ( | ) |
Get interface copyright year.
Only valid after parse().
Definition at line 677 of file parser.cpp.
std::vector< InterfaceMessage > InterfaceParser::getMessages | ( | ) |
Get messages.
Only valid after parse().
Definition at line 754 of file parser.cpp.
std::vector< InterfacePseudoMap > InterfaceParser::getPseudoMaps | ( | xmlpp::Node * | node, |
std::vector< InterfaceField > & | fields | ||
) |
Get parsed pseudo maps.
Get pseudo maps stored below the given node.
node | root node where to start searching |
fields | vector of parsed fields, used to detect name clashes |
Definition at line 130 of file parser.cpp.
References InterfacePseudoMap::addRef(), InterfacePseudoMap::valid(), and fawkes::Exception::print_trace().
std::vector< InterfacePseudoMap > InterfaceParser::getPseudoMaps | ( | ) |
Get data pseudo maps.
Only valid after parse().
Definition at line 732 of file parser.cpp.
void InterfaceParser::parse | ( | ) |
Parse config.
Definition at line 339 of file parser.cpp.
References fawkes::Exception::print_trace(), InterfaceEnumConstant::add_item(), fawkes::StringConversions::to_int(), and InterfaceMessage::setFields().
void InterfaceParser::print | ( | ) |
Print parsed data.
Definition at line 331 of file parser.cpp.
void InterfaceParser::printFields | ( | std::vector< InterfaceField > & | fields | ) |
Print fields.
Print fields to stdout.
fields | fields to print |
Definition at line 236 of file parser.cpp.
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.
constants | parsed constants |
enum_constants | parsed enum_constants |
data_fields | parsed data fields |
pseudo_maps | pseudo maps |
messages | parsed messages. |
Definition at line 296 of file parser.cpp.
void InterfaceParser::printPseudoMaps | ( | std::vector< InterfacePseudoMap > & | pseudo_maps | ) |
Print pseudo maps.
pseudo_maps | pseudo maps to print |
Definition at line 269 of file parser.cpp.
References InterfacePseudoMap::getRefList().