mirror of
https://github.com/jezhiggins/arabica
synced 2025-02-11 08:48:06 +01:00
Updating to build with gcc 3.4.2
This commit is contained in:
parent
7d0d6d8cd5
commit
7fc5cea45e
23 changed files with 193 additions and 81 deletions
|
@ -18,6 +18,7 @@ template<class stringT> class Attr_impl;
|
||||||
template<class stringT>
|
template<class stringT>
|
||||||
class Attr : public Node<stringT>
|
class Attr : public Node<stringT>
|
||||||
{
|
{
|
||||||
|
using Node<stringT>::impl_;
|
||||||
public:
|
public:
|
||||||
Attr() : Node<stringT>() { }
|
Attr() : Node<stringT>() { }
|
||||||
explicit Attr(Attr_impl<stringT>* impl) : Node<stringT>(impl) { }
|
explicit Attr(Attr_impl<stringT>* impl) : Node<stringT>(impl) { }
|
||||||
|
|
|
@ -17,6 +17,8 @@ template<class stringT> class Entity_impl;
|
||||||
template<class stringT>
|
template<class stringT>
|
||||||
class Entity : public Node<stringT>
|
class Entity : public Node<stringT>
|
||||||
{
|
{
|
||||||
|
using Node<stringT>::impl;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Entity() : Node<stringT>() { }
|
Entity() : Node<stringT>() { }
|
||||||
explicit Entity(Entity_impl<stringT>* impl) : Node<stringT>(impl) { }
|
explicit Entity(Entity_impl<stringT>* impl) : Node<stringT>(impl) { }
|
||||||
|
|
|
@ -18,6 +18,8 @@ template<class stringT> class Notation_impl;
|
||||||
template<class stringT>
|
template<class stringT>
|
||||||
class Notation : public Node<stringT>
|
class Notation : public Node<stringT>
|
||||||
{
|
{
|
||||||
|
using Node<stringT>::impl;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Notation() : Node<stringT>() { }
|
Notation() : Node<stringT>() { }
|
||||||
explicit Notation(Notation_impl<stringT>* impl) : Node<stringT>(dynamic_cast<Node_impl<stringT>*>(impl)) { }
|
explicit Notation(Notation_impl<stringT>* impl) : Node<stringT>(dynamic_cast<Node_impl<stringT>*>(impl)) { }
|
||||||
|
|
|
@ -10,6 +10,10 @@ template<class stringT, class string_adaptorT>
|
||||||
class DocumentType : public SimpleDOM::DocumentTypeImpl<stringT, string_adaptorT>
|
class DocumentType : public SimpleDOM::DocumentTypeImpl<stringT, string_adaptorT>
|
||||||
{
|
{
|
||||||
typedef SimpleDOM::DocumentTypeImpl<stringT, string_adaptorT> BaseDT;
|
typedef SimpleDOM::DocumentTypeImpl<stringT, string_adaptorT> BaseDT;
|
||||||
|
using BaseDT::ownerDoc_;
|
||||||
|
using BaseDT::getElements;
|
||||||
|
using BaseDT::addDefaultAttr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DocumentType(const stringT& qualifiedName,
|
DocumentType(const stringT& qualifiedName,
|
||||||
const stringT& publicId,
|
const stringT& publicId,
|
||||||
|
|
|
@ -15,6 +15,14 @@ template<class stringT, class string_adaptorT>
|
||||||
class AttrImpl : public DOM::Attr_impl<stringT>,
|
class AttrImpl : public DOM::Attr_impl<stringT>,
|
||||||
public NodeImplWithChildren<stringT, string_adaptorT>
|
public NodeImplWithChildren<stringT, string_adaptorT>
|
||||||
{
|
{
|
||||||
|
typedef DOM::Attr_impl<stringT> AttrT;
|
||||||
|
using AttrT::ownerDoc_;
|
||||||
|
using AttrT::getNodeValue;
|
||||||
|
using AttrT::setNodeValue;
|
||||||
|
using AttrT::getFirstChild;
|
||||||
|
using AttrT::throwIfReadOnly;
|
||||||
|
using AttrT::setOwnerElement;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AttrImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& name) :
|
AttrImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& name) :
|
||||||
DOM::Attr_impl<stringT>(),
|
DOM::Attr_impl<stringT>(),
|
||||||
|
|
|
@ -11,6 +11,12 @@ namespace SimpleDOM
|
||||||
template<class stringT, class string_adaptorT>
|
template<class stringT, class string_adaptorT>
|
||||||
class AttrMap : public NamedNodeMapImpl<stringT, string_adaptorT>
|
class AttrMap : public NamedNodeMapImpl<stringT, string_adaptorT>
|
||||||
{
|
{
|
||||||
|
typedef NamedNodeMapImpl<stringT, string_adaptorT> MapT;
|
||||||
|
using MapT::setAttribute;
|
||||||
|
using MapT::setAttributeNS;
|
||||||
|
using MapT::getDefaultAttrs;
|
||||||
|
using MapT::ownerDoc_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AttrMap(DocumentImpl<stringT, string_adaptorT>* ownerDoc) :
|
AttrMap(DocumentImpl<stringT, string_adaptorT>* ownerDoc) :
|
||||||
NamedNodeMapImpl<stringT, string_adaptorT>(ownerDoc),
|
NamedNodeMapImpl<stringT, string_adaptorT>(ownerDoc),
|
||||||
|
|
|
@ -11,6 +11,14 @@ template<class stringT, class string_adaptorT>
|
||||||
class AttrNSImpl : public AttrImpl<stringT, string_adaptorT>
|
class AttrNSImpl : public AttrImpl<stringT, string_adaptorT>
|
||||||
{
|
{
|
||||||
typedef typename stringT::size_type size_type;
|
typedef typename stringT::size_type size_type;
|
||||||
|
typedef AttrImpl<stringT, string_adaptorT> AttrT;
|
||||||
|
using AttrT::cloneNode;
|
||||||
|
using AttrT::ownerDoc_;
|
||||||
|
using AttrT::name_;
|
||||||
|
using AttrT::getSpecified;
|
||||||
|
using AttrT::getPrefix;
|
||||||
|
using AttrT::setPrefix;
|
||||||
|
using AttrT::hasPrefix;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AttrNSImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc,
|
AttrNSImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc,
|
||||||
|
|
|
@ -10,6 +10,17 @@ template<class stringT, class string_adaptorT>
|
||||||
class CDATASectionImpl : public DOM::CDATASection_impl<stringT>,
|
class CDATASectionImpl : public DOM::CDATASection_impl<stringT>,
|
||||||
public CharacterDataImpl<stringT, string_adaptorT>
|
public CharacterDataImpl<stringT, string_adaptorT>
|
||||||
{
|
{
|
||||||
|
typedef DOM::CDATASection_impl<stringT> CDATASectionT;
|
||||||
|
using CDATASectionT::splitText;
|
||||||
|
using CDATASectionT::throwIfReadOnly;
|
||||||
|
using CDATASectionT::getLength;
|
||||||
|
using CDATASectionT::getOwnerDoc;
|
||||||
|
using CDATASectionT::getParentNode;
|
||||||
|
using CDATASectionT::getNextSibling;
|
||||||
|
using CDATASectionT::cloneNode;
|
||||||
|
using CDATASectionT::ownerDoc_;
|
||||||
|
using CDATASectionT::getData;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CDATASectionImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& data) :
|
CDATASectionImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& data) :
|
||||||
CharacterDataImpl<stringT, string_adaptorT>(ownerDoc, data)
|
CharacterDataImpl<stringT, string_adaptorT>(ownerDoc, data)
|
||||||
|
|
|
@ -11,6 +11,14 @@ template<class stringT, class string_adaptorT>
|
||||||
class CharacterDataImpl : virtual public DOM::CharacterData_impl<stringT>,
|
class CharacterDataImpl : virtual public DOM::CharacterData_impl<stringT>,
|
||||||
public ChildlessNodeImpl<stringT, string_adaptorT>
|
public ChildlessNodeImpl<stringT, string_adaptorT>
|
||||||
{
|
{
|
||||||
|
typedef DOM::CharacterData_impl<stringT> CharDataT;
|
||||||
|
using CharDataT::appendData;
|
||||||
|
using CharDataT::throwIfReadOnly;
|
||||||
|
using CharDataT::insertData;
|
||||||
|
using CharDataT::deleteData;
|
||||||
|
using CharDataT::replaceData;
|
||||||
|
using CharDataT::setNodeValue;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CharacterDataImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& data) :
|
CharacterDataImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& data) :
|
||||||
ChildlessNodeImpl<stringT, string_adaptorT>(ownerDoc),
|
ChildlessNodeImpl<stringT, string_adaptorT>(ownerDoc),
|
||||||
|
|
|
@ -11,6 +11,11 @@ template<class stringT, class string_adaptorT>
|
||||||
class CommentImpl : public DOM::Comment_impl<stringT>,
|
class CommentImpl : public DOM::Comment_impl<stringT>,
|
||||||
public CharacterDataImpl<stringT, string_adaptorT>
|
public CharacterDataImpl<stringT, string_adaptorT>
|
||||||
{
|
{
|
||||||
|
typedef DOM::Comment_impl<stringT> CommentT;
|
||||||
|
using CommentT::ownerDoc_;
|
||||||
|
using CommentT::cloneNode;
|
||||||
|
using CommentT::getData;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CommentImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& data) :
|
CommentImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& data) :
|
||||||
CharacterDataImpl<stringT, string_adaptorT>(ownerDoc, data)
|
CharacterDataImpl<stringT, string_adaptorT>(ownerDoc, data)
|
||||||
|
|
|
@ -10,6 +10,10 @@ template<class stringT, class string_adaptorT>
|
||||||
class DocumentFragmentImpl : public DOM::DocumentFragment_impl<stringT>,
|
class DocumentFragmentImpl : public DOM::DocumentFragment_impl<stringT>,
|
||||||
public NodeImplWithChildren<stringT, string_adaptorT>
|
public NodeImplWithChildren<stringT, string_adaptorT>
|
||||||
{
|
{
|
||||||
|
typedef DOM::DocumentFragment_impl<stringT> DocumentFragmentT;
|
||||||
|
using DocumentFragmentT::ownerDoc_;
|
||||||
|
using DocumentFragmentT::getFirstChild;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DocumentFragmentImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc) :
|
DocumentFragmentImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc) :
|
||||||
DOM::DocumentFragment_impl<stringT>(),
|
DOM::DocumentFragment_impl<stringT>(),
|
||||||
|
|
|
@ -41,6 +41,10 @@ class DocumentImpl : public DOM::Document_impl<stringT>,
|
||||||
{
|
{
|
||||||
typedef NodeImpl<stringT, string_adaptorT> NodeImplT;
|
typedef NodeImpl<stringT, string_adaptorT> NodeImplT;
|
||||||
typedef AttrImpl<stringT, string_adaptorT> AttrImplT;
|
typedef AttrImpl<stringT, string_adaptorT> AttrImplT;
|
||||||
|
typedef DOM::Document_impl<stringT> DocumentImplT;
|
||||||
|
|
||||||
|
using DocumentImplT::node;
|
||||||
|
using DocumentImplT::getFirstChild;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DocumentImpl() :
|
DocumentImpl() :
|
||||||
|
|
|
@ -15,6 +15,10 @@ template<class stringT, class string_adaptorT>
|
||||||
class DocumentTypeImpl : public DOM::DocumentType_impl<stringT>,
|
class DocumentTypeImpl : public DOM::DocumentType_impl<stringT>,
|
||||||
public ChildlessNodeImpl<stringT, string_adaptorT>
|
public ChildlessNodeImpl<stringT, string_adaptorT>
|
||||||
{
|
{
|
||||||
|
typedef DOM::DocumentType_impl<stringT> DocumentTypeT;
|
||||||
|
using DocumentTypeT::addRef;
|
||||||
|
using DocumentTypeT::releaseRef;
|
||||||
|
using DocumentTypeT::ownerDoc_;
|
||||||
public:
|
public:
|
||||||
DocumentTypeImpl(const stringT& qualifiedName,
|
DocumentTypeImpl(const stringT& qualifiedName,
|
||||||
const stringT& publicId,
|
const stringT& publicId,
|
||||||
|
|
|
@ -13,6 +13,12 @@ template<class stringT, class string_adaptorT>
|
||||||
class ElementImpl : public DOM::Element_impl<stringT>,
|
class ElementImpl : public DOM::Element_impl<stringT>,
|
||||||
public NodeImplWithChildren<stringT, string_adaptorT>
|
public NodeImplWithChildren<stringT, string_adaptorT>
|
||||||
{
|
{
|
||||||
|
typedef DOM::Element_impl<stringT> ElementT;
|
||||||
|
using ElementT::getElementsByTagName;
|
||||||
|
using ElementT::ownerDoc_;
|
||||||
|
using ElementT::cloneNode;
|
||||||
|
using ElementT::getFirstChild;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ElementImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& tagName) :
|
ElementImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& tagName) :
|
||||||
DOM::Element_impl<stringT>(),
|
DOM::Element_impl<stringT>(),
|
||||||
|
|
|
@ -11,6 +11,15 @@ template<class stringT, class string_adaptorT>
|
||||||
class ElementNSImpl : public ElementImpl<stringT, string_adaptorT>
|
class ElementNSImpl : public ElementImpl<stringT, string_adaptorT>
|
||||||
{
|
{
|
||||||
typedef typename stringT::size_type size_type;
|
typedef typename stringT::size_type size_type;
|
||||||
|
typedef ElementImpl<stringT, string_adaptorT> ElementImplT;
|
||||||
|
using ElementImplT::cloneNode;
|
||||||
|
using ElementImplT::ownerDoc_;
|
||||||
|
using ElementImplT::tagName_;
|
||||||
|
using ElementImplT::getPrefix;
|
||||||
|
using ElementImplT::setPrefix;
|
||||||
|
using ElementImplT::hasPrefix;
|
||||||
|
using ElementImplT::throwIfReadOnly;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ElementNSImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc,
|
ElementNSImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc,
|
||||||
const stringT& namespaceURI,
|
const stringT& namespaceURI,
|
||||||
|
|
|
@ -11,6 +11,11 @@ template<class stringT, class string_adaptorT>
|
||||||
class EntityImpl : public DOM::Entity_impl<stringT>,
|
class EntityImpl : public DOM::Entity_impl<stringT>,
|
||||||
public NodeImplWithChildren<stringT, string_adaptorT>
|
public NodeImplWithChildren<stringT, string_adaptorT>
|
||||||
{
|
{
|
||||||
|
typedef DOM::Entity_impl<stringT> EntityT;
|
||||||
|
using EntityT::ownerDoc_;
|
||||||
|
using EntityT::getFirstChild;
|
||||||
|
using EntityT::cloneNode;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EntityImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc,
|
EntityImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc,
|
||||||
stringT name,
|
stringT name,
|
||||||
|
|
|
@ -10,6 +10,10 @@ template<class stringT, class string_adaptorT>
|
||||||
class EntityReferenceImpl : public DOM::EntityReference_impl<stringT>,
|
class EntityReferenceImpl : public DOM::EntityReference_impl<stringT>,
|
||||||
public NodeImplWithChildren<stringT, string_adaptorT>
|
public NodeImplWithChildren<stringT, string_adaptorT>
|
||||||
{
|
{
|
||||||
|
typedef DOM::EntityReference_impl<stringT> EntityReferenceT;
|
||||||
|
using EntityReferenceT::ownerDoc_;
|
||||||
|
using EntityReferenceT::readOnly_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EntityReferenceImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT name) :
|
EntityReferenceImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT name) :
|
||||||
DOM::EntityReference_impl<stringT>(),
|
DOM::EntityReference_impl<stringT>(),
|
||||||
|
|
|
@ -11,6 +11,9 @@ template<class stringT, class string_adaptorT>
|
||||||
class NotationImpl : public DOM::Notation_impl<stringT>,
|
class NotationImpl : public DOM::Notation_impl<stringT>,
|
||||||
public NodeImplWithChildren<stringT, string_adaptorT>
|
public NodeImplWithChildren<stringT, string_adaptorT>
|
||||||
{
|
{
|
||||||
|
typedef DOM::Notation_impl<stringT> NotationT;
|
||||||
|
using NotationT::ownerDoc_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
NotationImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc,
|
NotationImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc,
|
||||||
stringT name,
|
stringT name,
|
||||||
|
|
|
@ -11,6 +11,11 @@ template<class stringT, class string_adaptorT>
|
||||||
class ProcessingInstructionImpl : public DOM::ProcessingInstruction_impl<stringT>,
|
class ProcessingInstructionImpl : public DOM::ProcessingInstruction_impl<stringT>,
|
||||||
public ChildlessNodeImpl<stringT, string_adaptorT>
|
public ChildlessNodeImpl<stringT, string_adaptorT>
|
||||||
{
|
{
|
||||||
|
typedef DOM::ProcessingInstruction_impl<stringT> ProcessingInstructionT;
|
||||||
|
using ProcessingInstructionT::setNodeValue;
|
||||||
|
using ProcessingInstructionT::throwIfReadOnly;
|
||||||
|
using ProcessingInstructionT::ownerDoc_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ProcessingInstructionImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc,
|
ProcessingInstructionImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc,
|
||||||
stringT target,
|
stringT target,
|
||||||
|
|
|
@ -11,6 +11,17 @@ template<class stringT, class string_adaptorT>
|
||||||
class TextImpl : public DOM::Text_impl<stringT>,
|
class TextImpl : public DOM::Text_impl<stringT>,
|
||||||
public CharacterDataImpl<stringT, string_adaptorT>
|
public CharacterDataImpl<stringT, string_adaptorT>
|
||||||
{
|
{
|
||||||
|
typedef DOM::Text_impl<stringT> TextT;
|
||||||
|
using TextT::splitText;
|
||||||
|
using TextT::throwIfReadOnly;
|
||||||
|
using TextT::getLength;
|
||||||
|
using TextT::getOwnerDoc;
|
||||||
|
using TextT::getParentNode;
|
||||||
|
using TextT::getNextSibling;
|
||||||
|
using TextT::cloneNode;
|
||||||
|
using TextT::ownerDoc_;
|
||||||
|
using TextT::getData;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TextImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& data) :
|
TextImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& data) :
|
||||||
DOM::Text_impl<stringT>(),
|
DOM::Text_impl<stringT>(),
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
####################################
|
####################################
|
||||||
# ARABICA CONFIG
|
# ARABICA CONFIG
|
||||||
# edit for your parser choice - may include more than one USE_*
|
# edit for your parser choice - may include more than one USE_*
|
||||||
PARSER_CONFIG = -DUSE_LIBXML2
|
PARSER_CONFIG = -DUSE_EXPAT -DARABICA_NO_WCHAR_T
|
||||||
#PARSER_CONFIG = -DUSE_EXPAT -DUSE_LIBXML2 -DUSE_XERCES -DUSE_GARDEN
|
#PARSER_CONFIG = -DUSE_EXPAT -DUSE_LIBXML2 -DUSE_XERCES -DUSE_GARDEN
|
||||||
|
|
||||||
####################################
|
####################################
|
||||||
|
@ -9,13 +9,13 @@ PARSER_CONFIG = -DUSE_LIBXML2
|
||||||
#####
|
#####
|
||||||
MAKE = make
|
MAKE = make
|
||||||
# C++ compiler
|
# C++ compiler
|
||||||
CXX = gcc
|
CXX = /home/jez/gcc-3.4.2/bin/gcc
|
||||||
# preprocessor
|
# preprocessor
|
||||||
CPP = gcc -E
|
CPP = /home/jez/gcc-3.4.2/bin/gcc -E
|
||||||
# linker
|
# linker
|
||||||
LD = gcc
|
LD = /home/jez/gcc-3.4.2/bin/gcc
|
||||||
# archiver
|
# archiver
|
||||||
AR = ar r
|
AR = /home/jez/gcc-3.4.2/bin/ar r
|
||||||
|
|
||||||
###########
|
###########
|
||||||
# Utilities
|
# Utilities
|
||||||
|
@ -33,18 +33,17 @@ CXXFLAGS = -Wall
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
|
|
||||||
# Includes and library directories
|
# Includes and library directories
|
||||||
INCS_DIRS = -I.. -I/usr/include/libxml2
|
INCS_DIRS = -I.. -I/home/jez/gcc-3.4.2/include
|
||||||
LIBS_DIRS =
|
LIBS_DIRS = -I/home/jez/gcc-3.4.2/lib
|
||||||
|
|
||||||
# OSX includes libxml2
|
|
||||||
STATIC_LIBS =
|
STATIC_LIBS =
|
||||||
DYNAMIC_LIBS = -lxml2 -lstdc++
|
DYNAMIC_LIBS = -lexpat -lstdc++
|
||||||
|
|
||||||
# link flag to create a shared library
|
# link flag to create a shared library
|
||||||
LINK_SHARED = -dynamiclib
|
LINK_SHARED = -shared
|
||||||
|
|
||||||
EXESUFFIX =
|
EXESUFFIX = .exe
|
||||||
LIBSUFFIX = .dylib
|
LIBSUFFIX = .dll
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,14 +26,20 @@ class basic_Writer : public basic_XMLFilterImpl<string_type>,
|
||||||
typedef std::basic_ostream<charT, traitsT> ostreamT;
|
typedef std::basic_ostream<charT, traitsT> ostreamT;
|
||||||
typedef basic_XMLReader<stringT> XMLReaderT;
|
typedef basic_XMLReader<stringT> XMLReaderT;
|
||||||
typedef basic_XMLFilterImpl<stringT> XMLFilterT;
|
typedef basic_XMLFilterImpl<stringT> XMLFilterT;
|
||||||
|
typedef SAX::basic_DeclHandler<stringT> declHandlerT;
|
||||||
|
typedef SAX::basic_LexicalHandler<stringT> lexicalHandlerT;
|
||||||
typedef typename basic_XMLFilterImpl<stringT>::AttributesT AttributesT;
|
typedef typename basic_XMLFilterImpl<stringT>::AttributesT AttributesT;
|
||||||
typedef Arabica::Unicode<charT> UnicodeT;
|
typedef Arabica::Unicode<charT> UnicodeT;
|
||||||
private:
|
private:
|
||||||
typedef basic_LexicalHandler<stringT> LexicalHandlerT;
|
typedef basic_LexicalHandler<stringT> LexicalHandlerT;
|
||||||
typedef basic_DeclHandler<stringT> DeclHandlerT;
|
typedef basic_DeclHandler<stringT> DeclHandlerT;
|
||||||
typedef typename XMLReaderT::InputSourceT InputSourceT;
|
typedef typename XMLReaderT::InputSourceT InputSourceT;
|
||||||
typedef typename XMLReaderT::PropertyBase PropertyBase;
|
typedef typename XMLReaderT::PropertyBase PropertyBaseT;
|
||||||
|
typedef typename XMLReaderT::template Property<lexicalHandlerT*> getLexicalHandlerT;
|
||||||
|
typedef typename XMLReaderT::template Property<lexicalHandlerT&> setLexicalHandlerT;
|
||||||
|
typedef typename XMLReaderT::template Property<declHandlerT*> getDeclHandlerT;
|
||||||
|
typedef typename XMLReaderT::template Property<declHandlerT&> setDeclHandlerT;
|
||||||
|
using XMLFilterT::getParent;
|
||||||
public:
|
public:
|
||||||
basic_Writer(ostreamT& stream, unsigned int indent = 2) :
|
basic_Writer(ostreamT& stream, unsigned int indent = 2) :
|
||||||
inCDATA_(false),
|
inCDATA_(false),
|
||||||
|
@ -66,8 +72,8 @@ class basic_Writer : public basic_XMLFilterImpl<string_type>,
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Parser
|
// Parser
|
||||||
virtual std::auto_ptr<PropertyBase> doGetProperty(const stringT& name);
|
virtual std::auto_ptr<PropertyBaseT> doGetProperty(const stringT& name);
|
||||||
virtual void doSetProperty(const stringT& name, std::auto_ptr<PropertyBase> value);
|
virtual void doSetProperty(const stringT& name, std::auto_ptr<PropertyBaseT> value);
|
||||||
|
|
||||||
// ContentHandler
|
// ContentHandler
|
||||||
virtual void startDocument();
|
virtual void startDocument();
|
||||||
|
@ -352,23 +358,21 @@ bool basic_Writer<string_type>::isDtd(const string_type& name)
|
||||||
|
|
||||||
#ifndef ARABICA_VS6_WORKAROUND
|
#ifndef ARABICA_VS6_WORKAROUND
|
||||||
template<class string_type>
|
template<class string_type>
|
||||||
std::auto_ptr<typename basic_Writer<string_type>::PropertyBase> basic_Writer<string_type>::doGetProperty(const string_type& name)
|
std::auto_ptr<typename basic_Writer<string_type>::PropertyBaseT> basic_Writer<string_type>::doGetProperty(const string_type& name)
|
||||||
#else
|
#else
|
||||||
template<class string_type>
|
template<class string_type>
|
||||||
std::auto_ptr<basic_Writer<string_type>::PropertyBase> basic_Writer<string_type>::doGetProperty(const string_type& name)
|
std::auto_ptr<basic_Writer<string_type>::PropertyBaseT> basic_Writer<string_type>::doGetProperty(const string_type& name)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if(name == properties_.lexicalHandler)
|
if(name == properties_.lexicalHandler)
|
||||||
{
|
{
|
||||||
XMLReaderT::Property<LexicalHandlerT*>* prop =
|
getLexicalHandlerT* prop = new getLexicalHandlerT(lexicalHandler_);
|
||||||
new XMLReaderT::Property<LexicalHandlerT*>(lexicalHandler_);
|
return std::auto_ptr<PropertyBaseT>(prop);
|
||||||
return std::auto_ptr<PropertyBase>(prop);
|
|
||||||
}
|
}
|
||||||
if(name == properties_.declHandler)
|
if(name == properties_.declHandler)
|
||||||
{
|
{
|
||||||
XMLReaderT::Property<DeclHandlerT*>* prop =
|
getDeclHandlerT* prop = new getDeclHandlerT(declHandler_);
|
||||||
new XMLReaderT::Property<DeclHandlerT*>(declHandler_);
|
return std::auto_ptr<PropertyBaseT>(prop);
|
||||||
return std::auto_ptr<PropertyBase>(prop);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return XMLFilterT::doGetProperty(name);
|
return XMLFilterT::doGetProperty(name);
|
||||||
|
@ -376,26 +380,24 @@ std::auto_ptr<basic_Writer<string_type>::PropertyBase> basic_Writer<string_type>
|
||||||
|
|
||||||
#ifndef ARABICA_VS6_WORKAROUND
|
#ifndef ARABICA_VS6_WORKAROUND
|
||||||
template<class string_type>
|
template<class string_type>
|
||||||
void basic_Writer<string_type>::doSetProperty(const string_type& name, std::auto_ptr<typename basic_Writer<string_type>::PropertyBase> value)
|
void basic_Writer<string_type>::doSetProperty(const string_type& name, std::auto_ptr<typename basic_Writer<string_type>::PropertyBaseT> value)
|
||||||
#else
|
#else
|
||||||
template<class string_type>
|
template<class string_type>
|
||||||
void basic_Writer<string_type>::doSetProperty(const string_type& name, std::auto_ptr<basic_Writer<string_type>::PropertyBase> value)
|
void basic_Writer<string_type>::doSetProperty(const string_type& name, std::auto_ptr<basic_Writer<string_type>::PropertyBaseT> value)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if(name == properties_.lexicalHandler)
|
if(name == properties_.lexicalHandler)
|
||||||
{
|
{
|
||||||
XMLReaderT::Property<LexicalHandlerT&>* prop =
|
setLexicalHandlerT* prop = dynamic_cast<setLexicalHandlerT*>(value.get());
|
||||||
dynamic_cast<XMLReaderT::Property<LexicalHandlerT&>*>(value.get());
|
|
||||||
|
|
||||||
if(!prop)
|
if(!prop)
|
||||||
throw std::bad_cast();
|
throw std::bad_cast();
|
||||||
|
|
||||||
lexicalHandler_ = &(prop->get());
|
lexicalHandler_ = &(prop->get());
|
||||||
}
|
}
|
||||||
if(name == properties_.declHandler)
|
else if(name == properties_.declHandler)
|
||||||
{
|
{
|
||||||
XMLReaderT::Property<DeclHandlerT&>* prop =
|
setDeclHandlerT* prop = dynamic_cast<setDeclHandlerT*>(value.get());
|
||||||
dynamic_cast<XMLReaderT::Property<DeclHandlerT&>*>(value.get());
|
|
||||||
|
|
||||||
if(!prop)
|
if(!prop)
|
||||||
throw std::bad_cast();
|
throw std::bad_cast();
|
||||||
|
|
|
@ -211,7 +211,12 @@ class expat_wrapper : public SAX::basic_XMLReader<string_type>,
|
||||||
typedef SAX::basic_NamespaceSupport<stringT, string_adaptorT> namespaceSupportT;
|
typedef SAX::basic_NamespaceSupport<stringT, string_adaptorT> namespaceSupportT;
|
||||||
typedef SAX::basic_ErrorHandler<stringT> errorHandlerT;
|
typedef SAX::basic_ErrorHandler<stringT> errorHandlerT;
|
||||||
typedef SAX::basic_SAXParseException<stringT> SAXParseExceptionT;
|
typedef SAX::basic_SAXParseException<stringT> SAXParseExceptionT;
|
||||||
typedef typename SAX::basic_XMLReader<stringT>::PropertyBase PropertyBaseT;
|
typedef SAX::basic_XMLReader<stringT> XMLReaderT;
|
||||||
|
typedef typename XMLReaderT::PropertyBase PropertyBaseT;
|
||||||
|
typedef typename XMLReaderT::template Property<lexicalHandlerT*> getLexicalHandlerT;
|
||||||
|
typedef typename XMLReaderT::template Property<lexicalHandlerT&> setLexicalHandlerT;
|
||||||
|
typedef typename XMLReaderT::template Property<declHandlerT*> getDeclHandlerT;
|
||||||
|
typedef typename XMLReaderT::template Property<declHandlerT&> setDeclHandlerT;
|
||||||
|
|
||||||
expat_wrapper();
|
expat_wrapper();
|
||||||
virtual ~expat_wrapper();
|
virtual ~expat_wrapper();
|
||||||
|
@ -490,17 +495,15 @@ std::auto_ptr<expat_wrapper<stringT, string_adaptorT>::PropertyBaseT> expat_wrap
|
||||||
{
|
{
|
||||||
if(name == properties_.lexicalHandler)
|
if(name == properties_.lexicalHandler)
|
||||||
{
|
{
|
||||||
SAX::basic_XMLReader<stringT>::Property<lexicalHandlerT*>* prop =
|
getLexicalHandlerT* prop = new getLexicalHandlerT(lexicalHandler_);
|
||||||
new SAX::basic_XMLReader<stringT>::Property<lexicalHandlerT*>(lexicalHandler_);
|
|
||||||
return std::auto_ptr<PropertyBaseT>(prop);
|
return std::auto_ptr<PropertyBaseT>(prop);
|
||||||
}
|
}
|
||||||
else if(name == properties_.declHandler)
|
if(name == properties_.declHandler)
|
||||||
{
|
{
|
||||||
SAX::basic_XMLReader<stringT>::Property<declHandlerT*>* prop =
|
getDeclHandlerT* prop = new getDeclHandlerT(declHandler_);
|
||||||
new SAX::basic_XMLReader<stringT>::Property<declHandlerT*>(declHandler_);
|
|
||||||
return std::auto_ptr<PropertyBaseT>(prop);
|
return std::auto_ptr<PropertyBaseT>(prop);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
throw SAX::SAXNotRecognizedException(std::string("Property not recognized ") + SA_.asStdString(name));
|
throw SAX::SAXNotRecognizedException(std::string("Property not recognized ") + SA_.asStdString(name));
|
||||||
} // doGetProperty
|
} // doGetProperty
|
||||||
|
|
||||||
|
@ -509,8 +512,7 @@ void expat_wrapper<stringT, string_adaptorT>::doSetProperty(const stringT& name,
|
||||||
{
|
{
|
||||||
if(name == properties_.lexicalHandler)
|
if(name == properties_.lexicalHandler)
|
||||||
{
|
{
|
||||||
SAX::basic_XMLReader<stringT>::Property<lexicalHandlerT&>* prop =
|
setLexicalHandlerT* prop = dynamic_cast<setLexicalHandlerT*>(value.get());
|
||||||
dynamic_cast<SAX::basic_XMLReader<stringT>::Property<lexicalHandlerT&>*>(value.get());
|
|
||||||
|
|
||||||
if(!prop)
|
if(!prop)
|
||||||
throw std::bad_cast();
|
throw std::bad_cast();
|
||||||
|
@ -519,8 +521,7 @@ void expat_wrapper<stringT, string_adaptorT>::doSetProperty(const stringT& name,
|
||||||
}
|
}
|
||||||
else if(name == properties_.declHandler)
|
else if(name == properties_.declHandler)
|
||||||
{
|
{
|
||||||
SAX::basic_XMLReader<stringT>::Property<declHandlerT&>* prop =
|
setDeclHandlerT* prop = dynamic_cast<setDeclHandlerT*>(value.get());
|
||||||
dynamic_cast<SAX::basic_XMLReader<stringT>::Property<declHandlerT&>*>(value.get());
|
|
||||||
|
|
||||||
if(!prop)
|
if(!prop)
|
||||||
throw std::bad_cast();
|
throw std::bad_cast();
|
||||||
|
|
Loading…
Add table
Reference in a new issue