arabica/include/DOM/DocumentFragment.hpp

49 lines
1.4 KiB
C++
Raw Normal View History

2002-06-21 13:16:28 +02:00
#ifndef JEZUK_DOM_DOCUMENTFRAGMENT_H
#define JEZUK_DOM_DOCUMENTFRAGMENT_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
#include <typeinfo>
2007-09-05 13:47:13 +02:00
namespace Arabica
{
2002-06-21 13:16:28 +02:00
namespace DOM
{
template<class stringT, class string_adaptorT> class DocumentFragment_impl;
2002-06-21 13:16:28 +02:00
template<class stringT, class string_adaptorT = Arabica::default_string_adaptor<stringT> >
class DocumentFragment : public Node<stringT, string_adaptorT>
2002-06-21 13:16:28 +02:00
{
public:
DocumentFragment() : Node<stringT, string_adaptorT>() { }
explicit DocumentFragment(DocumentFragment_impl<stringT, string_adaptorT>* impl) : Node<stringT, string_adaptorT>(impl) { }
DocumentFragment(const DocumentFragment& rhs) : Node<stringT, string_adaptorT>(rhs) { }
explicit DocumentFragment(const Node<stringT, string_adaptorT>& rhs) : Node<stringT, string_adaptorT>(rhs)
2002-06-21 13:16:28 +02:00
{
if(NodeT::impl_ == 0) // null nodes can always be cast
return;
if(rhs.getNodeType() != Node<stringT, string_adaptorT>::DOCUMENT_FRAGMENT_NODE)
2002-06-21 13:16:28 +02:00
throw std::bad_cast();
}
}; // class DocumentFragment
//////////////////////////////////////////////////////////
template<class stringT, class string_adaptorT>
class DocumentFragment_impl : virtual public Node_impl<stringT, string_adaptorT>
2002-06-21 13:16:28 +02:00
{
public:
virtual ~DocumentFragment_impl() { }
}; // class DocumentFragment_impl
} // namespace DOM
2007-09-05 13:47:13 +02:00
} // namespace Arabica
2002-06-21 13:16:28 +02:00
#endif