arabica/include/DOM/Entity.hpp

65 lines
1.5 KiB
C++
Raw Normal View History

2002-06-21 13:16:28 +02:00
#ifndef JEZUK_DOM_ENTITY_H
#define JEZUK_DOM_ENTITY_H
////////////////////////////
// C++ DOM definition
//
// $Id$
////////////////////////////
2007-09-05 00:55:47 +02:00
#include <DOM/Node.hpp>
2002-06-21 13:16:28 +02:00
2007-09-05 13:47:13 +02:00
namespace Arabica
{
2002-06-21 13:16:28 +02:00
namespace DOM
{
template<class stringT> class Entity_impl;
template<class stringT>
class Entity : public Node<stringT>
{
typedef Node<stringT> NodeT;
2002-06-21 13:16:28 +02:00
public:
Entity() : Node<stringT>() { }
explicit Entity(Entity_impl<stringT>* impl) : Node<stringT>(impl) { }
Entity(const Entity& rhs) : Node<stringT>(rhs) { }
explicit Entity(const Node<stringT>& rhs) : Node<stringT>(rhs)
{
if(rhs.getNodeType() != Node<stringT>::Entity_NODE)
throw std::bad_cast();
}
stringT getPublicId() const { nImpl()->getPublicId(); }
stringT getSystemId() const { nImpl()->getSystemId(); }
stringT getNotationName() const { nImpl()->getNotationName(); }
private:
Entity_impl<stringT>* nImpl() { return dynamic_cast<Entity_impl<stringT>*>(NodeT::impl()); }
2002-06-21 13:16:28 +02:00
}; // class Entity
//////////////////////////////////////////////////////////
template<class stringT> class NamedNodeMap_impl;
template<class stringT>
class Entity_impl : virtual public Node_impl<stringT>
{
public:
virtual ~Entity_impl () { }
/////////////////////////////////////////////
// DOM::Entity
virtual stringT getPublicId() const = 0;
virtual stringT getSystemId() const = 0;
virtual stringT getNotationName() const = 0;
}; // class Entity_impl
} // namespace DOM
2007-09-05 13:47:13 +02:00
} // namespace Arabica
2002-06-21 13:16:28 +02:00
#endif