aboutsummaryrefslogtreecommitdiff
path: root/libxsd
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-11-13 07:46:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-11-13 07:46:45 +0200
commitf2ec36ab5fa04e11dee655d9c623baac95db1eba (patch)
treef1f51bc34e749ca1f97e2e722a334fc599c8a124 /libxsd
parent6e9a647a859d9a95c96e75c77beaf41b166cc4e4 (diff)
Drop support for Xerces-C++ 2-series
Diffstat (limited to 'libxsd')
-rw-r--r--libxsd/xsd/cxx/parser/xerces/elements.hxx11
-rw-r--r--libxsd/xsd/cxx/parser/xerces/elements.txx32
-rw-r--r--libxsd/xsd/cxx/tree/elements.hxx6
-rw-r--r--libxsd/xsd/cxx/tree/types.txx65
-rw-r--r--libxsd/xsd/cxx/xml/dom/bits/error-handler-proxy.txx12
-rw-r--r--libxsd/xsd/cxx/xml/dom/parsing-source.txx139
-rw-r--r--libxsd/xsd/cxx/xml/dom/serialization-header.txx6
-rw-r--r--libxsd/xsd/cxx/xml/dom/serialization-source.hxx4
-rw-r--r--libxsd/xsd/cxx/xml/dom/serialization-source.txx42
-rw-r--r--libxsd/xsd/cxx/xml/elements.hxx5
-rw-r--r--libxsd/xsd/cxx/xml/sax/bits/error-handler-proxy.txx11
-rw-r--r--libxsd/xsd/cxx/xml/sax/std-input-source.hxx29
-rw-r--r--libxsd/xsd/cxx/xml/std-memory-manager.hxx6
13 files changed, 33 insertions, 335 deletions
diff --git a/libxsd/xsd/cxx/parser/xerces/elements.hxx b/libxsd/xsd/cxx/parser/xerces/elements.hxx
index aa21a0b..5fe3688 100644
--- a/libxsd/xsd/cxx/parser/xerces/elements.hxx
+++ b/libxsd/xsd/cxx/parser/xerces/elements.hxx
@@ -16,6 +16,8 @@
#include <xercesc/sax2/SAX2XMLReader.hpp>
#include <xercesc/sax2/DefaultHandler.hpp>
+#include <xercesc/util/XercesVersion.hpp>
+
#include <xsd/cxx/xml/elements.hxx>
#include <xsd/cxx/xml/error-handler.hxx>
@@ -23,6 +25,10 @@
#include <xsd/cxx/parser/elements.hxx>
#include <xsd/cxx/parser/document.hxx>
+#if _XERCES_VERSION < 30000
+# error Xerces-C++ 2-series is not supported
+#endif
+
namespace xsd
{
namespace cxx
@@ -403,13 +409,8 @@ namespace xsd
const XMLCh* const lname,
const XMLCh* const qname);
-#if _XERCES_VERSION >= 30000
virtual void
characters (const XMLCh* const s, const XMLSize_t length);
-#else
- virtual void
- characters (const XMLCh* const s, const unsigned int length);
-#endif
virtual void
startPrefixMapping (const XMLCh* const prefix,
diff --git a/libxsd/xsd/cxx/parser/xerces/elements.txx b/libxsd/xsd/cxx/parser/xerces/elements.txx
index 6ea728c..bc7f1e5 100644
--- a/libxsd/xsd/cxx/parser/xerces/elements.txx
+++ b/libxsd/xsd/cxx/parser/xerces/elements.txx
@@ -528,14 +528,8 @@ namespace xsd
xml::string (e.message ()).c_str (),
id.c_str (),
id.c_str (),
-#if _XERCES_VERSION >= 30000
static_cast<XMLFileLoc> (e.line ()),
- static_cast<XMLFileLoc> (e.column ())
-#else
- static_cast<XMLSSize_t> (e.line ()),
- static_cast<XMLSSize_t> (e.column ())
-#endif
- );
+ static_cast<XMLFileLoc> (e.column ()));
eh.fatalError (se);
}
@@ -566,14 +560,8 @@ namespace xsd
xml::string (e.message ()).c_str (),
id.c_str (),
id.c_str (),
-#if _XERCES_VERSION >= 30000
static_cast<XMLFileLoc> (e.line ()),
- static_cast<XMLFileLoc> (e.column ())
-#else
- static_cast<XMLSSize_t> (e.line ()),
- static_cast<XMLSSize_t> (e.column ())
-#endif
- );
+ static_cast<XMLFileLoc> (e.column ()));
eh.fatalError (se);
}
@@ -796,11 +784,7 @@ namespace xsd
}
}
-#if _XERCES_VERSION >= 30000
for (XMLSize_t i (0), end (attributes.getLength()); i < end; ++i)
-#else
- for (unsigned int i (0), end (attributes.getLength()); i < end; ++i)
-#endif
{
const XMLCh* xns (attributes.getURI (i));
@@ -882,11 +866,7 @@ namespace xsd
template <typename C>
void event_router<C>::
-#if _XERCES_VERSION >= 30000
characters (const XMLCh* const s, const XMLSize_t n)
-#else
- characters (const XMLCh* const s, const unsigned int n)
-#endif
{
typedef std::basic_string<C> string;
@@ -963,16 +943,8 @@ namespace xsd
if (id != 0)
e.id (xml::transcode<C> (id));
-#if _XERCES_VERSION >= 30000
e.line (static_cast<unsigned long> (loc_->getLineNumber ()));
e.column (static_cast<unsigned long> (loc_->getColumnNumber ()));
-#else
- XMLSSize_t l (loc_->getLineNumber ());
- XMLSSize_t c (loc_->getColumnNumber ());
-
- e.line (l == -1 ? 0 : static_cast<unsigned long> (l));
- e.column (c == -1 ? 0: static_cast<unsigned long> (c));
-#endif
}
}
}
diff --git a/libxsd/xsd/cxx/tree/elements.hxx b/libxsd/xsd/cxx/tree/elements.hxx
index 40c3e01..040284f 100644
--- a/libxsd/xsd/cxx/tree/elements.hxx
+++ b/libxsd/xsd/cxx/tree/elements.hxx
@@ -30,6 +30,8 @@
#include <xercesc/dom/DOMDocument.hpp>
#include <xercesc/dom/DOMNamedNodeMap.hpp>
+#include <xercesc/util/XercesVersion.hpp>
+
#include <xsd/cxx/xml/elements.hxx> // xml::properties
#include <xsd/cxx/xml/dom/auto-ptr.hxx> // dom::auto_ptr
@@ -37,6 +39,10 @@
#include <xsd/cxx/tree/exceptions.hxx>
#include <xsd/cxx/tree/istream-fwd.hxx>
+#if _XERCES_VERSION < 30000
+# error Xerces-C++ 2-series is not supported
+#endif
+
namespace xsd
{
namespace cxx
diff --git a/libxsd/xsd/cxx/tree/types.txx b/libxsd/xsd/cxx/tree/types.txx
index 1a59ed3..be893af 100644
--- a/libxsd/xsd/cxx/tree/types.txx
+++ b/libxsd/xsd/cxx/tree/types.txx
@@ -5,7 +5,6 @@
#include <xercesc/util/Base64.hpp>
#include <xercesc/util/XMLString.hpp>
-#include <xercesc/util/XercesVersion.hpp>
#include <xsd/cxx/auto-array.hxx>
@@ -335,7 +334,6 @@ namespace xsd
using xercesc::Base64;
std::basic_string<C> str;
-#if _XERCES_VERSION >= 30000
XMLSize_t n;
xml::std_memory_manager mm;
@@ -359,31 +357,6 @@ namespace xsd
{
//@@ throw
}
-#else
- unsigned int n;
-
- xml::std_memory_manager mm;
- auto_array<XMLByte, xml::std_memory_manager> r (
- Base64::encode (
- reinterpret_cast<const XMLByte*> (this->data ()),
- static_cast<unsigned int> (this->size ()),
- &n,
- &mm),
- mm);
-
- if (r)
- {
- str.reserve (n + 1);
- str.resize (n);
-
- for (unsigned int i (0); i < n; ++i)
- str[i] = C (r[i]);
- }
- else
- {
- //@@ throw
- }
-#endif
return str;
}
@@ -397,23 +370,11 @@ namespace xsd
using xercesc::Base64;
xml::std_memory_manager mm;
-
- // Xerces 2.6.0 and earlier do not have decodeToXMLByte which
- // makes my life harder and your code slower.
- //
-#if _XERCES_VERSION >= 20700
-
-#if _XERCES_VERSION >= 30000
XMLSize_t size;
+
auto_array<XMLByte, xml::std_memory_manager> data (
Base64::decodeToXMLByte (src, &size, &mm, Base64::Conf_RFC2045),
mm);
-#else
- unsigned int size;
- auto_array<XMLByte, xml::std_memory_manager> data (
- Base64::decodeToXMLByte (src, &size, &mm, Base64::Conf_RFC2045),
- mm);
-#endif // _XERCES_VERSION >= 30000
if (data)
{
@@ -425,30 +386,6 @@ namespace xsd
{
//@@ throw
}
-#else
- unsigned int size;
-
-#if _XERCES_VERSION >= 20600 // Xerces 2.5.0 does not have Conf_RFC2045.
- auto_array<XMLCh, xml::std_memory_manager> data (
- Base64::decode (src, &size, &mm, Base64::Conf_RFC2045),
- mm);
-#else
- auto_array<XMLCh, xml::std_memory_manager> data (
- Base64::decode (src, &size, &mm), mm);
-#endif // _XERCES_VERSION >= 20600
-
- if (data)
- {
- buffer<C> tmp (size);
- for (unsigned int i (0); i < size; ++i)
- tmp.data ()[i] = static_cast<char> (data[i]);
- this->swap (tmp); // g++ 4.1 likes it qualified, not sure why.
- }
- else
- {
- //@@ throw
- }
-#endif //_XERCES_VERSION >= 20700
}
diff --git a/libxsd/xsd/cxx/xml/dom/bits/error-handler-proxy.txx b/libxsd/xsd/cxx/xml/dom/bits/error-handler-proxy.txx
index 109c0e7..d5dff65 100644
--- a/libxsd/xsd/cxx/xml/dom/bits/error-handler-proxy.txx
+++ b/libxsd/xsd/cxx/xml/dom/bits/error-handler-proxy.txx
@@ -53,24 +53,12 @@ namespace xsd
xercesc::DOMLocator* loc (e.getLocation ());
-#if _XERCES_VERSION >= 30000
return eh_->handle (
transcode<C> (loc->getURI ()),
static_cast<unsigned long> (loc->getLineNumber ()),
static_cast<unsigned long> (loc->getColumnNumber ()),
s,
transcode<C> (e.getMessage ()));
-#else
- XMLSSize_t l (loc->getLineNumber ());
- XMLSSize_t c (loc->getColumnNumber ());
-
- return eh_->handle (
- transcode<C> (loc->getURI ()),
- (l == -1 ? 0 : static_cast<unsigned long> (l)),
- (c == -1 ? 0 : static_cast<unsigned long> (c)),
- s,
- transcode<C> (e.getMessage ()));
-#endif
}
}
}
diff --git a/libxsd/xsd/cxx/xml/dom/parsing-source.txx b/libxsd/xsd/cxx/xml/dom/parsing-source.txx
index 545eb82..cde2179 100644
--- a/libxsd/xsd/cxx/xml/dom/parsing-source.txx
+++ b/libxsd/xsd/cxx/xml/dom/parsing-source.txx
@@ -3,12 +3,9 @@
// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
-#if _XERCES_VERSION >= 30000
-# include <xercesc/dom/DOMLSParser.hpp>
-# include <xercesc/dom/DOMLSException.hpp>
-#else
-# include <xercesc/dom/DOMBuilder.hpp>
-#endif
+#include <xercesc/dom/DOMLSParser.hpp>
+#include <xercesc/dom/DOMLSException.hpp>
+
#include <xercesc/dom/DOMNamedNodeMap.hpp>
#include <xercesc/dom/DOMImplementation.hpp>
#include <xercesc/dom/DOMImplementationRegistry.hpp>
@@ -94,12 +91,8 @@ namespace xsd
using xercesc::DOMImplementationLS;
using xercesc::DOMImplementation;
using xercesc::DOMDocument;
-#if _XERCES_VERSION >= 30000
using xercesc::DOMLSParser;
using xercesc::DOMConfiguration;
-#else
- using xercesc::DOMBuilder;
-#endif
using xercesc::Wrapper4InputSource;
using xercesc::XMLUni;
@@ -116,7 +109,6 @@ namespace xsd
DOMImplementation* impl (
DOMImplementationRegistry::getDOMImplementation (ls_id));
-#if _XERCES_VERSION >= 30000
auto_ptr<DOMLSParser> parser (
impl->createLSParser (DOMImplementationLS::MODE_SYNCHRONOUS, 0));
@@ -163,7 +155,6 @@ namespace xsd
if (!(flags & no_muliple_imports))
conf->setParameter (XMLUni::fgXercesHandleMultipleImports, true);
#endif
-
// This feature checks the schema grammar for additional
// errors. We most likely do not need it when validating
// instances (assuming the schema is valid).
@@ -214,64 +205,9 @@ namespace xsd
bits::error_handler_proxy<C> ehp (eh);
conf->setParameter (XMLUni::fgDOMErrorHandler, &ehp);
-#else // _XERCES_VERSION >= 30000
-
- // Same as above but for Xerces-C++ 2 series.
- //
- auto_ptr<DOMBuilder> parser (
- impl->createDOMBuilder (DOMImplementationLS::MODE_SYNCHRONOUS, 0));
-
- parser->setFeature (XMLUni::fgDOMComments, false);
- parser->setFeature (XMLUni::fgDOMDatatypeNormalization, true);
- parser->setFeature (XMLUni::fgDOMEntities, false);
- parser->setFeature (XMLUni::fgDOMNamespaces, true);
- parser->setFeature (XMLUni::fgDOMWhitespaceInElementContent, false);
-
- if (flags & dont_validate)
- {
- parser->setFeature (XMLUni::fgDOMValidation, false);
- parser->setFeature (XMLUni::fgXercesSchema, false);
- parser->setFeature (XMLUni::fgXercesSchemaFullChecking, false);
- }
- else
- {
- parser->setFeature (XMLUni::fgDOMValidation, true);
- parser->setFeature (XMLUni::fgXercesSchema, true);
- parser->setFeature (XMLUni::fgXercesSchemaFullChecking, false);
- }
-
- parser->setFeature (XMLUni::fgXercesUserAdoptsDOMDocument, true);
-
- if (!prop.schema_location ().empty ())
- {
- xml::string sl (prop.schema_location ());
- const void* v (sl.c_str ());
-
- parser->setProperty (
- XMLUni::fgXercesSchemaExternalSchemaLocation,
- const_cast<void*> (v));
- }
-
- if (!prop.no_namespace_schema_location ().empty ())
- {
- xml::string sl (prop.no_namespace_schema_location ());
- const void* v (sl.c_str ());
-
- parser->setProperty (
- XMLUni::fgXercesSchemaExternalNoNameSpaceSchemaLocation,
- const_cast<void*> (v));
- }
-
- bits::error_handler_proxy<C> ehp (eh);
- parser->setErrorHandler (&ehp);
-
-#endif // _XERCES_VERSION >= 30000
-
xercesc::Wrapper4InputSource wrap (&is, false);
-#if _XERCES_VERSION >= 30000
auto_ptr<DOMDocument> doc;
-
try
{
doc.reset (parser->parse (&wrap));
@@ -279,9 +215,7 @@ namespace xsd
catch (const xercesc::DOMLSException&)
{
}
-#else
- auto_ptr<DOMDocument> doc (parser->parse (wrap));
-#endif
+
if (ehp.failed ())
doc.reset ();
@@ -312,12 +246,8 @@ namespace xsd
using xercesc::DOMImplementationLS;
using xercesc::DOMImplementation;
using xercesc::DOMDocument;
-#if _XERCES_VERSION >= 30000
using xercesc::DOMLSParser;
using xercesc::DOMConfiguration;
-#else
- using xercesc::DOMBuilder;
-#endif
using xercesc::XMLUni;
@@ -332,7 +262,6 @@ namespace xsd
DOMImplementation* impl (
DOMImplementationRegistry::getDOMImplementation (ls_id));
-#if _XERCES_VERSION >= 30000
auto_ptr<DOMLSParser> parser (
impl->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0));
@@ -430,63 +359,7 @@ namespace xsd
bits::error_handler_proxy<C> ehp (eh);
conf->setParameter (XMLUni::fgDOMErrorHandler, &ehp);
-#else // _XERCES_VERSION >= 30000
-
- // Same as above but for Xerces-C++ 2 series.
- //
- auto_ptr<DOMBuilder> parser (
- impl->createDOMBuilder(DOMImplementationLS::MODE_SYNCHRONOUS, 0));
-
- parser->setFeature (XMLUni::fgDOMComments, false);
- parser->setFeature (XMLUni::fgDOMDatatypeNormalization, true);
- parser->setFeature (XMLUni::fgDOMEntities, false);
- parser->setFeature (XMLUni::fgDOMNamespaces, true);
- parser->setFeature (XMLUni::fgDOMWhitespaceInElementContent, false);
-
- if (flags & dont_validate)
- {
- parser->setFeature (XMLUni::fgDOMValidation, false);
- parser->setFeature (XMLUni::fgXercesSchema, false);
- parser->setFeature (XMLUni::fgXercesSchemaFullChecking, false);
- }
- else
- {
- parser->setFeature (XMLUni::fgDOMValidation, true);
- parser->setFeature (XMLUni::fgXercesSchema, true);
- parser->setFeature (XMLUni::fgXercesSchemaFullChecking, false);
- }
-
- parser->setFeature (XMLUni::fgXercesUserAdoptsDOMDocument, true);
-
- if (!prop.schema_location ().empty ())
- {
- xml::string sl (prop.schema_location ());
- const void* v (sl.c_str ());
-
- parser->setProperty (
- XMLUni::fgXercesSchemaExternalSchemaLocation,
- const_cast<void*> (v));
- }
-
- if (!prop.no_namespace_schema_location ().empty ())
- {
- xml::string sl (prop.no_namespace_schema_location ());
- const void* v (sl.c_str ());
-
- parser->setProperty (
- XMLUni::fgXercesSchemaExternalNoNameSpaceSchemaLocation,
- const_cast<void*> (v));
- }
-
- bits::error_handler_proxy<C> ehp (eh);
- parser->setErrorHandler (&ehp);
-
-#endif // _XERCES_VERSION >= 30000
-
-
-#if _XERCES_VERSION >= 30000
auto_ptr<DOMDocument> doc;
-
try
{
doc.reset (parser->parseURI (string (uri).c_str ()));
@@ -494,10 +367,6 @@ namespace xsd
catch (const xercesc::DOMLSException&)
{
}
-#else
- auto_ptr<DOMDocument> doc (
- parser->parseURI (string (uri).c_str ()));
-#endif
if (ehp.failed ())
doc.reset ();
diff --git a/libxsd/xsd/cxx/xml/dom/serialization-header.txx b/libxsd/xsd/cxx/xml/dom/serialization-header.txx
index 567581a..cce3c52 100644
--- a/libxsd/xsd/cxx/xml/dom/serialization-header.txx
+++ b/libxsd/xsd/cxx/xml/dom/serialization-header.txx
@@ -33,12 +33,8 @@ namespace xsd
prefix (const C* ns, xercesc::DOMElement& e, const C* hint)
{
string xns (ns);
-
-#if _XERCES_VERSION >= 30000
const XMLCh* p (e.lookupPrefix (xns.c_str ()));
-#else
- const XMLCh* p (e.lookupNamespacePrefix (xns.c_str (), false));
-#endif
+
if (p != 0)
return transcode<C> (p);
diff --git a/libxsd/xsd/cxx/xml/dom/serialization-source.hxx b/libxsd/xsd/cxx/xml/dom/serialization-source.hxx
index ce81f2a..9bfd27b 100644
--- a/libxsd/xsd/cxx/xml/dom/serialization-source.hxx
+++ b/libxsd/xsd/cxx/xml/dom/serialization-source.hxx
@@ -108,11 +108,7 @@ namespace xsd
//
virtual void
writeChars (const XMLByte* const buf,
-#if _XERCES_VERSION >= 30000
const XMLSize_t size,
-#else
- const unsigned int size,
-#endif
xercesc::XMLFormatter* const)
{
// Ignore the write request if there was a stream failure and the
diff --git a/libxsd/xsd/cxx/xml/dom/serialization-source.txx b/libxsd/xsd/cxx/xml/dom/serialization-source.txx
index 2caf361..da0dbb7 100644
--- a/libxsd/xsd/cxx/xml/dom/serialization-source.txx
+++ b/libxsd/xsd/cxx/xml/dom/serialization-source.txx
@@ -7,12 +7,9 @@
#include <xercesc/util/XMLUniDefs.hpp> // chLatin_L, etc
#include <xercesc/validators/schema/SchemaSymbols.hpp>
-#if _XERCES_VERSION >= 30000
-# include <xercesc/dom/DOMLSOutput.hpp>
-# include <xercesc/dom/DOMLSSerializer.hpp>
-#else
-# include <xercesc/dom/DOMWriter.hpp>
-#endif
+#include <xercesc/dom/DOMLSOutput.hpp>
+#include <xercesc/dom/DOMLSSerializer.hpp>
+
#include <xercesc/dom/DOMElement.hpp>
#include <xercesc/dom/DOMImplementation.hpp>
#include <xercesc/dom/DOMImplementationRegistry.hpp>
@@ -298,13 +295,9 @@ namespace xsd
//
using xercesc::DOMImplementationRegistry;
using xercesc::DOMImplementation;
-#if _XERCES_VERSION >= 30000
using xercesc::DOMLSSerializer;
using xercesc::DOMConfiguration;
using xercesc::DOMLSOutput;
-#else
- using xercesc::DOMWriter;
-#endif
using xercesc::XMLUni;
const XMLCh ls[] = {xercesc::chLatin_L,
@@ -316,7 +309,6 @@ namespace xsd
bits::error_handler_proxy<C> ehp (eh);
-#if _XERCES_VERSION >= 30000
xml::dom::auto_ptr<DOMLSSerializer> writer (
impl->createLSSerializer ());
@@ -345,33 +337,7 @@ namespace xsd
out->setEncoding (xml::string (encoding).c_str ());
out->setByteStream (&target);
- bool r (writer->write (&doc, out.get ()));
-#else
- xml::dom::auto_ptr<DOMWriter> writer (impl->createDOMWriter ());
-
- writer->setErrorHandler (&ehp);
- writer->setEncoding (xml::string (encoding).c_str ());
-
- // Set some nice features if the serializer supports them.
- //
- if (writer->canSetFeature (
- XMLUni::fgDOMWRTDiscardDefaultContent, true))
- writer->setFeature (XMLUni::fgDOMWRTDiscardDefaultContent, true);
-
- if (!(flags & dont_pretty_print) &&
- writer->canSetFeature (XMLUni::fgDOMWRTFormatPrettyPrint, true))
- writer->setFeature (XMLUni::fgDOMWRTFormatPrettyPrint, true);
-
- // See if we need to write XML declaration.
- //
- if ((flags & no_xml_declaration) &&
- writer->canSetFeature (XMLUni::fgDOMXMLDeclaration, false))
- writer->setFeature (XMLUni::fgDOMXMLDeclaration, false);
-
- bool r (writer->writeNode (&target, doc));
-#endif
-
- if (!r || ehp.failed ())
+ if (!writer->write (&doc, out.get ()) || ehp.failed ())
return false;
return true;
diff --git a/libxsd/xsd/cxx/xml/elements.hxx b/libxsd/xsd/cxx/xml/elements.hxx
index 990a2aa..4c6e887 100644
--- a/libxsd/xsd/cxx/xml/elements.hxx
+++ b/libxsd/xsd/cxx/xml/elements.hxx
@@ -8,8 +8,13 @@
#include <string>
+#include <xercesc/util/XercesVersion.hpp>
#include <xercesc/util/PlatformUtils.hpp>
+#if _XERCES_VERSION < 30000
+# error Xerces-C++ 2-series is not supported
+#endif
+
namespace xsd
{
namespace cxx
diff --git a/libxsd/xsd/cxx/xml/sax/bits/error-handler-proxy.txx b/libxsd/xsd/cxx/xml/sax/bits/error-handler-proxy.txx
index 8487e74..31b1a34 100644
--- a/libxsd/xsd/cxx/xml/sax/bits/error-handler-proxy.txx
+++ b/libxsd/xsd/cxx/xml/sax/bits/error-handler-proxy.txx
@@ -65,22 +65,11 @@ namespace xsd
if (id == 0)
id = e.getSystemId ();
-#if _XERCES_VERSION >= 30000
eh_->handle (transcode<C> (id),
static_cast<unsigned long> (e.getLineNumber ()),
static_cast<unsigned long> (e.getColumnNumber ()),
s,
transcode<C> (e.getMessage ()));
-#else
- XMLSSize_t l (e.getLineNumber ());
- XMLSSize_t c (e.getColumnNumber ());
-
- eh_->handle (transcode<C> (id),
- (l == -1 ? 0 : static_cast<unsigned long> (l)),
- (c == -1 ? 0 : static_cast<unsigned long> (c)),
- s,
- transcode<C> (e.getMessage ()));
-#endif
}
}
}
diff --git a/libxsd/xsd/cxx/xml/sax/std-input-source.hxx b/libxsd/xsd/cxx/xml/sax/std-input-source.hxx
index 6b0af98..6f3ee38 100644
--- a/libxsd/xsd/cxx/xml/sax/std-input-source.hxx
+++ b/libxsd/xsd/cxx/xml/sax/std-input-source.hxx
@@ -29,27 +29,14 @@ namespace xsd
{
}
-#if _XERCES_VERSION >= 30000
virtual XMLFilePos
curPos () const
{
return static_cast<XMLFilePos> (is_.tellg ());
}
-#else
- virtual unsigned int
- curPos () const
- {
- return static_cast<unsigned int> (is_.tellg ());
- }
-#endif
-#if _XERCES_VERSION >= 30000
virtual XMLSize_t
readBytes (XMLByte* const buf, const XMLSize_t size)
-#else
- virtual unsigned int
- readBytes (XMLByte* const buf, const unsigned int size)
-#endif
{
// Some implementations don't clear gcount if you
// call read() on a stream that is in the eof state.
@@ -78,25 +65,17 @@ namespace xsd
// Make sure that if we failed, readBytes won't be called
// again.
//
- if (!is_.fail ())
- {
-#if _XERCES_VERSION >= 30000
- return static_cast<XMLSize_t> (is_.gcount ());
-#else
- return static_cast<unsigned int> (is_.gcount ());
-#endif
- }
- else
- return 0;
+ return !is_.fail ()
+ ? static_cast<XMLSize_t> (is_.gcount ())
+ : 0;
}
-#if _XERCES_VERSION >= 30000
virtual const XMLCh*
getContentType () const
{
return 0;
}
-#endif
+
private:
std::istream& is_;
};
diff --git a/libxsd/xsd/cxx/xml/std-memory-manager.hxx b/libxsd/xsd/cxx/xml/std-memory-manager.hxx
index 7598e22..bd8fbab 100644
--- a/libxsd/xsd/cxx/xml/std-memory-manager.hxx
+++ b/libxsd/xsd/cxx/xml/std-memory-manager.hxx
@@ -19,11 +19,7 @@ namespace xsd
{
public:
virtual void*
-#if _XERCES_VERSION >= 30000
allocate(XMLSize_t size)
-#else
- allocate(size_t size)
-#endif
{
return operator new (size);
}
@@ -35,13 +31,11 @@ namespace xsd
operator delete (p);
}
-#if _XERCES_VERSION >= 30000
virtual xercesc::MemoryManager*
getExceptionMemoryManager()
{
return xercesc::XMLPlatformUtils::fgMemoryManager;
}
-#endif
};
}
}