From 635707cdde58765a665ddd43cabd958e7f8b62a4 Mon Sep 17 00:00:00 2001 From: jez <> Date: Wed, 5 Sep 2007 13:54:04 +0000 Subject: [PATCH] built through with expat, libxml2, xerces, and garden --- include/SAX/helpers/AttributesImpl.hpp | 63 ++++++++++++++------------ include/SAX/wrappers/saxxerces.hpp | 8 ++-- 2 files changed, 38 insertions(+), 33 deletions(-) diff --git a/include/SAX/helpers/AttributesImpl.hpp b/include/SAX/helpers/AttributesImpl.hpp index 8e16c96c..30dd4e29 100644 --- a/include/SAX/helpers/AttributesImpl.hpp +++ b/include/SAX/helpers/AttributesImpl.hpp @@ -45,6 +45,34 @@ public: typedef string_type stringT; typedef Attributes AttributesT; + struct Attr + { + Attr(const stringT& uri, + const stringT& localName, + const stringT& qName, + const stringT& type, + const stringT& value) : + uri_(uri), localName_(localName), qName_(qName), type_(type), value_(value) + { } + Attr() { } + Attr& operator=(const Attr& rhs) + { + uri_ = rhs.uri_; + localName_ = rhs.localName_; + qName_ = rhs.qName_; + type_ = rhs.type_; + value_ = rhs.value_; + + return *this; + } // operator= + + stringT uri_; + stringT localName_; + stringT qName_; + stringT type_; + stringT value_; + }; // Attr + //////////////////////////////////////////////////////////////////// // Constructors. AttributesImpl() { } @@ -275,7 +303,7 @@ public: * * @param atts The attributes to copy. */ - void setAttributes(const Attributes& atts) + void setAttributes(const AttributesT& atts) { clear(); @@ -314,6 +342,11 @@ public: attributes_.push_back(Attr(uri, localName, qName, type, value)); } // addAttribute + void addAttribute(const Attr& attr) + { + attributes_.push_back(attr); + } // addAttribute + /** * Add an attribute to the end of the list. * @@ -500,34 +533,6 @@ private: throw std::out_of_range(msg); } - struct Attr - { - Attr(const stringT& uri, - const stringT& localName, - const stringT& qName, - const stringT& type, - const stringT& value) : - uri_(uri), localName_(localName), qName_(qName), type_(type), value_(value) - { } - Attr() { } - Attr& operator=(const Attr& rhs) - { - uri_ = rhs.uri_; - localName_ = rhs.localName_; - qName_ = rhs.qName_; - type_ = rhs.type_; - value_ = rhs.value_; - - return *this; - } // operator= - - stringT uri_; - stringT localName_; - stringT qName_; - stringT type_; - stringT value_; - }; // Attr - class AttributeNamed { public: diff --git a/include/SAX/wrappers/saxxerces.hpp b/include/SAX/wrappers/saxxerces.hpp index 4f15ffd6..1b9b749c 100644 --- a/include/SAX/wrappers/saxxerces.hpp +++ b/include/SAX/wrappers/saxxerces.hpp @@ -289,12 +289,12 @@ class xerces_wrapper : public SAX::ProgressiveParser } // construct_from_XMLByte static std::auto_ptr transcoder_; - static kickoff() + static void kickoff() { XERCES_CPP_NAMESPACE::XMLTransService::Codes res; transcoder_.reset(XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgTransService->makeNewTranscoderFor(XERCES_CPP_NAMESPACE::XMLRecognizer::UTF_8, res, 4096, XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgMemoryManager)); } - static shutdown() + static void shutdown() { transcoder_.reset(0); } // shutdown @@ -837,7 +837,7 @@ class xerces_wrapper : public SAX::ProgressiveParser InputSourceT inputSource_; }; // class InputSourceAdaptor - class XercesXMLPScanToken : public ::SAX::XMLPScanTokenParserImpl + class XercesXMLPScanToken : public SAX::XMLPScanTokenParserImpl { public: XERCES_CPP_NAMESPACE::XMLPScanToken token_; @@ -853,7 +853,7 @@ class xerces_wrapper : public SAX::ProgressiveParser ErrorHandlerAdaptor errorHandlerAdaptor_; LexicalHandlerAdaptor lexicalHandlerAdaptor_; DeclHandlerAdaptor declHandlerAdaptor_; - SAX::XercesPropertyNames properties_; + Arabica::SAX::XercesPropertyNames properties_; // Property values to return by reference string_type externalSchemaLocation_;