Skip to content

Commit

Permalink
Merge branch 'main' into cpp17
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Smith committed Oct 10, 2023
2 parents e6d04c2 + 09058c9 commit 9bfa8ff
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
6 changes: 5 additions & 1 deletion six/modules/c++/six.sicd/include/six/sicd/Utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,14 @@ struct Utilities final
*
* \return XML string representation of 'data'
*/
static std::string toXMLString(
static std::u8string toXMLString(
const ComplexData& data,
const std::vector<std::string>& schemaPaths = std::vector<std::string>(),
logging::Logger* logger = nullptr);
static std::string toXMLString_(
const ComplexData& data,
const std::vector<std::string>& schemaPaths = std::vector<std::string>(),
logging::Logger* logger = nullptr);
static std::u8string toXMLString(const ComplexData&,
const std::vector<std::filesystem::path>*, logging::Logger* pLogger = nullptr);
/*!
Expand Down
10 changes: 8 additions & 2 deletions six/modules/c++/six.sicd/source/Utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1040,15 +1040,21 @@ std::unique_ptr<ComplexData> Utilities::parseDataFromString(const std::u8string&
return parser.fromXML(xmlStr);
}

std::string Utilities::toXMLString(const ComplexData& data,
std::u8string Utilities::toXMLString(const ComplexData& data,
const std::vector<std::string>& schemaPaths_,
logging::Logger* logger)
{
std::vector<std::filesystem::path> schemaPaths;
std::transform(schemaPaths_.begin(), schemaPaths_.end(), std::back_inserter(schemaPaths),
[](const std::string& s) { return s; });

const auto result = toXMLString(data, &schemaPaths, logger);
return toXMLString(data, &schemaPaths, logger);
}
std::string Utilities::toXMLString_(const ComplexData& data,
const std::vector<std::string>& schemaPaths,
logging::Logger* logger)
{
const auto result = toXMLString(data, schemaPaths, logger);
return str::to_native(result);
}
std::u8string Utilities::toXMLString(const ComplexData& data,
Expand Down
5 changes: 4 additions & 1 deletion six/modules/c++/six.sidd/include/six/sidd/Utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,12 @@ class Utilities
* \return XML string representation of
*'data'
*/
static std::string toXMLString(const DerivedData& data,
static std::u8string toXMLString(const DerivedData& data,
const std::vector<std::string>& schemaPaths,
logging::Logger* logger);
static std::string toXMLString_(const DerivedData& data,
const std::vector<std::string>& schemaPaths,
logging::Logger* logger);
static std::u8string toXMLString(const DerivedData&,
const std::vector<std::filesystem::path>*, logging::Logger* pLogger = nullptr);
};
Expand Down
10 changes: 8 additions & 2 deletions six/modules/c++/six.sidd/source/Utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,14 +580,20 @@ std::unique_ptr<DerivedData> Utilities::parseDataFromString(const std::u8string&
return dataParser.fromXML(xmlStr);
}

std::string Utilities::toXMLString(const DerivedData& data,
std::u8string Utilities::toXMLString(const DerivedData& data,
const std::vector<std::string>& schemaPaths_, logging::Logger* logger)
{
std::vector<std::filesystem::path> schemaPaths;
std::transform(schemaPaths_.begin(), schemaPaths_.end(), std::back_inserter(schemaPaths),
[](const std::string& s) { return s; });

const auto result = toXMLString(data, &schemaPaths, logger);
return toXMLString(data, &schemaPaths, logger);
}
std::string Utilities::toXMLString_(const DerivedData& data,
const std::vector<std::string>& schemaPaths,
logging::Logger* logger)
{
const auto result = toXMLString(data, schemaPaths, logger);
return str::to_native(result);
}
std::u8string Utilities::toXMLString(const DerivedData& data,
Expand Down

0 comments on commit 9bfa8ff

Please sign in to comment.