XPathObject.hpp
Go to the documentation of this file.
#ifndef UI_GXML_XPATHOBJECT_HPP
#define UI_GXML_XPATHOBJECT_HPP
// STDC++
#include <string>
// C libraries
// C++ libraries
#include <ui-gxmlcpp/Exception.hpp>
#include <ui-gxmlcpp/XPathContext.hpp>
namespace UI {
namespace GXML {
class Tree;
class XPathObject: private UI::Util::auto_base<xmlXPathObject>
{
friend class XMLTree;
friend class Tree;
private:
static xmlXPathObjectPtr create(xmlXPathContextPtr const context, std::string const & xpath);
public:
enum ErrorCode
{
EvalError_, // Error evaluation the xpath.
NotAString_, // Value is not a string
NotABool_, // Value is not a bool
NotAFloat_ // Value is not a float
};
typedef CodeException<ErrorCode> Exception;
protected:
XPathObject(xmlXPathContextPtr const context, std::string const & xpath);
public:
XPathObject(XPathContext const & context, std::string const & xpath);
~XPathObject();
public:
typedef xmlXPathObjectType Type;
Type getType() const;
std::string getString() const;
double getNumber() const;
bool getBoolean() const;
using UI::Util::auto_base<xmlXPathObject>::get;
using UI::Util::auto_base<xmlXPathObject>::operator->;
private:
std::string const xpath_;
};
}}
#endif
Exception.hpp
XPathContext.hpp
UI::GXML::CodeException
Adding code facility to Exception.
Definition Exception.hpp:35
UI::GXML::Tree
XML tree.
Definition Tree.hpp:31
UI::GXML::XPathContext
XPath context holder class.
Definition XPathContext.hpp:35
UI::GXML::XPathObject::XPathObject
XPathObject(xmlXPathContextPtr const context, std::string const &xpath)
Internal constructor.
Definition XPathObject.cpp:41
UI::GXML::XPathObject::ErrorCode
ErrorCode
Error codes for exceptions.
Definition XPathObject.hpp:40
UI::GXML::XPathObject::getType
Type getType() const
Get type of this xpath object.
Definition XPathObject.cpp:58
UI::GXML::XPathObject::XMLTree
friend class XMLTree
Definition XPathObject.hpp:31
UI::GXML::XPathObject::Type
xmlXPathObjectType Type
Abstract from libxml2 type.
Definition XPathObject.hpp:61
UI::GXML::XPathObject::Exception
CodeException< ErrorCode > Exception
Exceptions for this class.
Definition XPathObject.hpp:47
UI::GXML
Namespace for library project "ui-gxmlcpp".
Definition Buffer.cpp:31
UI
Namespace for all Schlund+Partner Code.
Definition Buffer.cpp:30