ui-gxmlcpp  1.4.4
XPathObject.hpp
Go to the documentation of this file.
1 
10 #ifndef UI_GXML_XPATHOBJECT_HPP
11 #define UI_GXML_XPATHOBJECT_HPP
12 
13 // STDC++
14 #include <string>
15 
16 // C libraries
17 
18 // C++ libraries
19 #include <ui-gxmlcpp/Exception.hpp>
21 
22 namespace UI {
23 namespace GXML {
24 
25 class Tree;
26 
28 class XPathObject: private UI::Util::auto_base<xmlXPathObject>
29 {
31  friend class XMLTree;
32  friend class Tree;
33 
34 private:
35  static xmlXPathObjectPtr create(xmlXPathContextPtr const context, std::string const & xpath);
36 
37 public:
39  enum ErrorCode
40  {
41  EvalError_, // Error evaluation the xpath.
42  NotAString_, // Value is not a string
43  NotABool_, // Value is not a bool
44  NotAFloat_ // Value is not a float
45  };
48 
49 protected:
51  XPathObject(xmlXPathContextPtr const context, std::string const & xpath);
52 
53 public:
55  XPathObject(XPathContext const & context, std::string const & xpath);
56 
57  ~XPathObject();
58 
59 public:
61  typedef xmlXPathObjectType Type;
63  Type getType() const;
64 
71  std::string getString() const;
72  double getNumber() const;
73  bool getBoolean() const;
77  using UI::Util::auto_base<xmlXPathObject>::get;
78  using UI::Util::auto_base<xmlXPathObject>::operator->;
79 
80 private:
81  std::string const xpath_;
82 };
83 
84 }}
85 #endif
Namespace for all Schlund+Partner Code.
Definition: Buffer.cpp:30
Type getType() const
Get type of this xpath object.
Definition: XPathObject.cpp:58
XPathObject(xmlXPathContextPtr const context, std::string const &xpath)
Internal constructor.
Definition: XPathObject.cpp:41
friend class XMLTree
Definition: XPathObject.hpp:31
Adding code facility to Exception.
Definition: Exception.hpp:34
xmlXPathObjectType Type
Abstract from libxml2 type.
Definition: XPathObject.hpp:61
XPath object holder class.
Definition: XPathObject.hpp:28
XML tree.
Definition: Tree.hpp:30
CodeException< ErrorCode > Exception
Exceptions for this class.
Definition: XPathObject.hpp:47
XPath context holder class.
Definition: XPathContext.hpp:34
ErrorCode
Error codes for exceptions.
Definition: XPathObject.hpp:39