From 08f16b35de9f154a3acc17fa47b97ae923a37990 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Mon, 11 Sep 2023 18:04:49 -0400 Subject: [PATCH] fromXML() and parseDataFromString() are now UTF-8 only --- .../c++/cphd/include/cphd/CPHDXMLControl.h | 3 --- .../c++/cphd/source/CPHDXMLControl.cpp | 9 --------- .../c++/six.sicd/include/six/sicd/Utilities.h | 4 ---- six/modules/c++/six.sicd/source/Utilities.cpp | 13 ------------ .../c++/six.sidd/include/six/sidd/Utilities.h | 4 ---- six/modules/c++/six.sidd/source/Utilities.cpp | 12 ----------- six/modules/c++/six/include/six/Utilities.h | 9 --------- six/modules/c++/six/source/Utilities.cpp | 20 ------------------- 8 files changed, 74 deletions(-) diff --git a/six/modules/c++/cphd/include/cphd/CPHDXMLControl.h b/six/modules/c++/cphd/include/cphd/CPHDXMLControl.h index 53436d25c..c42e4d7ba 100644 --- a/six/modules/c++/cphd/include/cphd/CPHDXMLControl.h +++ b/six/modules/c++/cphd/include/cphd/CPHDXMLControl.h @@ -117,9 +117,6 @@ class CPHDXMLControl * * \return pointer to metadata object */ - virtual std::unique_ptr fromXML( - const std::string& xmlString, - const std::vector& schemaPaths = std::vector()); virtual std::unique_ptr fromXML( const std::u8string& xmlString, const std::vector& schemaPaths = std::vector()); diff --git a/six/modules/c++/cphd/source/CPHDXMLControl.cpp b/six/modules/c++/cphd/source/CPHDXMLControl.cpp index a672e1aa1..22ef2d70e 100644 --- a/six/modules/c++/cphd/source/CPHDXMLControl.cpp +++ b/six/modules/c++/cphd/source/CPHDXMLControl.cpp @@ -119,15 +119,6 @@ std::unique_ptr CPHDXMLControl::toXMLImpl(const Metadata& m } /* FROM XML */ -std::unique_ptr CPHDXMLControl::fromXML(const std::string& xmlString, - const std::vector& schemaPaths_) -{ - std::vector schemaPaths; - std::transform(schemaPaths_.begin(), schemaPaths_.end(), std::back_inserter(schemaPaths), - [](const std::string& s) { return s; }); - - return fromXML(str::u8FromNative(xmlString), schemaPaths); -} std::unique_ptr CPHDXMLControl::fromXML(const std::u8string& xmlString, const std::vector& schemaPaths) { diff --git a/six/modules/c++/six.sicd/include/six/sicd/Utilities.h b/six/modules/c++/six.sicd/include/six/sicd/Utilities.h index ad4fb2440..42a65cc07 100644 --- a/six/modules/c++/six.sicd/include/six/sicd/Utilities.h +++ b/six/modules/c++/six.sicd/include/six/sicd/Utilities.h @@ -409,10 +409,6 @@ struct Utilities final * * \return Data representation of 'xmlStr' */ - static std::unique_ptr parseDataFromString( - const std::string& xmlStr, - const std::vector& schemaPaths, - logging::Logger& log); static std::unique_ptr parseDataFromString( const std::u8string& xmlStr, const std::vector* pSchemaPaths, diff --git a/six/modules/c++/six.sicd/source/Utilities.cpp b/six/modules/c++/six.sicd/source/Utilities.cpp index 712f03f4f..83be1b754 100644 --- a/six/modules/c++/six.sicd/source/Utilities.cpp +++ b/six/modules/c++/six.sicd/source/Utilities.cpp @@ -1019,19 +1019,6 @@ std::unique_ptr Utilities::parseDataFromFile(const std::filesystem: return parser.fromXML(pathname); } -std::unique_ptr Utilities::parseDataFromString( - const std::string& xmlStr_, - const std::vector& schemaPaths_, - logging::Logger& log) -{ - const auto xmlStr = str::u8FromNative(xmlStr_); - - std::vector schemaPaths; - std::transform(schemaPaths_.begin(), schemaPaths_.end(), std::back_inserter(schemaPaths), - [](const std::string& s) { return s; }); - - return parseDataFromString(xmlStr, &schemaPaths, &log); -} std::unique_ptr Utilities::parseDataFromString(const std::u8string& xmlStr, const std::vector* pSchemaPaths, logging::Logger* pLogger) { diff --git a/six/modules/c++/six.sidd/include/six/sidd/Utilities.h b/six/modules/c++/six.sidd/include/six/sidd/Utilities.h index 1bc5713bd..2cb9d47a0 100644 --- a/six/modules/c++/six.sidd/include/six/sidd/Utilities.h +++ b/six/modules/c++/six.sidd/include/six/sidd/Utilities.h @@ -130,10 +130,6 @@ class Utilities * * \return Data representation of 'xmlStr' */ - static std::unique_ptr parseDataFromString( - const std::string& xmlStr, - const std::vector& schemaPaths, - logging::Logger& log); static std::unique_ptr parseDataFromString( const std::u8string& xmlStr, const std::vector* pSchemaPaths, diff --git a/six/modules/c++/six.sidd/source/Utilities.cpp b/six/modules/c++/six.sidd/source/Utilities.cpp index 4d05563bd..e7a6e9ff7 100644 --- a/six/modules/c++/six.sidd/source/Utilities.cpp +++ b/six/modules/c++/six.sidd/source/Utilities.cpp @@ -560,18 +560,6 @@ std::unique_ptr Utilities::parseDataFromFile(const std::filesystem: return dataParser.fromXML(pathname); } -std::unique_ptr Utilities::parseDataFromString(const std::string& xmlStr_, - const std::vector& schemaPaths_, logging::Logger& log) -{ - const auto xmlStr = str::u8FromNative(xmlStr_); - - std::vector schemaPaths; - std::transform(schemaPaths_.begin(), schemaPaths_.end(), std::back_inserter(schemaPaths), - [](const std::string& s) { return s; }); - - auto result = parseDataFromString(xmlStr, &schemaPaths, &log); - return std::unique_ptr(result.release()); -} std::unique_ptr Utilities::parseDataFromString(const std::u8string& xmlStr, const std::vector* pSchemaPaths, logging::Logger* pLogger) { diff --git a/six/modules/c++/six/include/six/Utilities.h b/six/modules/c++/six/include/six/Utilities.h index 3703047d6..ef79f4258 100644 --- a/six/modules/c++/six/include/six/Utilities.h +++ b/six/modules/c++/six/include/six/Utilities.h @@ -275,11 +275,6 @@ std::unique_ptr parseDataFromFile(const XMLControlRegistry& xmlReg, * * \return Data representation of 'xmlStr' */ -std::unique_ptr parseDataFromString(const XMLControlRegistry& xmlReg, - const std::string& xmlStr, - DataType dataType, - const std::vector& schemaPaths, - logging::Logger& log); std::unique_ptr parseDataFromString(const XMLControlRegistry& xmlReg, const std::u8string& xmlStr, DataType dataType, @@ -297,10 +292,6 @@ std::unique_ptr parseDataFromString(const XMLControlRegistry& xmlReg, * * \return Data representation of 'xmlStr' */ -std::unique_ptr parseDataFromString(const XMLControlRegistry& xmlReg, - const std::string& xmlStr, - const std::vector& schemaPaths, - logging::Logger& log); std::unique_ptr parseDataFromString(const XMLControlRegistry& xmlReg, const std::u8string& xmlStr, const std::vector* pSchemaPaths, diff --git a/six/modules/c++/six/source/Utilities.cpp b/six/modules/c++/six/source/Utilities.cpp index 5f5cc558f..76f1fe9ad 100644 --- a/six/modules/c++/six/source/Utilities.cpp +++ b/six/modules/c++/six/source/Utilities.cpp @@ -687,13 +687,6 @@ std::unique_ptr six::parseDataFromString(const XMLControlRegistry& xmlReg, dataParser.preserveCharacterData(false); // existing behavior return dataParser.fromXML(xmlStr, xmlReg, DataType::NOT_SET); } -std::unique_ptr six::parseDataFromString(const XMLControlRegistry& xmlReg, - const std::string& xmlStr, - const std::vector& schemaPaths, - logging::Logger& log) -{ - return parseDataFromString(xmlReg, xmlStr, DataType::NOT_SET, schemaPaths, log); -} std::unique_ptr six::parseDataFromString( const XMLControlRegistry& xmlReg, @@ -706,19 +699,6 @@ std::unique_ptr six::parseDataFromString( dataParser.preserveCharacterData(false); // existing behavior return dataParser.fromXML(xmlStr, xmlReg, dataType); } -std::unique_ptr six::parseDataFromString(const XMLControlRegistry& xmlReg, - const std::string& xmlStr, - DataType dataType, - const std::vector& schemaPaths_, - logging::Logger& log) -{ - std::vector schemaPaths; - std::transform(schemaPaths_.begin(), schemaPaths_.end(), std::back_inserter(schemaPaths), - [](const std::string& s) { return s; }); - - auto result = parseDataFromString(xmlReg, str::u8FromNative(xmlStr), dataType, &schemaPaths, &log); - return std::unique_ptr(result.release()); -} std::string six::findSchemaPath(const std::string& progname) {