built through with expat, libxml2, xerces, and garden

This commit is contained in:
jez 2007-09-05 13:54:04 +00:00
parent a76b137b60
commit 635707cdde
2 changed files with 38 additions and 33 deletions

View file

@ -45,6 +45,34 @@ public:
typedef string_type stringT; typedef string_type stringT;
typedef Attributes<stringT> AttributesT; typedef Attributes<stringT> 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. // Constructors.
AttributesImpl() { } AttributesImpl() { }
@ -275,7 +303,7 @@ public:
* *
* @param atts The attributes to copy. * @param atts The attributes to copy.
*/ */
void setAttributes(const Attributes& atts) void setAttributes(const AttributesT& atts)
{ {
clear(); clear();
@ -314,6 +342,11 @@ public:
attributes_.push_back(Attr(uri, localName, qName, type, value)); attributes_.push_back(Attr(uri, localName, qName, type, value));
} // addAttribute } // addAttribute
void addAttribute(const Attr& attr)
{
attributes_.push_back(attr);
} // addAttribute
/** /**
* Add an attribute to the end of the list. * Add an attribute to the end of the list.
* *
@ -500,34 +533,6 @@ private:
throw std::out_of_range(msg); 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 class AttributeNamed
{ {
public: public:

View file

@ -289,12 +289,12 @@ class xerces_wrapper : public SAX::ProgressiveParser<string_type>
} // construct_from_XMLByte } // construct_from_XMLByte
static std::auto_ptr<XERCES_CPP_NAMESPACE::XMLTranscoder> transcoder_; static std::auto_ptr<XERCES_CPP_NAMESPACE::XMLTranscoder> transcoder_;
static kickoff() static void kickoff()
{ {
XERCES_CPP_NAMESPACE::XMLTransService::Codes res; 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)); 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); transcoder_.reset(0);
} // shutdown } // shutdown
@ -837,7 +837,7 @@ class xerces_wrapper : public SAX::ProgressiveParser<string_type>
InputSourceT inputSource_; InputSourceT inputSource_;
}; // class InputSourceAdaptor }; // class InputSourceAdaptor
class XercesXMLPScanToken : public ::SAX::XMLPScanTokenParserImpl class XercesXMLPScanToken : public SAX::XMLPScanTokenParserImpl
{ {
public: public:
XERCES_CPP_NAMESPACE::XMLPScanToken token_; XERCES_CPP_NAMESPACE::XMLPScanToken token_;
@ -853,7 +853,7 @@ class xerces_wrapper : public SAX::ProgressiveParser<string_type>
ErrorHandlerAdaptor errorHandlerAdaptor_; ErrorHandlerAdaptor errorHandlerAdaptor_;
LexicalHandlerAdaptor lexicalHandlerAdaptor_; LexicalHandlerAdaptor lexicalHandlerAdaptor_;
DeclHandlerAdaptor declHandlerAdaptor_; DeclHandlerAdaptor declHandlerAdaptor_;
SAX::XercesPropertyNames<string_type, string_adaptorT> properties_; Arabica::SAX::XercesPropertyNames<string_type, string_adaptorT> properties_;
// Property values to return by reference // Property values to return by reference
string_type externalSchemaLocation_; string_type externalSchemaLocation_;