CYCLUS
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 #include <boost/shared_ptr.hpp>
6 
7 namespace xmlpp {
8  class DomParser;
9  class Document;
10 }
11 
12 namespace cyclus {
13 
14 /// A helper class to hold xml file data and provide automatic
15 /// validation
16 class XMLParser {
17  public:
18  /// constructor
19  XMLParser();
20 
21  /// destructor
22  virtual ~XMLParser();
23 
24  /// initializes a parser with an xml snippet
25  /// @param input an xml snippet to be used as input
26  void Init(const std::stringstream& input);
27  void Init(const std::string& input);
28 
29  /// validates the file agaisnt a schema
30  /// @param schema the schema to validate agaisnt
31  void Validate(const std::stringstream& schema);
32 
33  /// @return the parser's document
34  xmlpp::Document* Document();
35 
36  private:
37  /// file parser
38  xmlpp::DomParser* parser_;
39 };
40 
41 } // namespace cyclus
42 
43 #endif // CYCLUS_SRC_XML_PARSER_H_
A helper class to hold xml file data and provide automatic validation.
Definition: xml_parser.h:16
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or.org/Osi/browser/trunk.
Definition: agent.cc:14