ui-gxmlcpp  1.4.4
XPathContext.hpp
Go to the documentation of this file.
1 
10 #ifndef UI_GXML_XPATHCONTEXT_HPP
11 #define UI_GXML_XPATHCONTEXT_HPP
12 
13 // STDC++
14 #include <string>
15 
16 // C libraries
17 #include <libxml/tree.h>
18 #include <libxml/xpath.h>
19 
20 // C++ libraries
21 #include <ui-gxmlcpp/Exception.hpp>
22 #include <ui-gxmlcpp/Util.hpp>
23 
24 namespace UI {
25 namespace GXML {
26 
27 class Tree;
28 
34 class XPathContext: private UI::Util::auto_base<xmlXPathContext>
35 {
36  friend class Tree;
37  friend class XPathObject;
38 
39  // Compatibility
40  friend class XMLTree;
41  friend class XMLDump;
42  friend class XMLNodeSet;
43 
44 private:
46  static xmlXPathContext * create(xmlDoc * doc, xmlNode * node);
47 
48 public:
50  enum ErrorCode
51  {
52  Create_ // Could not create (XPath) context for Tree
53  };
56 
57 //protected:
59  XPathContext(xmlDoc * doc, xmlNode * node=0);
60 
61 public:
63  XPathContext(Tree const & tree, xmlNode * node=0);
64  ~XPathContext();
65 
67  void registerNamespace(std::string const & prefix, std::string const & uri);
68 };
69 
70 }}
71 #endif
Namespace for all Schlund+Partner Code.
Definition: Buffer.cpp:30
XPathContext(xmlDoc *doc, xmlNode *node=0)
Constructor libxml2 doc.
Definition: XPathContext.cpp:45
CodeException< ErrorCode > Exception
Exceptions for this class.
Definition: XPathContext.hpp:55
ErrorCode
Error codes for exceptions.
Definition: XPathContext.hpp:50
Adding code facility to Exception.
Definition: Exception.hpp:34
void registerNamespace(std::string const &prefix, std::string const &uri)
Register a new namespace prefix for this context.
Definition: XPathContext.cpp:60
XPath object holder class.
Definition: XPathObject.hpp:28
XML tree.
Definition: Tree.hpp:30
XPath context holder class.
Definition: XPathContext.hpp:34