Updating to build with gcc 3.4.2

This commit is contained in:
jez_higgins 2004-09-14 20:51:36 +00:00
parent 7d0d6d8cd5
commit 7fc5cea45e
23 changed files with 193 additions and 81 deletions

View file

@ -18,6 +18,7 @@ template<class stringT> class Attr_impl;
template<class stringT>
class Attr : public Node<stringT>
{
using Node<stringT>::impl_;
public:
Attr() : Node<stringT>() { }
explicit Attr(Attr_impl<stringT>* impl) : Node<stringT>(impl) { }

View file

@ -17,6 +17,8 @@ template<class stringT> class Entity_impl;
template<class stringT>
class Entity : public Node<stringT>
{
using Node<stringT>::impl;
public:
Entity() : Node<stringT>() { }
explicit Entity(Entity_impl<stringT>* impl) : Node<stringT>(impl) { }

View file

@ -18,6 +18,8 @@ template<class stringT> class Notation_impl;
template<class stringT>
class Notation : public Node<stringT>
{
using Node<stringT>::impl;
public:
Notation() : Node<stringT>() { }
explicit Notation(Notation_impl<stringT>* impl) : Node<stringT>(dynamic_cast<Node_impl<stringT>*>(impl)) { }

View file

@ -10,6 +10,10 @@ template<class stringT, class string_adaptorT>
class DocumentType : public SimpleDOM::DocumentTypeImpl<stringT, string_adaptorT>
{
typedef SimpleDOM::DocumentTypeImpl<stringT, string_adaptorT> BaseDT;
using BaseDT::ownerDoc_;
using BaseDT::getElements;
using BaseDT::addDefaultAttr;
public:
DocumentType(const stringT& qualifiedName,
const stringT& publicId,

View file

@ -15,6 +15,14 @@ template<class stringT, class string_adaptorT>
class AttrImpl : public DOM::Attr_impl<stringT>,
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:
AttrImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& name) :
DOM::Attr_impl<stringT>(),

View file

@ -11,6 +11,12 @@ namespace SimpleDOM
template<class stringT, class 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:
AttrMap(DocumentImpl<stringT, string_adaptorT>* ownerDoc) :
NamedNodeMapImpl<stringT, string_adaptorT>(ownerDoc),

View file

@ -11,6 +11,14 @@ template<class stringT, class string_adaptorT>
class AttrNSImpl : public AttrImpl<stringT, string_adaptorT>
{
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:
AttrNSImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc,

View file

@ -10,6 +10,17 @@ template<class stringT, class string_adaptorT>
class CDATASectionImpl : public DOM::CDATASection_impl<stringT>,
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:
CDATASectionImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& data) :
CharacterDataImpl<stringT, string_adaptorT>(ownerDoc, data)

View file

@ -11,6 +11,14 @@ template<class stringT, class string_adaptorT>
class CharacterDataImpl : virtual public DOM::CharacterData_impl<stringT>,
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:
CharacterDataImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& data) :
ChildlessNodeImpl<stringT, string_adaptorT>(ownerDoc),

View file

@ -11,6 +11,11 @@ template<class stringT, class string_adaptorT>
class CommentImpl : public DOM::Comment_impl<stringT>,
public CharacterDataImpl<stringT, string_adaptorT>
{
typedef DOM::Comment_impl<stringT> CommentT;
using CommentT::ownerDoc_;
using CommentT::cloneNode;
using CommentT::getData;
public:
CommentImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& data) :
CharacterDataImpl<stringT, string_adaptorT>(ownerDoc, data)

View file

@ -10,6 +10,10 @@ template<class stringT, class string_adaptorT>
class DocumentFragmentImpl : public DOM::DocumentFragment_impl<stringT>,
public NodeImplWithChildren<stringT, string_adaptorT>
{
typedef DOM::DocumentFragment_impl<stringT> DocumentFragmentT;
using DocumentFragmentT::ownerDoc_;
using DocumentFragmentT::getFirstChild;
public:
DocumentFragmentImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc) :
DOM::DocumentFragment_impl<stringT>(),

View file

@ -41,6 +41,10 @@ class DocumentImpl : public DOM::Document_impl<stringT>,
{
typedef NodeImpl<stringT, string_adaptorT> NodeImplT;
typedef AttrImpl<stringT, string_adaptorT> AttrImplT;
typedef DOM::Document_impl<stringT> DocumentImplT;
using DocumentImplT::node;
using DocumentImplT::getFirstChild;
public:
DocumentImpl() :

View file

@ -15,6 +15,10 @@ template<class stringT, class string_adaptorT>
class DocumentTypeImpl : public DOM::DocumentType_impl<stringT>,
public ChildlessNodeImpl<stringT, string_adaptorT>
{
typedef DOM::DocumentType_impl<stringT> DocumentTypeT;
using DocumentTypeT::addRef;
using DocumentTypeT::releaseRef;
using DocumentTypeT::ownerDoc_;
public:
DocumentTypeImpl(const stringT& qualifiedName,
const stringT& publicId,

View file

@ -13,6 +13,12 @@ template<class stringT, class string_adaptorT>
class ElementImpl : public DOM::Element_impl<stringT>,
public NodeImplWithChildren<stringT, string_adaptorT>
{
typedef DOM::Element_impl<stringT> ElementT;
using ElementT::getElementsByTagName;
using ElementT::ownerDoc_;
using ElementT::cloneNode;
using ElementT::getFirstChild;
public:
ElementImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& tagName) :
DOM::Element_impl<stringT>(),

View file

@ -11,6 +11,15 @@ template<class stringT, class string_adaptorT>
class ElementNSImpl : public ElementImpl<stringT, string_adaptorT>
{
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:
ElementNSImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc,
const stringT& namespaceURI,

View file

@ -11,6 +11,11 @@ template<class stringT, class string_adaptorT>
class EntityImpl : public DOM::Entity_impl<stringT>,
public NodeImplWithChildren<stringT, string_adaptorT>
{
typedef DOM::Entity_impl<stringT> EntityT;
using EntityT::ownerDoc_;
using EntityT::getFirstChild;
using EntityT::cloneNode;
public:
EntityImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc,
stringT name,

View file

@ -10,6 +10,10 @@ template<class stringT, class string_adaptorT>
class EntityReferenceImpl : public DOM::EntityReference_impl<stringT>,
public NodeImplWithChildren<stringT, string_adaptorT>
{
typedef DOM::EntityReference_impl<stringT> EntityReferenceT;
using EntityReferenceT::ownerDoc_;
using EntityReferenceT::readOnly_;
public:
EntityReferenceImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT name) :
DOM::EntityReference_impl<stringT>(),

View file

@ -11,6 +11,9 @@ template<class stringT, class string_adaptorT>
class NotationImpl : public DOM::Notation_impl<stringT>,
public NodeImplWithChildren<stringT, string_adaptorT>
{
typedef DOM::Notation_impl<stringT> NotationT;
using NotationT::ownerDoc_;
public:
NotationImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc,
stringT name,

View file

@ -11,6 +11,11 @@ template<class stringT, class string_adaptorT>
class ProcessingInstructionImpl : public DOM::ProcessingInstruction_impl<stringT>,
public ChildlessNodeImpl<stringT, string_adaptorT>
{
typedef DOM::ProcessingInstruction_impl<stringT> ProcessingInstructionT;
using ProcessingInstructionT::setNodeValue;
using ProcessingInstructionT::throwIfReadOnly;
using ProcessingInstructionT::ownerDoc_;
public:
ProcessingInstructionImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc,
stringT target,

View file

@ -11,6 +11,17 @@ template<class stringT, class string_adaptorT>
class TextImpl : public DOM::Text_impl<stringT>,
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:
TextImpl(DocumentImpl<stringT, string_adaptorT>* ownerDoc, const stringT& data) :
DOM::Text_impl<stringT>(),

View file

@ -1,7 +1,7 @@
####################################
# ARABICA CONFIG
# 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
####################################
@ -9,13 +9,13 @@ PARSER_CONFIG = -DUSE_LIBXML2
#####
MAKE = make
# C++ compiler
CXX = gcc
CXX = /home/jez/gcc-3.4.2/bin/gcc
# preprocessor
CPP = gcc -E
CPP = /home/jez/gcc-3.4.2/bin/gcc -E
# linker
LD = gcc
LD = /home/jez/gcc-3.4.2/bin/gcc
# archiver
AR = ar r
AR = /home/jez/gcc-3.4.2/bin/ar r
###########
# Utilities
@ -33,18 +33,17 @@ CXXFLAGS = -Wall
LDFLAGS =
# Includes and library directories
INCS_DIRS = -I.. -I/usr/include/libxml2
LIBS_DIRS =
INCS_DIRS = -I.. -I/home/jez/gcc-3.4.2/include
LIBS_DIRS = -I/home/jez/gcc-3.4.2/lib
# OSX includes libxml2
STATIC_LIBS =
DYNAMIC_LIBS = -lxml2 -lstdc++
DYNAMIC_LIBS = -lexpat -lstdc++
# link flag to create a shared library
LINK_SHARED = -dynamiclib
LINK_SHARED = -shared
EXESUFFIX =
LIBSUFFIX = .dylib
EXESUFFIX = .exe
LIBSUFFIX = .dll

View file

@ -26,14 +26,20 @@ class basic_Writer : public basic_XMLFilterImpl<string_type>,
typedef std::basic_ostream<charT, traitsT> ostreamT;
typedef basic_XMLReader<stringT> XMLReaderT;
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 Arabica::Unicode<charT> UnicodeT;
private:
typedef basic_LexicalHandler<stringT> LexicalHandlerT;
typedef basic_DeclHandler<stringT> DeclHandlerT;
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:
basic_Writer(ostreamT& stream, unsigned int indent = 2) :
inCDATA_(false),
@ -66,8 +72,8 @@ class basic_Writer : public basic_XMLFilterImpl<string_type>,
protected:
// Parser
virtual std::auto_ptr<PropertyBase> doGetProperty(const stringT& name);
virtual void doSetProperty(const stringT& name, std::auto_ptr<PropertyBase> value);
virtual std::auto_ptr<PropertyBaseT> doGetProperty(const stringT& name);
virtual void doSetProperty(const stringT& name, std::auto_ptr<PropertyBaseT> value);
// ContentHandler
virtual void startDocument();
@ -352,23 +358,21 @@ bool basic_Writer<string_type>::isDtd(const string_type& name)
#ifndef ARABICA_VS6_WORKAROUND
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
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
{
if(name == properties_.lexicalHandler)
{
XMLReaderT::Property<LexicalHandlerT*>* prop =
new XMLReaderT::Property<LexicalHandlerT*>(lexicalHandler_);
return std::auto_ptr<PropertyBase>(prop);
getLexicalHandlerT* prop = new getLexicalHandlerT(lexicalHandler_);
return std::auto_ptr<PropertyBaseT>(prop);
}
if(name == properties_.declHandler)
{
XMLReaderT::Property<DeclHandlerT*>* prop =
new XMLReaderT::Property<DeclHandlerT*>(declHandler_);
return std::auto_ptr<PropertyBase>(prop);
getDeclHandlerT* prop = new getDeclHandlerT(declHandler_);
return std::auto_ptr<PropertyBaseT>(prop);
}
return XMLFilterT::doGetProperty(name);
@ -376,26 +380,24 @@ std::auto_ptr<basic_Writer<string_type>::PropertyBase> basic_Writer<string_type>
#ifndef ARABICA_VS6_WORKAROUND
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
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
{
if(name == properties_.lexicalHandler)
{
XMLReaderT::Property<LexicalHandlerT&>* prop =
dynamic_cast<XMLReaderT::Property<LexicalHandlerT&>*>(value.get());
setLexicalHandlerT* prop = dynamic_cast<setLexicalHandlerT*>(value.get());
if(!prop)
throw std::bad_cast();
lexicalHandler_ = &(prop->get());
}
if(name == properties_.declHandler)
else if(name == properties_.declHandler)
{
XMLReaderT::Property<DeclHandlerT&>* prop =
dynamic_cast<XMLReaderT::Property<DeclHandlerT&>*>(value.get());
setDeclHandlerT* prop = dynamic_cast<setDeclHandlerT*>(value.get());
if(!prop)
throw std::bad_cast();

View file

@ -211,7 +211,12 @@ class expat_wrapper : public SAX::basic_XMLReader<string_type>,
typedef SAX::basic_NamespaceSupport<stringT, string_adaptorT> namespaceSupportT;
typedef SAX::basic_ErrorHandler<stringT> errorHandlerT;
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();
virtual ~expat_wrapper();
@ -490,17 +495,15 @@ std::auto_ptr<expat_wrapper<stringT, string_adaptorT>::PropertyBaseT> expat_wrap
{
if(name == properties_.lexicalHandler)
{
SAX::basic_XMLReader<stringT>::Property<lexicalHandlerT*>* prop =
new SAX::basic_XMLReader<stringT>::Property<lexicalHandlerT*>(lexicalHandler_);
getLexicalHandlerT* prop = new getLexicalHandlerT(lexicalHandler_);
return std::auto_ptr<PropertyBaseT>(prop);
}
else if(name == properties_.declHandler)
if(name == properties_.declHandler)
{
SAX::basic_XMLReader<stringT>::Property<declHandlerT*>* prop =
new SAX::basic_XMLReader<stringT>::Property<declHandlerT*>(declHandler_);
getDeclHandlerT* prop = new getDeclHandlerT(declHandler_);
return std::auto_ptr<PropertyBaseT>(prop);
}
else
throw SAX::SAXNotRecognizedException(std::string("Property not recognized ") + SA_.asStdString(name));
} // doGetProperty
@ -509,8 +512,7 @@ void expat_wrapper<stringT, string_adaptorT>::doSetProperty(const stringT& name,
{
if(name == properties_.lexicalHandler)
{
SAX::basic_XMLReader<stringT>::Property<lexicalHandlerT&>* prop =
dynamic_cast<SAX::basic_XMLReader<stringT>::Property<lexicalHandlerT&>*>(value.get());
setLexicalHandlerT* prop = dynamic_cast<setLexicalHandlerT*>(value.get());
if(!prop)
throw std::bad_cast();
@ -519,8 +521,7 @@ void expat_wrapper<stringT, string_adaptorT>::doSetProperty(const stringT& name,
}
else if(name == properties_.declHandler)
{
SAX::basic_XMLReader<stringT>::Property<declHandlerT&>* prop =
dynamic_cast<SAX::basic_XMLReader<stringT>::Property<declHandlerT&>*>(value.get());
setDeclHandlerT* prop = dynamic_cast<setDeclHandlerT*>(value.get());
if(!prop)
throw std::bad_cast();