summaryrefslogtreecommitdiff
path: root/libxsd/xsd/cxx/parser
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/xsd/cxx/parser
parent6e9a647a859d9a95c96e75c77beaf41b166cc4e4 (diff)
Drop support for Xerces-C++ 2-series
Diffstat (limited to 'libxsd/xsd/cxx/parser')
-rw-r--r--libxsd/xsd/cxx/parser/xerces/elements.hxx11
-rw-r--r--libxsd/xsd/cxx/parser/xerces/elements.txx32
2 files changed, 8 insertions, 35 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
}
}
}