CYCLUS
Loading...
Searching...
No Matches
xml_parser.h
Go to the documentation of this file.
1#ifndef CYCLUS_SRC_XML_PARSER_H_
2#define CYCLUS_SRC_XML_PARSER_H_
3
4#include <sstream>
5
6namespace xmlpp {
7 class DomParser;
8 class Document;
9}
10
11namespace cyclus {
12
13/// A helper class to hold xml file data and provide automatic
14/// validation
15class XMLParser {
16 public:
17 /// constructor
18 XMLParser();
19
20 /// destructor
21 virtual ~XMLParser();
22
23 /// initializes a parser with an xml snippet
24 /// @param input an xml snippet to be used as input
25 void Init(const std::stringstream& input);
26 void Init(const std::string& input);
27
28 /// validates the file agaisnt a schema
29 /// @param schema the schema to validate agaisnt
30 void Validate(const std::stringstream& schema);
31
32 /// @return the parser's document
33 xmlpp::Document* Document();
34
35 private:
36 /// file parser
37 xmlpp::DomParser* parser_;
38};
39
40} // namespace cyclus
41
42#endif // CYCLUS_SRC_XML_PARSER_H_
A helper class to hold xml file data and provide automatic validation.
Definition xml_parser.h:15
void Validate(const std::stringstream &schema)
validates the file agaisnt a schema
Definition xml_parser.cc:54
virtual ~XMLParser()
destructor
Definition xml_parser.cc:27
void Init(const std::stringstream &input)
initializes a parser with an xml snippet
Definition xml_parser.cc:49
XMLParser()
constructor
Definition xml_parser.cc:22
xmlpp::Document * Document()
Definition xml_parser.cc:61
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
Definition agent.cc:14
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters