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
|
|
|
|
{
|
|
|
|
|
2007-09-08 00:03:27 +02:00
|
|
|
template<class stringT, class string_adaptorT> class Entity_impl;
|
2002-06-21 13:16:28 +02:00
|
|
|
|
2007-09-09 00:31:24 +02:00
|
|
|
template<class stringT, class string_adaptorT = Arabica::default_string_adaptor<stringT> >
|
2007-09-08 00:03:27 +02:00
|
|
|
class Entity : public Node<stringT, string_adaptorT>
|
2002-06-21 13:16:28 +02:00
|
|
|
{
|
|
|
|
public:
|
2007-09-09 00:31:24 +02:00
|
|
|
typedef Node<stringT, string_adaptorT> NodeT;
|
|
|
|
typedef Entity_impl<stringT, string_adaptorT> Entity_implT;
|
|
|
|
|
2007-09-08 00:03:27 +02:00
|
|
|
Entity() : Node<stringT, string_adaptorT>() { }
|
2010-12-09 12:35:54 +01:00
|
|
|
explicit Entity(Entity_impl<stringT, string_adaptorT>* impl) : Node<stringT, string_adaptorT>(impl) { }
|
2007-09-08 00:03:27 +02:00
|
|
|
Entity(const Entity& rhs) : Node<stringT, string_adaptorT>(rhs) { }
|
2010-12-09 12:35:54 +01:00
|
|
|
explicit Entity(const Node<stringT, string_adaptorT>& rhs) : Node<stringT, string_adaptorT>(rhs)
|
2002-06-21 13:16:28 +02:00
|
|
|
{
|
2010-12-09 12:35:54 +01:00
|
|
|
if(NodeT::impl_ == 0) // null nodes can always be cast
|
|
|
|
return;
|
|
|
|
if(rhs.getNodeType() != Node_base::ENTITY_NODE)
|
2010-12-10 10:24:34 +01:00
|
|
|
throw DOMBadCast("Entity");
|
2002-06-21 13:16:28 +02:00
|
|
|
}
|
|
|
|
|
2010-12-09 12:35:54 +01:00
|
|
|
stringT getPublicId() const { return nImpl()->getPublicId(); }
|
2002-06-21 13:16:28 +02:00
|
|
|
|
2010-12-09 12:35:54 +01:00
|
|
|
stringT getSystemId() const { return nImpl()->getSystemId(); }
|
2002-06-21 13:16:28 +02:00
|
|
|
|
2010-12-09 12:35:54 +01:00
|
|
|
stringT getNotationName() const { return nImpl()->getNotationName(); }
|
2002-06-21 13:16:28 +02:00
|
|
|
|
|
|
|
private:
|
2010-12-09 12:35:54 +01:00
|
|
|
Entity_implT* nImpl() const { return dynamic_cast<Entity_implT*>(*NodeT::impl_); }
|
2002-06-21 13:16:28 +02:00
|
|
|
}; // class Entity
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////
|
2007-09-08 00:03:27 +02:00
|
|
|
template<class stringT, class string_adaptorT> class NamedNodeMap_impl;
|
2002-06-21 13:16:28 +02:00
|
|
|
|
2007-09-08 00:03:27 +02:00
|
|
|
template<class stringT, class string_adaptorT>
|
|
|
|
class Entity_impl : virtual public Node_impl<stringT, string_adaptorT>
|
2002-06-21 13:16:28 +02:00
|
|
|
{
|
|
|
|
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
|
|
|
|
|