From e323dd894806f223761396d6e5a317b1a96e71b7 Mon Sep 17 00:00:00 2001 From: complement <> Date: Sat, 23 Nov 2002 20:03:54 +0000 Subject: [PATCH] fix typename problem --- DOM/SAX2DOM/DocumentTypeImpl.h | 2 +- DOM/SAX2DOM/SAX2DOM.h | 6 +++--- DOM/Simple/AttrImpl.h | 4 ++-- DOM/Simple/DocumentFragmentImpl.h | 2 +- DOM/Simple/DocumentImpl.h | 14 ++++++------- DOM/Simple/DocumentTypeImpl.h | 2 +- DOM/Simple/ElementImpl.h | 2 +- DOM/Simple/EntityImpl.h | 6 +++--- DOM/Simple/EntityReferenceImpl.h | 2 +- DOM/Simple/Helpers.h | 2 +- DOM/Simple/NamedNodeMapImpl.h | 14 ++++++------- DOM/Simple/NodeImpl.h | 8 ++++---- DOM/Simple/NotationImpl.h | 2 +- Utils/convertstream.h | 34 +++++++++++++++---------------- Utils/socket_stream.h | 16 ++++++++++----- XML/XMLCharacterClasses.h | 2 +- 16 files changed, 61 insertions(+), 57 deletions(-) diff --git a/DOM/SAX2DOM/DocumentTypeImpl.h b/DOM/SAX2DOM/DocumentTypeImpl.h index 7fb00dff..2170ef46 100644 --- a/DOM/SAX2DOM/DocumentTypeImpl.h +++ b/DOM/SAX2DOM/DocumentTypeImpl.h @@ -55,4 +55,4 @@ class DocumentType : public SimpleDOM::DocumentTypeImpl //////////////////////////////////////////////////// // ErrorHandler - virtual void warning(const SAX::SAXException& e) + virtual void warning(const SAX::SAXParseException& e) { if(errorHandler_) errorHandler_->warning(e); } // warning - virtual void error(const SAX::SAXException& e) + virtual void error(const SAX::SAXParseException& e) { if(errorHandler_) errorHandler_->error(e); reset(); } // error - virtual void fatalError(const SAX::SAXException& e) + virtual void fatalError(const SAX::SAXParseException& e) { if(errorHandler_) errorHandler_->fatalError(e); diff --git a/DOM/Simple/AttrImpl.h b/DOM/Simple/AttrImpl.h index d49817a8..8dc8b1b0 100644 --- a/DOM/Simple/AttrImpl.h +++ b/DOM/Simple/AttrImpl.h @@ -56,7 +56,7 @@ class AttrImpl : public DOM::Attr_impl, ///////////////////////////////////////////////////// // DOM::Node methods - virtual DOM::Node::Type getNodeType() const + virtual typename DOM::Node::Type getNodeType() const { return DOM::Node::ATTRIBUTE_NODE; } // getNodeType @@ -129,7 +129,7 @@ class AttrImpl : public DOM::Attr_impl, private: virtual void checkChildType(DOM::Node_impl* child) { - DOM::Node::Type type = child->getNodeType(); + typename DOM::Node::Type type = child->getNodeType(); if((type != DOM::Node::TEXT_NODE) && (type != DOM::Node::ENTITY_REFERENCE_NODE)) throw DOM::DOMException(DOM::DOMException::HIERARCHY_REQUEST_ERR); diff --git a/DOM/Simple/DocumentFragmentImpl.h b/DOM/Simple/DocumentFragmentImpl.h index ad158c1b..8243404d 100644 --- a/DOM/Simple/DocumentFragmentImpl.h +++ b/DOM/Simple/DocumentFragmentImpl.h @@ -49,7 +49,7 @@ class DocumentFragmentImpl : public DOM::DocumentFragment_impl, private: virtual void checkChildType(DOM::Node_impl* child) { - DOM::Node::Type type = child->getNodeType(); + typename DOM::Node::Type type = child->getNodeType(); if((type != DOM::Node::ELEMENT_NODE) && (type != DOM::Node::PROCESSING_INSTRUCTION_NODE) && (type != DOM::Node::COMMENT_NODE) && diff --git a/DOM/Simple/DocumentImpl.h b/DOM/Simple/DocumentImpl.h index 6e853d6a..77c8c78a 100644 --- a/DOM/Simple/DocumentImpl.h +++ b/DOM/Simple/DocumentImpl.h @@ -94,7 +94,7 @@ class DocumentImpl : public DOM::Document_impl, virtual ~DocumentImpl() { - for(std::set::iterator n = orphans_.begin(); n != orphans_.end(); ++n) + for(typename std::set::iterator n = orphans_.begin(); n != orphans_.end(); ++n) delete *n; } // ~DocumentImpl @@ -316,7 +316,7 @@ class DocumentImpl : public DOM::Document_impl, virtual DOM::Element_impl* getElementById(const stringT& elementId) const { - std::set::const_iterator i = std::find_if(idNodes_.begin(), idNodes_.end(), valueIs(elementId)); + typename std::set::const_iterator i = std::find_if(idNodes_.begin(), idNodes_.end(), valueIs(elementId)); if(i == idNodes_.end()) return 0; return (*i)->getOwnerElement(); @@ -324,7 +324,7 @@ class DocumentImpl : public DOM::Document_impl, //////////////////////////////////////////////////////// // DOM Node methods - virtual DOM::Node::Type getNodeType() const + virtual typename DOM::Node::Type getNodeType() const { return DOM::Node::DOCUMENT_NODE; } // getNodeType @@ -422,7 +422,7 @@ class DocumentImpl : public DOM::Document_impl, } // orphaned void adopted(NodeImplT* node) { - std::set::iterator n = orphans_.find(node); + typename std::set::iterator n = orphans_.find(node); if(n != orphans_.end()) orphans_.erase(n); } // adopted @@ -433,15 +433,15 @@ class DocumentImpl : public DOM::Document_impl, } // setElementId void removeElementId(AttrImplT* attr) { - std::set::iterator n = idNodes_.find(node); + typename std::set::iterator n = idNodes_.find(node); if(n != idNodes_.end()) idNodes_.erase(n); } // removeElementId private: - virtual void checkChildType(DOM::Node_impl* child) + virtual void checkChildType(typename DOM::Node_impl* child) { - DOM::Node::Type type = child->getNodeType(); + typename DOM::Node::Type type = child->getNodeType(); if((type != DOM::Node::ELEMENT_NODE) && (type != DOM::Node::PROCESSING_INSTRUCTION_NODE) && (type != DOM::Node::COMMENT_NODE) && diff --git a/DOM/Simple/DocumentTypeImpl.h b/DOM/Simple/DocumentTypeImpl.h index e81e78c9..8a9d2ad4 100644 --- a/DOM/Simple/DocumentTypeImpl.h +++ b/DOM/Simple/DocumentTypeImpl.h @@ -87,7 +87,7 @@ class DocumentTypeImpl : public DOM::DocumentType_impl, ////////////////////////////////////////////////////////// // DOM::Node methods - DOM::Node::Type getNodeType() const + typename DOM::Node::Type getNodeType() const { return DOM::Node::DOCUMENT_TYPE_NODE; } // getNodeType diff --git a/DOM/Simple/ElementImpl.h b/DOM/Simple/ElementImpl.h index 657e9ae1..d1aa71ad 100644 --- a/DOM/Simple/ElementImpl.h +++ b/DOM/Simple/ElementImpl.h @@ -175,7 +175,7 @@ class ElementImpl : public DOM::Element_impl, private: virtual void checkChildType(DOM::Node_impl* child) { - DOM::Node::Type type = child->getNodeType(); + typename DOM::Node::Type type = child->getNodeType(); if((type != DOM::Node::ELEMENT_NODE) && (type != DOM::Node::TEXT_NODE) && (type != DOM::Node::COMMENT_NODE) && diff --git a/DOM/Simple/EntityImpl.h b/DOM/Simple/EntityImpl.h index b6192156..a8551933 100644 --- a/DOM/Simple/EntityImpl.h +++ b/DOM/Simple/EntityImpl.h @@ -36,7 +36,7 @@ class EntityImpl : public DOM::Entity_impl, /////////////////////////////////////////////////////// // DOM::Node methods - virtual DOM::Node::Type getNodeType() const + virtual typename DOM::Node::Type getNodeType() const { return DOM::Node::ENTITY_NODE; } // getNodeType @@ -46,7 +46,7 @@ class EntityImpl : public DOM::Entity_impl, return name_; } // getNodeName - virtual DOM::Node_impl* cloneNode(bool deep) const + virtual typename DOM::Node_impl* cloneNode(bool deep) const { EntityImpl* clone = new EntityImpl(ownerDoc_, name_, publicId_, systemId_, notationName_); if(deep) @@ -64,7 +64,7 @@ class EntityImpl : public DOM::Entity_impl, /////////////////////////////////////////////// virtual void checkChildType(DOM::Node_impl* child) { - DOM::Node::Type type = child->getNodeType(); + typename DOM::Node::Type type = child->getNodeType(); if((type != DOM::Node::ELEMENT_NODE) && (type != DOM::Node::PROCESSING_INSTRUCTION_NODE) && (type != DOM::Node::COMMENT_NODE) && diff --git a/DOM/Simple/EntityReferenceImpl.h b/DOM/Simple/EntityReferenceImpl.h index f8efe989..695b7503 100644 --- a/DOM/Simple/EntityReferenceImpl.h +++ b/DOM/Simple/EntityReferenceImpl.h @@ -50,7 +50,7 @@ class EntityReferenceImpl : public DOM::EntityReference_impl, if(readOnly_) throw DOM::DOMException(DOM::DOMException::NO_MODIFICATION_ALLOWED_ERR); - DOM::Node::Type type = child->getNodeType(); + typename DOM::Node::Type type = child->getNodeType(); if((type != DOM::Node::ELEMENT_NODE) && (type != DOM::Node::PROCESSING_INSTRUCTION_NODE) && (type != DOM::Node::COMMENT_NODE) && diff --git a/DOM/Simple/Helpers.h b/DOM/Simple/Helpers.h index 3496fbeb..29b1213d 100644 --- a/DOM/Simple/Helpers.h +++ b/DOM/Simple/Helpers.h @@ -12,7 +12,7 @@ std::pair checkPrefixAndNamespace(bool hasPrefix, const stringT& prefix, bool hasNamespaceURI, const stringT& namespaceURI, - DOM::Node::Type nodeType) + typename DOM::Node::Type nodeType) { string_adaptorT SA; const stringT xml = SA.makeStringT("xml"); diff --git a/DOM/Simple/NamedNodeMapImpl.h b/DOM/Simple/NamedNodeMapImpl.h index dacf3be0..02a39983 100644 --- a/DOM/Simple/NamedNodeMapImpl.h +++ b/DOM/Simple/NamedNodeMapImpl.h @@ -69,7 +69,7 @@ class NamedNodeMapImpl : public DOM::NamedNodeMap_impl virtual ~NamedNodeMapImpl() { - for(NodeListT::iterator i = nodes_.begin(); i != nodes_.end(); ++i) + for(typename NodeListT::iterator i = nodes_.begin(); i != nodes_.end(); ++i) delete (*i); } // ~NodeImpl @@ -88,7 +88,7 @@ class NamedNodeMapImpl : public DOM::NamedNodeMap_impl virtual void setOwnerDoc(DocumentImpl* ownerDoc) { ownerDoc_ = ownerDoc; - for(NodeListT::iterator i = nodes_.begin(); i != nodes_.end(); ++i) + for(typename NodeListT::iterator i = nodes_.begin(); i != nodes_.end(); ++i) (*i)->setOwnerDoc(ownerDoc); } // setOwnerDoc @@ -162,14 +162,14 @@ class NamedNodeMapImpl : public DOM::NamedNodeMap_impl typedef std::deque*> NodeListT; - NodeImpl* getNode(NodeListT::const_iterator n) const + NodeImpl* getNode(typename NodeListT::const_iterator n) const { if(n == nodes_.end()) return 0; return *n; } // getNode - NodeImpl* setNode(NodeListT::iterator n, NodeImpl* arg) + NodeImpl* setNode(typename NodeListT::iterator n, NodeImpl* arg) { if(n == nodes_.end()) { @@ -183,7 +183,7 @@ class NamedNodeMapImpl : public DOM::NamedNodeMap_impl return removedNode; } // setNode - NodeImpl* removeNode(NodeListT::iterator n) + NodeImpl* removeNode(typename NodeListT::iterator n) { if(n == nodes_.end()) return 0; @@ -193,12 +193,12 @@ class NamedNodeMapImpl : public DOM::NamedNodeMap_impl return removedNode; } // removeNode - NodeListT::iterator findByName(const stringT& name) + typename NodeListT::iterator findByName(const stringT& name) { return std::find_if(nodes_.begin(), nodes_.end(), nameIs(name)); } // findByName - NodeListT::iterator findByNamespaceAndName(const stringT& namespaceURI, const stringT& localName) + typename NodeListT::iterator findByNamespaceAndName(const stringT& namespaceURI, const stringT& localName) { return std::find_if(nodes_.begin(), nodes_.end(), namespaceAndNameIs(namespaceURI, localName)); } // findByName diff --git a/DOM/Simple/NodeImpl.h b/DOM/Simple/NodeImpl.h index 21cfdfce..9205365b 100644 --- a/DOM/Simple/NodeImpl.h +++ b/DOM/Simple/NodeImpl.h @@ -244,7 +244,7 @@ class NodeImplWithChildren : public NodeImpl, virtual ~NodeImplWithChildren() { - for(NodeListT::iterator i = nodes_.begin(); i != nodes_.end(); ++i) + for(typename NodeListT::iterator i = nodes_.begin(); i != nodes_.end(); ++i) delete (*i); } // ~NodeImpl @@ -380,7 +380,7 @@ class NodeImplWithChildren : public NodeImpl, } // if ... checkCanAdd(newChild); - std::deque*>::iterator result = findChild(oldChild); + typename std::deque*>::iterator result = findChild(oldChild); removeIfRequired(newChild); *result = newChild; newChild->setParentNode(this); @@ -434,9 +434,9 @@ class NodeImplWithChildren : public NodeImpl, private: typedef std::deque*> NodeListT; - NodeListT::iterator findChild(NodeImpl* refChild) + typename NodeListT::iterator findChild(NodeImpl* refChild) { - NodeListT::iterator result = std::find(nodes_.begin(), nodes_.end(), refChild); + typename NodeListT::iterator result = std::find(nodes_.begin(), nodes_.end(), refChild); if(result == nodes_.end()) throw DOM::DOMException(DOM::DOMException::NOT_FOUND_ERR); return result; diff --git a/DOM/Simple/NotationImpl.h b/DOM/Simple/NotationImpl.h index aa423c03..54de4efb 100644 --- a/DOM/Simple/NotationImpl.h +++ b/DOM/Simple/NotationImpl.h @@ -33,7 +33,7 @@ class NotationImpl : public DOM::Notation_impl, /////////////////////////////////////////////////////// // DOM::Node methods - virtual DOM::Node::Type getNodeType() const + virtual typename DOM::Node::Type getNodeType() const { return DOM::Node::NOTATION_NODE; } // getNodeType diff --git a/Utils/convertstream.h b/Utils/convertstream.h index 303d56f1..02385906 100644 --- a/Utils/convertstream.h +++ b/Utils/convertstream.h @@ -55,15 +55,14 @@ public: typedef std::basic_string stringT; typedef std::basic_string fromStringT; - explicit basic_iconvertstream(ios_base::openmode mode = in) - : std::basic_istream(0), stringbuf_(mode | in) - { - istreamT::rdbuf(&stringbuf_); - } + explicit basic_iconvertstream(ios_base::openmode mode = in) : + std::basic_istream( 0 ), + stringbuf_(mode | in) + { std::basic_ios::init( &stringbuf_ ); } explicit basic_iconvertstream(const stringT& str, ios_base::openmode mode = in) : std::basic_istream(0), stringbuf_(mode | in) { - istreamT::rdbuf(&stringbuf_); + std::basic_ios::init( &stringbuf_ ); // istreamT::rdbuf(&stringbuf_); str(str); } virtual ~basic_iconvertstream() @@ -132,7 +131,7 @@ private: std::copy(str.begin(), str.end(), std::back_inserter(dest)); #else // hack around pre-Standard library - for(fromStringT::const_iterator i = str.begin(); i != str.end(); ++i) + for(typename fromStringT::const_iterator i = str.begin(); i != str.end(); ++i) dest += static_cast(*i); #endif return dest; @@ -153,16 +152,15 @@ public: typedef std::basic_string stringT; typedef std::basic_string toStringT; - explicit basic_oconvertstream(ios_base::openmode mode = out) - : std::basic_ostream(0), stringbuf_(mode | out) - { - ostreamT::rdbuf(&stringbuf_); - } - explicit basic_oconvertstream(const stringT& str, ios_base::openmode mode = out) - : std::basic_ostream(0), stringbuf_(str, mode | out) - { - ostreamT::rdbuf(&stringbuf_); - } + explicit basic_oconvertstream(ios_base::openmode mode = out) : + std::basic_ostream( 0 ), + stringbuf_(mode | out) + { std::basic_ios::init( &stringbuf_ ); } + explicit basic_oconvertstream(const stringT& str, ios_base::openmode mode = out) : + std::basic_ostream( 0 ), + stringbuf_(str, mode | out) + { std::basic_ios::init( &stringbuf_ ); } + virtual ~basic_oconvertstream() {} @@ -234,7 +232,7 @@ private: #ifndef _MSC_VER std::copy(str.begin(), str.end(), std::back_inserter(dest)); #else - for(stringT::const_iterator i = str.begin(); i != str.end(); ++i) + for(typename stringT::const_iterator i = str.begin(); i != str.end(); ++i) dest += static_cast(*i); #endif return dest; diff --git a/Utils/socket_stream.h b/Utils/socket_stream.h index 5ee6301f..d1f2ed78 100644 --- a/Utils/socket_stream.h +++ b/Utils/socket_stream.h @@ -47,6 +47,10 @@ #include #include +#ifndef INADDR_NONE +# define INADDR_NONE ((in_addr_t) -1) +#endif + /////////////////////////////////////////////////////////// // basic_socketbuf declaration template @@ -198,7 +202,7 @@ basic_socketbuf* basic_socketbuf::close() } // close; template -basic_socketbuf::int_type basic_socketbuf::overflow(basic_socketbuf::int_type c) +typename basic_socketbuf::int_type basic_socketbuf::overflow(typename basic_socketbuf::int_type c) { if(traitsT::eq_int_type(traitsT::eof(), c)) return traitsT::not_eof(c); @@ -218,7 +222,7 @@ int basic_socketbuf::sync() } // sync template -basic_socketbuf::int_type basic_socketbuf::underflow() +typename basic_socketbuf::int_type basic_socketbuf::underflow() { if(!is_open()) return traitsT::eof(); @@ -233,7 +237,7 @@ basic_socketbuf::int_type basic_socketbuf::under } // underflow template -basic_socketbuf::int_type basic_socketbuf::pbackfail(int_type c) +typename basic_socketbuf::int_type basic_socketbuf::pbackfail(int_type c) { if(gptr() == eback()) return traitsT::eof(); @@ -434,14 +438,16 @@ typedef basic_socketstream > wsocketstream; // basic_socketstream definition template basic_socketstream::basic_socketstream() : - std::basic_iostream(&sockbuf) + std::basic_iostream( 0 ) { + std::basic_ios::init( &sockbuf ); } // basic_socketstream template basic_socketstream::basic_socketstream(const char* hostname, int port) : - std::basic_iostream(&sockbuf) + std::basic_iostream( 0 ) { + std::basic_ios::init( &sockbuf ); open(hostname, port); } // basic_socketstream diff --git a/XML/XMLCharacterClasses.h b/XML/XMLCharacterClasses.h index f4c3350b..22adc71e 100644 --- a/XML/XMLCharacterClasses.h +++ b/XML/XMLCharacterClasses.h @@ -18,4 +18,4 @@ namespace XML bool is_extender(wchar_t c); }; // namespace XML -#endif \ No newline at end of file +#endif