Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
parser.h
1 
2 /***************************************************************************
3  * parser.h - Interface config parser
4  *
5  * Generated: Tue Oct 10 17:29:33 2006
6  * Copyright 2006 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef __INTERFACES_GENERATOR_PARSER_H_
24 #define __INTERFACES_GENERATOR_PARSER_H_
25 
26 #include "field.h"
27 #include "constant.h"
28 #include "enum_constant.h"
29 #include "message.h"
30 #include "pseudomap.h"
31 
32 #include <vector>
33 #include <string>
34 
35 namespace xmlpp {
36  class DomParser;
37  class Node;
38 }
39 
41 {
42  public:
43  InterfaceParser(std::string config_filename);
45 
46  std::vector<InterfaceField> getFields(xmlpp::Node *node);
47  std::vector<InterfacePseudoMap> getPseudoMaps(xmlpp::Node *node,
48  std::vector<InterfaceField> &fields);
49  void parse();
50 
51  void printFields(std::vector<InterfaceField> &fields);
52  void printPseudoMaps(std::vector<InterfacePseudoMap> &pseudo_maps);
53  void print();
54  void printParsed(std::vector<InterfaceConstant> & constants,
55  std::vector<InterfaceEnumConstant> & enum_constants,
56  std::vector<InterfaceField> & data_fields,
57  std::vector<InterfacePseudoMap> & pseudo_maps,
58  std::vector<InterfaceMessage> & messages);
59 
60  std::string getInterfaceName();
61  std::string getInterfaceAuthor();
62  std::string getInterfaceYear();
63  std::string getInterfaceCreationDate();
64  std::vector<InterfaceConstant> getConstants();
65  std::vector<InterfaceEnumConstant> getEnumConstants();
66  std::vector<InterfaceField> getDataFields();
67  std::vector<InterfacePseudoMap> getPseudoMaps();
68  std::string getDataComment();
69  std::vector<InterfaceMessage> getMessages();
70 
71  private:
72  xmlpp::DomParser *dom;
73  xmlpp::Node *root;
74  std::string name;
75  std::string author;
76  std::string year;
77  std::string creation_date;
78  std::string data_comment;
79 
80  std::vector<InterfaceConstant> constants;
81  std::vector<InterfaceEnumConstant> enum_constants;
82  std::vector<InterfaceField> data_fields;
83  std::vector<InterfacePseudoMap> pseudo_maps;
84  std::vector<InterfaceMessage> messages;
85 
86 };
87 
88 
89 #endif
InterfaceParser(std::string config_filename)
Constructor.
Definition: parser.cpp:46
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.
Definition: parser.cpp:296
void parse()
Parse config.
Definition: parser.cpp:339
void printPseudoMaps(std::vector< InterfacePseudoMap > &pseudo_maps)
Print pseudo maps.
Definition: parser.cpp:269
void printFields(std::vector< InterfaceField > &fields)
Print fields.
Definition: parser.cpp:236
Parser used to get information out of interface template.
Definition: parser.h:40
void print()
Print parsed data.
Definition: parser.cpp:331
std::vector< InterfacePseudoMap > getPseudoMaps()
Get data pseudo maps.
Definition: parser.cpp:732
std::vector< InterfaceField > getFields(xmlpp::Node *node)
Get parsed fields.
Definition: parser.cpp:72
~InterfaceParser()
Destructor.
Definition: parser.cpp:60
std::string getInterfaceAuthor()
Get interface author.
Definition: parser.cpp:666
std::string getDataComment()
Get data comment.
Definition: parser.cpp:743
std::vector< InterfaceMessage > getMessages()
Get messages.
Definition: parser.cpp:754
std::vector< InterfaceField > getDataFields()
Get data fields.
Definition: parser.cpp:721
std::string getInterfaceCreationDate()
Get interface creation date as string Only valid after parse().
Definition: parser.cpp:688
std::string getInterfaceName()
Get interface name.
Definition: parser.cpp:655
std::vector< InterfaceEnumConstant > getEnumConstants()
Get enum constants.
Definition: parser.cpp:710
std::string getInterfaceYear()
Get interface copyright year.
Definition: parser.cpp:677
std::vector< InterfaceConstant > getConstants()
Get constants.
Definition: parser.cpp:699