From 7ef0e51f98ee95e28dfa18e163ca52e2278bdb00 Mon Sep 17 00:00:00 2001 From: jhurst Date: Tue, 23 Feb 2010 19:27:43 +0000 Subject: [PATCH] xercesC 3.x support --- README | 7 +++++++ src/AS_DCP.h | 12 ++++++++++++ src/KM_xml.cpp | 8 +++++++- src/Makefile.am | 2 +- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/README b/README index da02696..8dfe2b9 100755 --- a/README +++ b/README @@ -112,6 +112,13 @@ utilities all respond to -h. Change History +NEW STUFF: + o Changed AudioDescriptor "SampelRate" element name to "EditRate" + to make it consistent with the other types. + +o Now builds with XercesC 3.x + + 2010.01.05 - bug fixes, enhancements, v1.5.32 o Re-fixed swapped Interop and SMPTE OP Atom UL values. The swap introduced in v1.5.31 was done in error. diff --git a/src/AS_DCP.h b/src/AS_DCP.h index 9c9165f..a9f8b44 100755 --- a/src/AS_DCP.h +++ b/src/AS_DCP.h @@ -246,6 +246,18 @@ namespace ASDCP { inline bool operator!=(const Rational& rhs) const { return ( rhs.Numerator != Numerator || rhs.Denominator != Denominator ); } + + inline bool operator<(const Rational& rhs) { + if ( Numerator < rhs.Numerator ) return true; + if ( Numerator == rhs.Numerator && Denominator < rhs.Denominator ) return true; + return false; + } + + inline bool operator>(const Rational& rhs) { + if ( Numerator > rhs.Numerator ) return true; + if ( Numerator == rhs.Numerator && Denominator > rhs.Denominator ) return true; + return false; + } }; // common edit rates, use these instead of hard coded constants diff --git a/src/KM_xml.cpp b/src/KM_xml.cpp index 6f2092f..298a55f 100644 --- a/src/KM_xml.cpp +++ b/src/KM_xml.cpp @@ -762,7 +762,13 @@ Kumu::XMLElement::ParseString(const std::string& document) int errorCount = 0; SAXParser* parser = new SAXParser(); - parser->setDoValidation(true); + +// #if XERCES_VERSION_MAJOR < 3 +// parser->setDoValidation(true); +// #else + parser->setValidationScheme(SAXParser::Val_Always); +// #endif + parser->setDoNamespaces(true); // optional MyTreeHandler* docHandler = new MyTreeHandler(this); diff --git a/src/Makefile.am b/src/Makefile.am index 336867e..d718fc8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -90,7 +90,7 @@ nodist_libpyasdcp_la_SOURCES = \ asdcp_python.cpp asdcp_python.h \ asdcp_python_descriptor.cpp \ asdcp_python_misc.cpp asdcp_python_writerinfo.h \ - asdcp_wrappers.h asdcp_python_mxf.cpp + asdcp_wrappers.h asdcp_python_mxf.cpp asdcp_python_mxf_text.cpp # asdcp_python_reader.cpp asdcp_python_writer.cpp -- 2.30.2