ui-gxmlcpp  1.4.4
ValidatorTree.hpp
Go to the documentation of this file.
1 
10 #ifndef UI_GXML_VALIDATORTREE_HPP
11 #define UI_GXML_VALIDATORTREE_HPP
12 
13 // STDC++
14 #include <string>
15 
16 // C++ Libraries
17 #include <ui-gxmlcpp/Tree.hpp>
18 
19 namespace UI {
20 namespace GXML {
21 
23 class ValidatorTree: public Tree
24 {
25 public:
28  ValidatorTree(char const * xml, int len=-1, std::string const & base=DefaultDocbase_, int const options=0);
29  ValidatorTree(std::string const & xml, std::string const & base=DefaultDocbase_, int const options=0);
30  ValidatorTree(std::istream & xml, std::string const & base=DefaultDocbase_, int const options=0);
31  ValidatorTree(FileConstructor const dummy, std::string const & file, int const options=0);
34  virtual ~ValidatorTree();
35 
36 private:
39  ValidatorTree(ValidatorTree const & tree);
40  ValidatorTree & operator=(ValidatorTree const & tree);
43 public:
45  enum ErrorCode
46  {
47  Ctxt_=1,
48  Parse_,
49  ValidCtxt_,
50  Internal_,
51  TreeInvalid_
52  };
55 
56 private:
57  virtual int libxml2Validate(Tree const & tree) const = 0;
58 
59 public:
62  bool isValid(Tree const & tree) const;
63  Tree const & validate(Tree const & tree) const;
65 };
66 
67 }}
68 #endif
Namespace for all Schlund+Partner Code.
Definition: Buffer.cpp:30
ErrorCode
Error codes for exceptions.
Definition: Tree.hpp:51
Adding code facility to Exception.
Definition: Exception.hpp:34
FileConstructor
Helper enum for constructor from file name.
Definition: Tree.hpp:102
static std::string const DefaultDocbase_
Default document base. This is used for from-memory parsing if not specified otherwise.
Definition: Tree.hpp:74
XML tree.
Definition: Tree.hpp:30
Common abstract base class for validator trees (XML Schema and RelaxNG).
Definition: ValidatorTree.hpp:23
CodeException< ErrorCode > Exception
Exceptions for this class.
Definition: ValidatorTree.hpp:54