diff --git a/externals/nitro/externals/coda-oss/ReleaseNotes.md b/externals/nitro/externals/coda-oss/ReleaseNotes.md
deleted file mode 100644
index bf8f97f3a..000000000
--- a/externals/nitro/externals/coda-oss/ReleaseNotes.md
+++ /dev/null
@@ -1,85 +0,0 @@
-```
- _________________________
- | ____ _||_ ___ __ |
- | /___ \/_||_\| __\/ \ |
- | // \// || \|| \\ _ \ |
- | || [===||===] ||(_)| |
- | || _|| || ||| ||__ | |
- | \\ _/ |\_||_/||__/|| || |
- | \___/ \_||_/|___/|| || |
- |__________||_____________|
- ```
-# coda-oss Release Notes
-
-## [Release 2023-06-05](https://github.com/mdaus/coda-oss/releases/tag/2023-06-05)
-* *zlib* updated to [1.2.13](https://github.com/madler/zlib/releases/tag/v1.2.13).
-* new `mem::ComplexView` class to make it easier to process complex data stored in parallel.
-* adjust compiler flags for clean *CMake* builds.
-* wrap common "file open" routines (e.g., `fopen()`) to support `sys::expandEnvironmentVariables()`.
-* add header-only [HighFive](https://github.com/BlueBrain/HighFive) HDF5-wrapper library.
-* Added a handful of [HighFive](https://github.com/BlueBrain/HighFive) utility routines.
-* `mt::transform_async()` removed, it doesn't match C++17 techniques.'
-* Revamp `sys::byteSwap()` for improved type-safety and
- [better performance](https://devblogs.microsoft.com/cppblog/a-tour-of-4-msvc-backend-improvements/).
- * Added case-insensitive string comparison utilties: `str::eq()` and `str::ne()`;
- `xml::lite::Uri`s compare case-insensitive.
-
-## [Release 2022-12-14](https://github.com/mdaus/coda-oss/releases/tag/2022-12-14)
-* removed remaining vestiges of `std::auto_ptr`, provide `mem::AutoPtr` for the tiny handful of
- places (e.g., SWIG bindings) that still need copying.
-* `xml::lite::Element` overloads to make creting new XML documents easier; see unittests for examples.
-* try even harder to find unittest files in various scenarios.
-* build *hdf5.lite* with **waf**.
-* New `--optz=fastest-possible` (**waf** only) which adds
- [`-march=native`](https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/x86-Options.html#x86-Options)
- to *fastest* for **waf** builds. There is a new *faster* option (the default) which is currently
- the same as *fastest* (i.e., no `-march=native`).
-
-## [Release 2022-11-04](https://github.com/mdaus/coda-oss/releases/tag/2022-11-04)
-* "Cut" from [main](https://github.com/mdaus/coda-oss/tree/main), not *master*.
-* The [HDFGroup](https://hdfgroup.org/)s [HDF5 library](https://github.com/HDFGroup/hdf5) is built
- and installed; a simple (and very incomplete!) wrapper is provided, this is at the "hello world!" stage.
-* A few **cli** routines have been tweaked to make unit-testing easier.
-* Utilitiy routines for finding various files when unit-testing.
-* Removed C++14 work-arounds needed in C++11. Legacy C++ exception specificatons removed.
-* Rebuild `waf` for FIPS error; added more debug options.
-
-## [Release 2022-08-30](https://github.com/mdaus/coda-oss/releases/tag/2022-08-30)
-* XML is now always written as UTF-8; the code will still try to read Windows-1252.
-* `Uri`s are no longer validated by default.
-* Minor tweaks from other projects.
-* ~~Final C++11 release 🤞🏻; future releases will be C++14 from [main](https://github.com/mdaus/coda-oss/tree/main).~~
-
-## [Release 2022-08-02](https://github.com/mdaus/coda-oss/releases/tag/2022-08-02)
-* remove *Expat* and *libXML* modules and support in **xml.lite**; only *Xerces* was actively used.
-* ~~fix `waf` to work-around FIPS warning because of insecure *md5* hashing.~~
-* tweak `str::EncodedStringView` and `str::EncodedString` for
- [future XML changes](https://github.com/mdaus/coda-oss/tree/feature/always-write-xml-as-utf8).
-
-## [Release 2022-06-29](https://github.com/mdaus/coda-oss/releases/tag/2022-06-29)
-* remove **modules/drivers/boost** as it was empty (and unused);
- **modules/c++/serialize** depended on boost, so it has also been removed.
-* Update to [zlib 1.2.12](https://www.zlib.net/zlib-1.2.12.tar.gz),
- ["Due to the bug fixes, any installations of 1.2.11 should be replaced with 1.2.12."](https://www.zlib.net/)
-* Build most code in Visual Studio 2022
-* Removed more compiler warnings
-* Begin work on `CODA_OSS_API` (needed for building a shared-library/DLL)
-* Add `run1D()` method to `mt::GenerationThreadPool`
-
-## [Release 2022-05-03](https://github.com/mdaus/coda-oss/releases/tag/2022-05-03)
-* Fixed a bug in `Poly2D::atY()`; improved `flipXY()` behavior.
-* Implement [std::filesystem::file_size()](https://en.cppreference.com/w/cpp/filesystem/file_size).
-* use `inline` functions for `TEST_` macros
-* force use of [64-bit `time_t`](https://en.wikipedia.org/wiki/Year_2038_problem)
-* more routines now support a `std::span` overload; e.g., `io::InputStream::read()`.
-
-## [Release 2022-02-22](https://github.com/mdaus/coda-oss/releases/tag/2022-02-22)
-* new `EnocdedString` and `EncodedStringView` to manage strings in different encodings
-* XML containing UTF-8 characters can now be validated
-* Update to [GSL 4.0.0](https://github.com/microsoft/GSL/releases/tag/v4.0.0)
-* our implementation of `std` stuff is all in the `coda_oss` namespace
-* old, unused **log4j.jar** deleted to remove any questions about the security vulnerability
-
-## [Release 2021-12-13](https://github.com/mdaus/coda-oss/releases/tag/2021-12-13)
-* Try hard to parse XML encoded in various ways
-* Simplify XML element creation for common idioms
diff --git a/externals/nitro/externals/coda-oss/modules/c++/cli/source/ArgumentParser.cpp b/externals/nitro/externals/coda-oss/modules/c++/cli/source/ArgumentParser.cpp
deleted file mode 100644
index 2a31bda45..000000000
--- a/externals/nitro/externals/coda-oss/modules/c++/cli/source/ArgumentParser.cpp
+++ /dev/null
@@ -1,884 +0,0 @@
-/* =========================================================================
- * This file is part of cli-c++
- * =========================================================================
- *
- * (C) Copyright 2004 - 2014, MDA Information Systems LLC
- *
- * cli-c++ is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; If not,
- * see .
- *
- */
-
-#include "cli/ArgumentParser.h"
-
-#include
-#include
-
-#include
-#include
-
-namespace
-{
-static const size_t MAX_ARG_LINE_LENGTH = 21;
-
-bool containsOnly(const std::string& str,
- const std::map& flags)
-{
- for (size_t ii = 0; ii < str.length(); ++ii)
- {
- if (flags.find(str.substr(ii, 1)) == flags.end())
- {
- return false;
- }
- }
-
- return true;
-}
-
-void writeArgumentHelp(std::ostream& out, const std::string& heading,
- size_t maxFlagsWidth,
- const std::vector& flags,
- const std::vector& helps)
-{
- std::ostringstream s;
- out << heading << std::endl;
- for (size_t i = 0, num = flags.size(); i < num; ++i)
- {
- s.str("");
- std::string flag = flags[i];
- std::string help = helps[i];
- if (flag.size() <= maxFlagsWidth)
- {
- s << " ";
- s.width(maxFlagsWidth + 1);
- s << std::left << flag;
- s.width(0);
- s << help;
- out << s.str() << std::endl;
- }
- else
- {
- s << " ";
- s << flag;
- out << s.str() << std::endl;
- s.str("");
- s.width(maxFlagsWidth + 3);
- s << " ";
- s.width(0);
- s << help;
- out << s.str() << std::endl;
- }
- }
-}
-}
-
-cli::ArgumentParser::ArgumentParser(bool ignoreUnknownArguments,
- std::ostream* iuOStream ) :
- mHelpEnabled(true),
- mPrefixChar('-'),
- mIgnoreUnknownArguments(ignoreUnknownArguments),
- mIgnoreUnknownOStream(iuOStream)
-{
-}
-
-cli::ArgumentParser::~ArgumentParser()
-{
-}
-
-/**
- * Shortcut for adding an argument
- */
-std::shared_ptr
-cli::ArgumentParser::addArgument(const std::string& nameOrFlags,
- const std::string& help,
- cli::Action action,
- const std::string& dest,
- const std::string& metavar,
- int minArgs, int maxArgs,
- bool required)
-{
- std::shared_ptr arg(new cli::Argument(nameOrFlags, this));
-
- if (arg->isPositional())
- {
- action = cli::STORE;
- // if it is positional and a min args is supplied, require it
- if (minArgs > 0)
- required = true;
- }
-
- switch (action)
- {
- case cli::STORE:
- case cli::SUB_OPTIONS:
- if (minArgs < 0)
- {
- minArgs = 1;
- maxArgs = 1;
- }
- break;
- case cli::STORE_TRUE:
- case cli::STORE_FALSE:
- case cli::STORE_CONST:
- case cli::VERSION:
- minArgs = 1;
- maxArgs = 1;
- break;
- }
-
- arg->setMinArgs(minArgs);
- arg->setMaxArgs(maxArgs);
- arg->setAction(action);
- arg->setDestination(dest);
- arg->setHelp(help);
- arg->setMetavar(metavar);
- arg->setRequired(required);
- mArgs.push_back(arg);
- return arg;
-}
-
-cli::ArgumentParser& cli::ArgumentParser::setDescription(const std::string& d)
-{
- mDescription = d;
- return *this;
-}
-
-cli::ArgumentParser& cli::ArgumentParser::setProlog(const std::string& prolog)
-{
- mProlog = prolog;
- return *this;
-}
-
-cli::ArgumentParser& cli::ArgumentParser::setEpilog(const std::string& epilog)
-{
- mEpilog = epilog;
- return *this;
-}
-
-cli::ArgumentParser& cli::ArgumentParser::setUsage(const std::string& usage)
-{
- mUsage = usage;
- return *this;
-}
-
-cli::ArgumentParser& cli::ArgumentParser::enableHelp(bool flag)
-{
- mHelpEnabled = flag;
- return *this;
-}
-
-cli::ArgumentParser& cli::ArgumentParser::setProgram(const std::string& program)
-{
- mProgram = program;
- return *this;
-}
-
-cli::ArgumentParser& cli::ArgumentParser::setIgnoreUnknownArgumentsFlag(bool iuFlag)
-{
- mIgnoreUnknownArguments = iuFlag;
- return *this;
-}
-
-cli::ArgumentParser& cli::ArgumentParser::setIgnoreUnknownArgumentsOutputStream(
- std::ostream* iuaOutstream)
-{
- mIgnoreUnknownOStream = iuaOutstream;
- return *this;
-}
-
-void cli::ArgumentParser::printHelp(std::ostream& out, bool andExit) const
-{
- FlagInfo flagInfo;
- processFlags(flagInfo);
-
- if (!mProlog.empty())
- out << mProlog << std::endl << std::endl;
-
- out << "usage: ";
- if (mUsage.empty())
- {
- std::string progName = mProgram;
- out << (progName.empty() ? "program" : progName);
- if (!flagInfo.opUsage.empty())
- out << " " << str::join(flagInfo.opUsage, " ");
- if (!flagInfo.posUsage.empty())
- out << " " << str::join(flagInfo.posUsage, " ");
- out << std::endl;
- }
- else
- out << mUsage << std::endl;
-
- if (!mDescription.empty())
- out << std::endl << mDescription << std::endl;
-
- if (!flagInfo.posFlags.empty())
- {
- out << std::endl;
- writeArgumentHelp(out, "positional arguments:", flagInfo.maxFlagsWidth,
- flagInfo.posFlags, flagInfo.posHelps);
- }
-
- if (!flagInfo.requiredFlags.empty())
- {
- out << std::endl;
- writeArgumentHelp(out, "required arguments:", flagInfo.maxFlagsWidth,
- flagInfo.requiredFlags, flagInfo.requiredHelps);
- }
-
- if (!flagInfo.opFlags.empty())
- {
- out << std::endl;
- writeArgumentHelp(out, "optional arguments:", flagInfo.maxFlagsWidth,
- flagInfo.opFlags, flagInfo.opHelps);
- }
-
- if (!mEpilog.empty())
- out << std::endl << mEpilog << std::endl;
-
- if (andExit)
- exit(cli::EXIT_USAGE);
-}
-
-std::vector cli::ArgumentParser::make_args(int argc, const char** argv, std::string& program)
-{
- if (argc > 0)
- program = std::string(argv[0]);
- std::vector args;
- for (int i = 1; i < argc; ++i)
- args.emplace_back(argv[i]);
- return args;
-}
-std::vector cli::ArgumentParser::make_args(int argc, const char** argv)
-{
- std::string program;
- auto args = make_args(argc, argv, program);
- if (mProgram.empty() && !program.empty())
- setProgram(program);
- return args;
-}
-
-cli::Results* cli::ArgumentParser::parse(int argc, const char** argv)
-{
- return parse(make_args(argc, argv));
-}
-cli::Results* cli::ArgumentParser::parse(const std::vector& args)
-{
- if (!mProgram.empty())
- {
- return parse("" /*don't change any value already set*/, args).release();
- }
- else
- {
- return parse("cli::ArgumentParser::parse" /*program*/, args).release(); // provide a "meaningful" default program name
- }
-}
-std::unique_ptr cli::ArgumentParser::parse(const std::string& program, const std::vector& args)
-{
- if (!program.empty())
- setProgram(program);
-
- std::map shortFlags;
- std::map longFlags;
- std::map shortOptionsFlags;
- std::map longOptionsFlags;
- std::vector positionalArgs;
-
- positionalArgs.reserve(mArgs.size());
- for (auto& arg_ : mArgs)
- {
- cli::Argument* arg = arg_.get();
- std::string argVar = arg->getVariable();
-
- if (arg->isPositional())
- {
- positionalArgs.push_back(arg);
- }
- else
- {
- const std::vector& argShortFlags =
- arg->getShortFlags();
- const std::vector& argLongFlags = arg->getLongFlags();
- bool subOption = (arg->getAction() == cli::SUB_OPTIONS);
- for (std::vector::const_iterator it =
- argShortFlags.begin(); it != argShortFlags.end(); ++it)
- {
- std::string op = *it;
- std::map& flagMap =
- (subOption ? shortOptionsFlags : shortFlags);
- if (flagMap.find(op) != flagMap.end())
- parseError(FmtX("Conflicting option: %c%s", mPrefixChar,
- op.c_str()));
- flagMap[op] = arg;
- }
- for (std::vector::const_iterator it =
- argLongFlags.begin(); it != argLongFlags.end(); ++it)
- {
- std::string op = *it;
- std::map& flagMap =
- (subOption ? longOptionsFlags : longFlags);
- if (flagMap.find(op) != flagMap.end())
- parseError(FmtX("Conflicting option: %c%c%s", mPrefixChar,
- mPrefixChar, op.c_str()));
- flagMap[op] = arg;
- }
- }
-
- }
-
- std::vector < std::string > explodedArgs;
- explodedArgs.reserve(args.size());
- // next, check for combined short options
- for (size_t i = 0, s = args.size(); i < s; ++i)
- {
- std::string argStr = args[i];
- if (argStr.size() > 1 && argStr[0] == mPrefixChar && argStr[1]
- != mPrefixChar)
- {
- std::string flag = argStr.substr(1);
- if (shortFlags.find(flag) != shortFlags.end())
- {
- explodedArgs.push_back(argStr);
- }
- else
- {
- // check for =
- if (argStr.find("=") != std::string::npos)
- {
- std::vector < std::string > parts = str::split(argStr, "=",
- 2);
- std::copy(parts.begin(), parts.end(),
- std::back_inserter(explodedArgs));
- }
- else
- {
- // first, see if it is an extra option
- std::vector < std::string > parts = str::split(argStr, ":",
- 2);
- if (parts.size() == 2)
- {
- explodedArgs.push_back(argStr);
- }
- else
- {
- // Check if every single character in this flag is
- // one of the short flags
- if (containsOnly(flag, shortFlags))
- {
- // Split up each char as separate options
- // Only the last will get any additional args
- const std::string prefixStr(1, mPrefixChar);
- for (size_t jj = 0; jj < flag.length(); ++jj)
- {
- explodedArgs.push_back(prefixStr + flag[jj]);
- }
- }
- else
- {
- // If we find a character that isn't one of the
- // short flags, then it's probably just an
- // argument that happens to start with a dash,
- // like "-1", and we want to leave it alone
- explodedArgs.push_back(argStr);
- }
- }
- }
- }
- }
- else if (argStr.size() > 2 && argStr[0] == mPrefixChar && argStr[1]
- == mPrefixChar)
- {
- // check for =
- if (argStr.find("=") != std::string::npos)
- {
- std::vector < std::string > parts = str::split(argStr, "=", 2);
- std::copy(parts.begin(), parts.end(),
- std::back_inserter(explodedArgs));
- }
- else
- explodedArgs.push_back(argStr);
- }
- else
- {
- explodedArgs.push_back(argStr);
- }
- }
-
- auto results = std::make_unique();
- cli::Results *currentResults = NULL;
- for (size_t i = 0, s = explodedArgs.size(); i < s; ++i)
- {
- currentResults = results.get(); // set the pointer
- std::string argStr = explodedArgs[i];
- cli::Argument *arg = NULL;
- std::string optionsStr("");
- if (argStr.size() > 2 && argStr[0] == mPrefixChar && argStr[1]
- == mPrefixChar)
- {
- std::string flag = argStr.substr(2);
- if (longFlags.find(flag) != longFlags.end())
- {
- arg = longFlags[flag];
- }
- else if (mHelpEnabled && flag == "help")
- {
- printHelp(std::cerr, true);
- }
- else
- {
- // check if it's an options flag
- std::vector < std::string > parts = str::split(flag, ":", 2);
- if (parts.size() == 2 && longOptionsFlags.find(parts[0])
- != longOptionsFlags.end())
- {
- arg = longOptionsFlags[parts[0]];
- optionsStr = parts[1];
- std::string argVar = arg->getVariable();
- if (!results->hasSubResults(argVar))
- results->put(argVar, new cli::Results);
- currentResults = results->getSubResults(argVar);
- }
- else
- {
- if (mIgnoreUnknownArguments)
- {
- *mIgnoreUnknownOStream << "Unknown arg: " << argStr
- << std::endl;
- continue;
- }
- else
- {
- throw except::Exception(Ctxt(
- FmtX("Invalid option: [%s]", argStr.c_str())));
- }
- }
- }
- }
- else if (argStr.size() > 1 && argStr[0] == mPrefixChar && argStr[1]
- != mPrefixChar)
- {
- std::string flag = argStr.substr(1);
- if (shortFlags.find(flag) != shortFlags.end())
- {
- arg = shortFlags[flag];
- }
- else if (mHelpEnabled && flag == "h")
- {
- printHelp(std::cerr, true);
- }
- else
- {
- // check if it's an options flag
- std::vector < std::string > parts = str::split(flag, ":", 2);
- if (parts.size() == 2 && shortOptionsFlags.find(parts[0])
- != shortOptionsFlags.end())
- {
- arg = shortOptionsFlags[parts[0]];
- optionsStr = parts[1];
- std::string argVar = arg->getVariable();
- if (!results->hasSubResults(argVar))
- results->put(argVar, new cli::Results);
- currentResults = results->getSubResults(argVar);
- }
- else
- {
- if (mIgnoreUnknownArguments)
- {
- *mIgnoreUnknownOStream << "Unknown arg: " << argStr
- << std::endl;
- continue;
- }
- else
- {
- throw except::Exception(Ctxt(
- FmtX("Invalid option: [%s]", argStr.c_str())));
- }
-
- }
- }
- }
-
-
- if (arg != NULL)
- {
- std::string argVar = arg->getVariable();
- switch (arg->getAction())
- {
- case cli::STORE:
- {
- cli::Value* v = currentResults->hasValue(argVar)
- ? currentResults->getValue(argVar)
- : new cli::Value;
- int maxArgs = arg->getMaxArgs();
- // risky, I know...
- bool added = false;
- while (i < s - 1)
- {
- std::string nextArg(explodedArgs[i + 1]);
- if (nextArg.size() > 1 && nextArg[0] == mPrefixChar)
- {
- // It might be another flag, but it might just be a
- // value that starts with a negative sign
- if ((nextArg.size() > 2 && nextArg[1] == mPrefixChar) ||
- str::contains(nextArg, ":") ||
- containsOnly(nextArg.substr(1), shortFlags))
- {
- // Fine, it's another flag
- break;
- }
- }
- if (maxArgs >= 0 &&
- v->size() >= static_cast(maxArgs))
- {
- // it's another positional argument, so we break out
- break;
- }
- v->add(nextArg);
- ++i;
- added = true;
- }
-
- if (!added)
- parseError(
- FmtX(
- "option requires value or has exceeded its max: [%s]",
- argVar.c_str()));
-
- currentResults->put(argVar, v);
- break;
- }
- case cli::STORE_TRUE:
- currentResults->put(argVar, new cli::Value(true));
- break;
- case cli::STORE_FALSE:
- currentResults->put(argVar, new cli::Value(false));
- break;
- case cli::STORE_CONST:
- {
- const Value* constVal = arg->getConst();
- currentResults->put(argVar, constVal ? constVal->clone() : NULL);
- break;
- }
- case cli::SUB_OPTIONS:
- {
- if (optionsStr.empty())
- parseError(FmtX("invalid sub option: [%s]", argVar.c_str()));
- cli::Value* v = currentResults->hasValue(optionsStr)
- ? currentResults->getValue(optionsStr)
- : new cli::Value;
- if (i < s - 1)
- {
- std::string nextArg = explodedArgs[i + 1];
- if (nextArg.size() > 1 && nextArg[0] == mPrefixChar)
- {
- // it's another flag
- // this indicates the sub op is a bool
- v->add(true);
- }
- else
- {
- v->add(nextArg);
- ++i;
- }
- }
- else
- {
- // this indicates the sub op is a bool
- v->add(true);
- }
- currentResults->put(optionsStr, v);
- break;
- }
- case cli::VERSION:
- //TODO
- break;
- }
- }
- else
- {
- // it's a positional argument
- cli::Value *lastPosVal = NULL;
- for (std::vector::iterator it =
- positionalArgs.begin(); it != positionalArgs.end(); ++it)
- {
- cli::Argument *posArg = *it;
- std::string argVar = posArg->getVariable();
- int maxArgs = posArg->getMaxArgs();
- if (currentResults->hasValue(argVar))
- {
- cli::Value *posVal = lastPosVal
- = currentResults->getValue(argVar);
- if (static_cast(posVal->size()) >= maxArgs)
- continue;
- break;
- }
- else if (maxArgs != 0)
- {
- lastPosVal = new cli::Value;
- currentResults->put(argVar, lastPosVal);
- break;
- }
- }
- if (lastPosVal)
- {
- lastPosVal->add(argStr);
- }
- else
- {
- if (!mIgnoreUnknownArguments)
- {
- parseError("too many arguments");
- }
- }
- }
- }
-
- // add the defaults
- for (auto& arg_ : mArgs)
- {
- cli::Argument* arg = arg_.get();
- std::string argMeta = arg->getMetavar();
- std::string argVar = arg->getVariable();
- std::string argId = arg->isPositional() && !argMeta.empty() ? argMeta
- : argVar;
-
- if (!results->hasValue(argVar))
- {
- const Value* defaultVal = arg->getDefault();
- if (defaultVal != NULL)
- results->put(argVar, defaultVal->clone());
- else if (arg->getAction() == cli::STORE_FALSE)
- results->put(argVar, new cli::Value(true));
- else if (arg->getAction() == cli::STORE_TRUE)
- results->put(argVar, new cli::Value(false));
- else if (arg->isRequired())
- parseError(FmtX("missing required argument: [%s]",
- argVar.c_str()));
- }
-
-
- // validate # of args
- int minArgs = arg->getMinArgs();
- int maxArgs = arg->getMaxArgs();
- size_t numGiven =
- results->hasValue(argVar) ? results->getValue(argVar)->size()
- : 0;
-
- if (arg->isRequired() || numGiven > 0)
- {
- if (minArgs > 0 && numGiven < static_cast(minArgs))
- parseError(FmtX("not enough arguments, %d required: [%s]",
- minArgs, argId.c_str()));
- if (maxArgs >= 0 && numGiven > static_cast(maxArgs))
- parseError(FmtX("too many arguments, %d supported: [%s]",
- maxArgs, argId.c_str()));
- }
-
-
- // validate the argument value against the choices
- // TODO: add option to make case insensitive
- std::vector choices = arg->getChoices();
- if (numGiven > 0 && !choices.empty())
- {
- bool isValid = false;
- cli::Value *vals = results->getValue(argVar);
-
- for (size_t ii = 0; ii < numGiven; ++ii)
- {
- if (std::find(choices.begin(), choices.end(),
- vals->at(ii)) != choices.end())
- {
- isValid = true;
- break;
- }
- }
- if (!isValid)
- {
- parseError(FmtX("invalid option for [%s]", argVar.c_str()));
- }
- }
- }
-
- return results;
-}
-
-void cli::ArgumentParser::printUsage(std::ostream& out, bool andExit,
- const std::string& message) const
-{
- out << "usage: ";
- if (mUsage.empty())
- {
- FlagInfo flagInfo;
- processFlags(flagInfo);
-
- out << (mProgram.empty() ? "program" : mProgram);
- if (!flagInfo.opUsage.empty())
- out << " " << str::join(flagInfo.opUsage, " ");
- if (!flagInfo.posUsage.empty())
- out << " " << str::join(flagInfo.posUsage, " ");
- }
- else
- out << mUsage;
- if (!message.empty())
- out << std::endl << std::endl << message;
- out << std::endl;
- if (andExit)
- exit(cli::EXIT_USAGE);
-}
-
-void cli::ArgumentParser::parseError(const std::string& msg)
-{
- std::ostringstream s;
- s << "usage: ";
- if (mUsage.empty())
- {
- FlagInfo flagInfo;
- processFlags(flagInfo);
-
- s << (mProgram.empty() ? "program" : mProgram);
- if (!flagInfo.opUsage.empty())
- s << " " << str::join(flagInfo.opUsage, " ");
- if (!flagInfo.posUsage.empty())
- s << " " << str::join(flagInfo.posUsage, " ");
- }
- else
- s << mUsage;
- s << "\n" << msg;
- throw except::ParseException(s.str());
-}
-
-void cli::ArgumentParser::processFlags(FlagInfo& info) const
-{
- std::ostringstream s;
-
- if (mHelpEnabled)
- {
- const std::string prefixStr(1, mPrefixChar);
- const std::string helpMsg =
- std::string(1, mPrefixChar) + "h, " +
- std::string(2, mPrefixChar) + "help";
-
- info.maxFlagsWidth = std::max(helpMsg.size(), info.maxFlagsWidth);
- info.opFlags.push_back(helpMsg);
- info.opHelps.push_back("show this help message and exit");
- }
-
- for (auto& arg_ : mArgs)
- {
- cli::Argument* arg = arg_.get();
- const std::string& argName = arg->getName();
- const cli::Action& argAction = arg->getAction();
- const std::vector& argChoices = arg->getChoices();
- const std::string& argMetavar = arg->getMetavar();
- const std::string& argHelp = arg->getHelp();
- const cli::Value* defaultVal = arg->getDefault();
-
- s.str("");
- s << argHelp;
- if (defaultVal)
- s << " (default: " << defaultVal->toString() << ")";
- std::string helpMsg = s.str();
-
- s.str("");
- if (!argMetavar.empty())
- s << argMetavar;
- else if (!argChoices.empty())
- s << "{" << str::join(argChoices, ",") << "}";
- std::string meta = s.str();
-
- if (arg->isPositional())
- {
- //positional argument
- std::string op = meta.empty() ? argName : meta;
- info.maxFlagsWidth = std::max(op.size(), info.maxFlagsWidth);
- info.posFlags.push_back(op);
- if (arg->showsHelp())
- {
- info.posHelps.push_back(helpMsg);
- info.posUsage.push_back(op);
- }
- }
- else
- {
- std::vector < std::string > ops;
- const std::vector& argShortFlags =
- arg->getShortFlags();
- const std::vector& argLongFlags = arg->getLongFlags();
- for (size_t i = 0, n = argShortFlags.size(); i < n; ++i)
- {
- s.str("");
- s << mPrefixChar << argShortFlags[i];
- if (argAction == cli::SUB_OPTIONS)
- {
- if (meta.empty())
- s << ":ARG[=VALUE]";
- else
- s << ":" << meta;
- }
- else if (!meta.empty())
- s << " " << meta;
- ops.push_back(s.str());
- }
- for (size_t i = 0, n = argLongFlags.size(); i < n; ++i)
- {
- s.str("");
- s << mPrefixChar << mPrefixChar << argLongFlags[i];
- if (argAction == cli::SUB_OPTIONS)
- {
- if (meta.empty())
- s << ":ARG[=VALUE]";
- else
- s << ":" << meta;
- }
- else if (!meta.empty())
- s << " " << meta;
- ops.push_back(s.str());
- }
- if (!ops.empty())
- {
- s.str("");
- if (arg->isRequired())
- {
- s << ops[0];
- }
- else
- {
- s << "[" << ops[0] << "]";
- }
-
- if (arg->showsHelp())
- {
- info.opUsage.push_back(s.str());
- }
-
- const std::string opMsg = str::join(ops, ", ");
- info.maxFlagsWidth =
- std::max(opMsg.size(), info.maxFlagsWidth);
- if (arg->showsHelp())
- {
- if (arg->isRequired())
- {
- info.requiredFlags.push_back(opMsg);
- info.requiredHelps.push_back(helpMsg);
- }
- else
- {
- info.opFlags.push_back(opMsg);
- info.opHelps.push_back(helpMsg);
- }
- }
- }
- }
- }
- info.maxFlagsWidth = std::min(info.maxFlagsWidth, MAX_ARG_LINE_LENGTH);
-}
diff --git a/externals/nitro/externals/coda-oss/modules/c++/coda-oss-lite.vcxproj b/externals/nitro/externals/coda-oss/modules/c++/coda-oss-lite.vcxproj
deleted file mode 100644
index 2baf272d8..000000000
--- a/externals/nitro/externals/coda-oss/modules/c++/coda-oss-lite.vcxproj
+++ /dev/null
@@ -1,513 +0,0 @@
-
-
-
-
- Debug
- x64
-
-
- Release
- x64
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Create
- Create
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 16.0
- Win32Proj
- {9997e895-5161-4ddf-8f3f-099894cb2f21}
- codaoss
- 10.0
- coda-oss-lite
-
-
-
- DynamicLibrary
- true
- v143
-
-
- DynamicLibrary
- false
- v143
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- true
- AllRules.ruleset
-
-
- false
-
-
-
- EnableAllWarnings
- true
- _DEBUG;_LIB;%(PreprocessorDefinitions);CODA_OSS_EXPORTS;CODA_OSS_DLL;MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1
- pch.h
- cli\include\;coda_oss\include;config\include\;except\include\;gsl\include\;io\include\;logging\include\;math\include\;math.linear\include\;math.poly\include\;mem\include\;mt\include\;plugin\include\;polygon\include\;re\include\;sio.lite\include\;std\include\;str\include\;sys\include\;tiff\include;types\include\;units\include\
- Use
- pch.h
- true
- Guard
- ProgramDatabase
- true
- true
- true
- true
- true
- /Zc:__cplusplus %(AdditionalOptions)
- true
-
-
-
-
- true
-
-
-
-
- Level3
- true
- true
- true
- NDEBUG;_LIB;%(PreprocessorDefinitions);CODA_OSS_EXPORTS;CODA_OSS_DLL;MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1
- pch.h
- cli\include\;coda_oss\include;config\include\;except\include\;gsl\include\;io\include\;logging\include\;math\include\;math.linear\include\;math.poly\include\;mem\include\;mt\include\;plugin\include\;polygon\include\;re\include\;sio.lite\include\;std\include\;str\include\;sys\include\;tiff\include;types\include\;units\include\
- Use
- pch.h
- true
- Guard
- true
- true
- true
- true
- true
- /Zc:__cplusplus %(AdditionalOptions)
-
-
-
-
- true
- true
- true
-
-
-
-
-
-
\ No newline at end of file
diff --git a/externals/nitro/externals/coda-oss/modules/c++/coda-oss-lite.vcxproj.filters b/externals/nitro/externals/coda-oss/modules/c++/coda-oss-lite.vcxproj.filters
deleted file mode 100644
index 1e84491f2..000000000
--- a/externals/nitro/externals/coda-oss/modules/c++/coda-oss-lite.vcxproj.filters
+++ /dev/null
@@ -1,1229 +0,0 @@
-
-
-
-
-
-
- config
-
-
- config
-
-
- gsl
-
-
- gsl
-
-
- gsl
-
-
- gsl
-
-
- coda_oss
-
-
- coda_oss
-
-
- coda_oss
-
-
- coda_oss
-
-
- coda_oss
-
-
- coda_oss
-
-
- coda_oss
-
-
- coda_oss
-
-
- coda_oss
-
-
- coda_oss
-
-
- coda_oss
-
-
- except
-
-
- except
-
-
- except
-
-
- except
-
-
- except
-
-
- except
-
-
- except
-
-
- str
-
-
- str
-
-
- str
-
-
- str
-
-
- str
-
-
- str
-
-
- str
-
-
- str
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- types
-
-
- types
-
-
- types
-
-
- types
-
-
- types
-
-
- mem
-
-
- mem
-
-
- mem
-
-
- mem
-
-
- mem
-
-
- mem
-
-
- mem
-
-
- mem
-
-
- mem
-
-
- mem
-
-
- mem
-
-
- mem
-
-
- mem
-
-
- mem
-
-
- math
-
-
- math
-
-
- math
-
-
- math
-
-
- math
-
-
- units
-
-
- units
-
-
- units
-
-
- math.linear
-
-
- math.linear
-
-
- math.linear
-
-
- math.linear
-
-
- math.linear
-
-
- math.linear
-
-
- math.poly
-
-
- math.poly
-
-
- math.poly
-
-
- math.poly
-
-
- math.poly
-
-
- math.poly
-
-
- math.poly
-
-
- math.poly
-
-
- polygon
-
-
- polygon
-
-
- polygon
-
-
- config
-
-
- include
-
-
- cli
-
-
- cli
-
-
- cli
-
-
- cli
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- avx
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- re
-
-
- re
-
-
- re
-
-
- sio.lite
-
-
- sio.lite
-
-
- sio.lite
-
-
- sio.lite
-
-
- sio.lite
-
-
- sio.lite
-
-
- sio.lite
-
-
- sio.lite
-
-
- sio.lite
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- sio.lite
-
-
- sio.lite
-
-
- plugin
-
-
- plugin
-
-
- plugin
-
-
- sys
-
-
- mem
-
-
- mem
-
-
- std
-
-
- std
-
-
- std
-
-
- config
-
-
- sys
-
-
- sys
-
-
- mt
-
-
- sys
-
-
- sys
-
-
-
-
-
- except
-
-
- except
-
-
- except
-
-
- except
-
-
- str
-
-
- str
-
-
- str
-
-
- str
-
-
- str
-
-
- str
-
-
- str
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- sys
-
-
- types
-
-
- types
-
-
- mem
-
-
- mem
-
-
- math
-
-
- math
-
-
- math
-
-
- math.linear
-
-
- polygon
-
-
- cli
-
-
- cli
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- io
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- mt
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- logging
-
-
- re
-
-
- re
-
-
- sio.lite
-
-
- sio.lite
-
-
- sio.lite
-
-
- sio.lite
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- tiff
-
-
- plugin
-
-
- sys
-
-
- sys
-
-
-
-
- {89602880-5929-45e9-a603-d13f81972397}
-
-
- {619ad1da-f21c-4027-9b5d-23f08225b96f}
-
-
- {59f3d9a1-06d3-4779-aef2-cc55223c3017}
-
-
- {3051f4b6-dad4-47ea-b4bd-d25d9e09f782}
-
-
- {44a8dfa7-099c-4dd5-87b6-3b05ce13580b}
-
-
- {d714ac63-ef19-4629-a13f-59b550604842}
-
-
- {d8059280-e435-4365-be67-865195b9e813}
-
-
- {3613caf2-18d1-4af7-bfa0-a3712a44da45}
-
-
- {0e318d08-1ee3-4644-a299-a81e436c9a32}
-
-
- {6d8f380f-54e3-4d0d-bd1a-a2edd0efbaa7}
-
-
- {1bf84676-4c62-4e2b-b943-59bf82f89126}
-
-
- {b3d7f0e3-2e9f-4a19-b181-27cace7536c0}
-
-
- {15f9b62f-d17e-4d84-bc34-de6fd5fbcb33}
-
-
- {f2544ccb-0933-44c7-af39-cd986982af3d}
-
-
- {9050a469-23a5-4da0-92b1-a07a8e52e9fc}
-
-
- {de76f131-1cd6-4c3d-aa9c-37ca3b5079f0}
-
-
- {cc681a99-da96-483e-a92a-eab0ea3a0ec0}
-
-
- {4875d8c0-f285-460a-98a9-38a60f3fcffd}
-
-
- {9720bf2c-6d77-4685-9318-d6e714065c99}
-
-
- {9f9acff4-c149-4908-ae9d-67557974f4ee}
-
-
- {83ae731c-66f7-468c-bc71-7cb57a363b5b}
-
-
- {327a7b72-9a2d-48e4-9c23-2b5b9d2f3519}
-
-
- {d76b6d3f-51f8-4cf8-bc56-35f720080a8b}
-
-
- {387bc6cb-323a-42b3-8502-4fac72586d12}
-
-
-
-
- gsl
-
-
- gsl
-
-
- gsl
-
-
- gsl
-
-
- gsl
-
-
- gsl
-
-
- gsl
-
-
- gsl
-
-
- gsl
-
-
- gsl
-
-
- std
-
-
- std
-
-
- std
-
-
- std
-
-
- std
-
-
- std
-
-
- std
-
-
- std
-
-
- sys
-
-
-
\ No newline at end of file
diff --git a/externals/nitro/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/bit.h b/externals/nitro/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/bit.h
deleted file mode 100644
index 271935ab0..000000000
--- a/externals/nitro/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/bit.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* =========================================================================
- * This file is part of coda_oss-c++
- * =========================================================================
- *
- * (C) Copyright 2020-2022, Maxar Technologies, Inc.
- *
- * coda_oss-c++ is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; If not, http://www.gnu.org/licenses/.
- *
- */
-#pragma once
-#ifndef CODA_OSS_coda_oss_bit_h_INCLUDED_
-#define CODA_OSS_coda_oss_bit_h_INCLUDED_
-
-#include
-#include
-#ifdef __GNUC__
-#include // "These functions are GNU extensions."
-#endif
-
-#include
-
-#include "coda_oss/namespace_.h"
-namespace coda_oss
-{
- // https://en.cppreference.com/w/cpp/types/endian
- enum class endian
- {
- #ifdef _WIN32
- little = 0,
- big = 1,
- native = little
- #else
- little = __ORDER_LITTLE_ENDIAN__,
- big = __ORDER_BIG_ENDIAN__,
- native = __BYTE_ORDER__
- #endif
- };
-
- // https://en.cppreference.com/w/cpp/numeric/byteswap
- namespace details
- {
- // Overloads for common types
- inline constexpr uint8_t byteswap(uint8_t val) noexcept
- {
- return val; // no-op
- }
- #if defined(_MSC_VER)
- // These routines should generate a single instruction; see
- // https://devblogs.microsoft.com/cppblog/a-tour-of-4-msvc-backend-improvements/
- inline uint16_t byteswap(uint16_t val) noexcept
- {
- return _byteswap_ushort(val);
- }
- inline uint32_t byteswap(uint32_t val) noexcept
- {
- return _byteswap_ulong(val);
- }
- inline uint64_t byteswap(uint64_t val) noexcept
- {
- return _byteswap_uint64(val);
- }
- #elif defined(__GNUC__)
- inline uint16_t byteswap(uint16_t val) noexcept
- {
- return bswap_16(val);
- }
- inline uint32_t byteswap(uint32_t val) noexcept
- {
- return bswap_32(val);
- }
- inline uint64_t byteswap(uint64_t val) noexcept
- {
- return bswap_64(val);
- }
- #else
- #error "No platform-specific byteswap()" // TODO: do something else?
- #endif
- }
-
- template
- inline T byteswap(T n) noexcept
- {
- // "std::byteswap participates in overload resolution only if T satisfies integral, i.e., T is an integer type. The program is
- // ill-formed if T has padding bits."
- static_assert(std::is_integral::value, "T must be integral");
-
- using unsigned_t = std::make_unsigned_t; // "Since C++14" https://en.cppreference.com/w/cpp/types/make_unsigned
- return details::byteswap(static_cast(n));
- }
-}
-
-#endif // CODA_OSS_coda_oss_bit_h_INCLUDED_
diff --git a/externals/nitro/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/span.h b/externals/nitro/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/span.h
deleted file mode 100644
index 6aff3b5d5..000000000
--- a/externals/nitro/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/span.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* =========================================================================
- * This file is part of coda_oss-c++
- * =========================================================================
- *
- * (C) Copyright 2004 - 2014, MDA Information Systems LLC
- *
- * coda_oss-c++ is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; If not,
- * see .
- *
- */
-#pragma once
-#ifndef CODA_OSS_coda_oss_span_h_INCLUDED_
-#define CODA_OSS_coda_oss_span_h_INCLUDED_
-
-#include
-
-#include
-
-#include "coda_oss/namespace_.h"
-#include "coda_oss/span_.h"
-#include "coda_oss/cstddef.h" // byte
-
-// Need a fairly decent C++ compiler to use the real GSL. This brings in more than
-// we really need for span (e.g., gsl::narrow()), but it keeps things simple.
-#include "gsl/gsl.h" // not gsl/span; need #pragma here to turn off warnings
-
-namespace coda_oss
-{
-#if defined(GSL_SPAN_H) // the above #include'd gsl/span
- using gsl::span;
-#else // no gsl::span, use our own
- using details::span;
-#endif // GSL_SPAN_H
-
-// https://en.cppreference.com/w/cpp/container/span/as_bytes
-template
-inline auto as_bytes(span s) noexcept
-{
- // https://en.cppreference.com/w/cpp/types/is_trivially_copyable "... serialized to/from binary files ..."
- static_assert(std::is_trivially_copyable::value, "must be 'trivially' copyable.");
-
- const void* const p_ = s.data();
- auto const p = static_cast(p_);
- return span(p, s.size_bytes());
-}
-template
-inline auto as_bytes(span s) noexcept
-{
- const span s_(s.data(), s.size());
- return as_bytes(s_);
-}
-template
-inline span as_writable_bytes(span s) noexcept
-{
- // https://en.cppreference.com/w/cpp/types/is_trivially_copyable "... serialized to/from binary files ..."
- static_assert(std::is_trivially_copyable::value, "must be 'trivially' copyable.");
-
- static_assert(!std::is_const::value, "T cannot be 'const'");
-
- void* const p_ = s.data();
- auto const p = static_cast(p_);
- return span(p, s.size_bytes());
-}
-
-}
-
-#endif // CODA_OSS_coda_oss_span_h_INCLUDED_
diff --git a/externals/nitro/externals/coda-oss/modules/c++/config/include/config/Version.h b/externals/nitro/externals/coda-oss/modules/c++/config/include/config/Version.h
deleted file mode 100644
index 69944fc0b..000000000
--- a/externals/nitro/externals/coda-oss/modules/c++/config/include/config/Version.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* =========================================================================
- * This file is part of config-c++
- * =========================================================================
- *
- * (C) Copyright 2021, Maxar Technologies, Inc.
- *
- * config-c++ is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; If not,
- * see .
- *
- */
-#ifndef CODA_OSS_config_Version_h_INCLUDED_
-#define CODA_OSS_config_Version_h_INCLUDED_
-#pragma once
-
-#include
-
-// Using 1'0000 makes it easy to see the version number in the IDE.
-// Note that 1'000 or even 100 won't work of because 2019 (below) ... and it's nice having all fields be four digits
-#define CODA_OSS_VERSION_major_ static_cast(1000000000000) // 1'0000'0000'0000
-#define CODA_OSS_VERSION_minor_ static_cast (100000000) // 1'0000'0000
-#define CODA_OSS_VERSION_patch_ static_cast (10000) // 1'0000
-#define CODA_OSS_MAKE_VERSION_MMPB(major, minor, patch, build) (major * CODA_OSS_VERSION_major_) + (minor * CODA_OSS_VERSION_minor_) + (patch * CODA_OSS_VERSION_patch_) + build
-static_assert(CODA_OSS_MAKE_VERSION_MMPB(9999, 9999, 9999, 9999) <= UINT64_MAX, "version calculation is wrong.");
-#define CODA_OSS_MAKE_VERSION_MMP(major, minor, patch) CODA_OSS_MAKE_VERSION_MMPB(major, minor, patch, 0 /*build*/)
-
-#define CODA_OSS_GET_VERSION_MAJOR(version) ((version) / CODA_OSS_VERSION_major_)
-#define CODA_OSS_GET_VERSION_(version, factor) (((version) / factor) % static_cast(10000))
-#define CODA_OSS_GET_VERSION_MINOR(version) CODA_OSS_GET_VERSION_(version, CODA_OSS_VERSION_minor_)
-#define CODA_OSS_GET_VERSION_PATCH(version) CODA_OSS_GET_VERSION_(version, CODA_OSS_VERSION_patch_)
-#define CODA_OSS_GET_VERSION_BUILD(version) CODA_OSS_GET_VERSION_(version, 1 /*factor*/)
-
-// Do this ala C++ ... we don't currently have major/minor/patch
-//#define CODA_OSS_VERSION_ 20210910L // c.f. __cplusplus
-#define CODA_OSS_VERSION_ 2023 ## 0006 ## 0005 ## 0000 ## L
-
-// Use the same macros other projects might want to use; overkill for us.
-#define CODA_OSS_VERSION_MAJOR 2023
-#define CODA_OSS_VERSION_MINOR 6
-#define CODA_OSS_VERSION_PATCH 5
-#define CODA_OSS_VERSION_BUILD 0
-#define CODA_OSS_VERSION CODA_OSS_MAKE_VERSION_MMPB(CODA_OSS_VERSION_MAJOR, CODA_OSS_VERSION_MINOR, CODA_OSS_VERSION_PATCH, CODA_OSS_VERSION_BUILD)
-
-namespace config
-{
-constexpr auto coda_oss_version = CODA_OSS_VERSION;
-constexpr auto coda_oss_version_major = CODA_OSS_GET_VERSION_MAJOR(CODA_OSS_VERSION);
-constexpr auto coda_oss_version_minor = CODA_OSS_GET_VERSION_MINOR(CODA_OSS_VERSION);
-constexpr auto coda_oss_version_patch = CODA_OSS_GET_VERSION_PATCH(CODA_OSS_VERSION);
-constexpr auto coda_oss_version_build = CODA_OSS_GET_VERSION_BUILD(CODA_OSS_VERSION);
-
-// Be sure the macros above are correct
-static_assert(CODA_OSS_VERSION == CODA_OSS_VERSION_, "version calculation is wrong.");
-static_assert(CODA_OSS_VERSION == coda_oss_version, "version calculation is wrong.");
-static_assert(CODA_OSS_VERSION_MAJOR == coda_oss_version_major, "version calculation is wrong.");
-static_assert(CODA_OSS_VERSION_MINOR ==coda_oss_version_minor, "version calculation is wrong.");
-static_assert(CODA_OSS_VERSION_PATCH == coda_oss_version_patch, "version calculation is wrong.");
-static_assert(CODA_OSS_VERSION_BUILD == coda_oss_version_build, "version calculation is wrong.");
-}
-
-#endif // CODA_OSS_config_Version_h_INCLUDED_
\ No newline at end of file
diff --git a/externals/nitro/externals/coda-oss/modules/c++/mt/include/mt/RequestQueue.h b/externals/nitro/externals/coda-oss/modules/c++/mt/include/mt/RequestQueue.h
deleted file mode 100644
index ad33a53a1..000000000
--- a/externals/nitro/externals/coda-oss/modules/c++/mt/include/mt/RequestQueue.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/* =========================================================================
- * This file is part of mt-c++
- * =========================================================================
- *
- * (C) Copyright 2004 - 2014, MDA Information Systems LLC
- *
- * mt-c++ is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; If not,
- * see .
- *
- */
-
-#ifndef __MT_REQUEST_QUEUE_H__
-#define __MT_REQUEST_QUEUE_H__
-
-#include
-#include "sys/Thread.h"
-#include "sys/ConditionVar.h"
-#include "sys/Mutex.h"
-#include "sys/Dbg.h"
-
-namespace mt
-{
-
-/*!
- *
- * \class RequestQueue
- * \brief Locked, dual condition request queue
- *
- * This is a generic class for locked buffers. Stick
- * anything in T and it will be protected by a queue lock
- * and two condition variables. When you call dequeue, this
- * class blocks until there is data (there is a critical section).
- *
- * This class is the basis for the two provided thread pool APIs,
- * AbstractThreadPool and BasicThreadPool
- *
- *
- */
-
-template
-struct RequestQueue
-{
- //! Default constructor
- RequestQueue() :
- mAvailableSpace(&mQueueLock),
- mAvailableItems(&mQueueLock)
- {
- }
-
- // Put a (copy of, unless T is a pointer) request on the queue
- void enqueue(T request)
- {
-#ifdef THREAD_DEBUG
- dbg_printf("Locking (enqueue)\n");
-#endif
- mQueueLock.lock();
- mRequestQueue.push(request);
-#ifdef THREAD_DEBUG
- dbg_printf("Unlocking (enqueue), new size [%d]\n", mRequestQueue.size());
-#endif
- mQueueLock.unlock();
-
- mAvailableItems.signal();
- }
-
- // Retrieve (by reference) T from the queue. blocks until ok
- void dequeue(T& request)
- {
-#ifdef THREAD_DEBUG
- dbg_printf("Locking (dequeue)\n");
-#endif
- mQueueLock.lock();
- while (isEmpty())
- {
- mAvailableItems.wait();
- }
-
- request = mRequestQueue.front();
- mRequestQueue.pop();
-
-#ifdef THREAD_DEBUG
- dbg_printf("Unlocking (dequeue), new size [%d]\n", mRequestQueue.size());
-#endif
- mQueueLock.unlock();
- mAvailableSpace.signal();
- }
-
- // Check to see if its empty
- bool isEmpty() const
- {
- return mRequestQueue.empty();
- }
-
- // Check the length
- int length() const
- {
- return mRequestQueue.size();
- }
-
- void clear()
- {
-#ifdef THREAD_DEBUG
- dbg_printf("Locking (dequeue)\n");
-#endif
- mQueueLock.lock();
- while (!isEmpty())
- {
- mRequestQueue.pop();
- }
-
-#ifdef THREAD_DEBUG
- dbg_printf("Unlocking (dequeue), new size [%d]\n", mRequestQueue.size());
-#endif
- mQueueLock.unlock();
- mAvailableSpace.signal();
- }
-
- RequestQueue(const RequestQueue&) = delete;
- RequestQueue& operator=(const RequestQueue&) = delete;
-
-private:
- //! The internal data structure
- std::queue mRequestQueue;
- //! The synchronizer
- sys::Mutex mQueueLock;
- //! This condition is "is there space?"
- sys::ConditionVar mAvailableSpace;
- //! This condition is "is there an item?"
- sys::ConditionVar mAvailableItems;
-};
-
-typedef RequestQueue RunnableRequestQueue;
-}
-
-#endif // __MT_REQUEST_QUEUE_H__
diff --git a/externals/nitro/externals/coda-oss/modules/c++/net/source/URL.cpp b/externals/nitro/externals/coda-oss/modules/c++/net/source/URL.cpp
deleted file mode 100644
index 8791e0c6b..000000000
--- a/externals/nitro/externals/coda-oss/modules/c++/net/source/URL.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/* =========================================================================
- * This file is part of net-c++
- * =========================================================================
- *
- * (C) Copyright 2004 - 2014, MDA Information Systems LLC
- *
- * net-c++ is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; If not,
- * see .
- *
- */
-
-#include "net/URL.h"
-#include
-#include
-
-net::URL::URL(std::string url)
-{
- if (!url.empty())
- set(url);
-}
-
-net::URL& net::URL::operator=(const URL& url)
-{
- if (this != &url)
- {
- mProtocol = url.getProtocol();
- mHost = url.getHost();
- setPort(url.getPort());
- mPath = url.getPath();
- mFragment = url.getFragment();
- mParams = net::URLParams(url.getParams().toString());
- }
- return *this;
-}
-net::URL::URL(const URL& url)
-{
- *this = url;
-}
-
-void net::URL::set(std::string url)
-{
- std::vector parts = net::urlSplit(url);
- mProtocol = parts[0];
- mHost = parts[1];
- setPort(parts[2].empty() ? -1 : str::toType(parts[2]));
- mPath = parts[3];
- std::string params = parts[4];
- mFragment = parts[5];
- mParams = net::URLParams(params);
-}
-
-void net::URL::setPort(int port)
-{
- mPort = port;
- if (mPort < 0)
- mPort = net::getStandardPort(getProtocol());
-}
-
-std::string net::URL::getProtocol() const
-{
- return mProtocol;
-}
-std::string net::URL::getHost() const
-{
- return mHost;
-}
-int net::URL::getPort() const
-{
- return mPort;
-}
-std::string net::URL::getPath() const
-{
- return mPath;
-}
-std::string net::URL::getFragment() const
-{
- return mFragment;
-}
-std::string net::URL::getQuery() const
-{
- return mParams.toString();
-}
-
-std::string net::URL::getDocument() const
-{
- std::ostringstream doc;
- std::string path = getPath();
- if (!str::startsWith(path, "/"))
- doc << "/";
- doc << path;
- std::string query = getQuery();
- if (!query.empty())
- doc << "?" << query;
- std::string fragment = getFragment();
- if (!fragment.empty())
- doc << "#" << fragment;
- return doc.str();
-}
-
-std::string net::URL::getServer() const
-{
- std::ostringstream server;
- server << getHost();
- int port = getPort();
- if (port >= 0)
- server << ":" << port;
- return server.str();
-}
-
-std::string net::URL::toString() const
-{
- return net::urlJoin(getProtocol(), getHost(), getPort(), getPath(),
- getQuery(), getFragment());
-}
-
-bool net::URL::operator==(const net::URL& url) const
-{
- return toString() == url.toString();
-}
-
-net::URLParams::URLParams(std::string paramString)
-{
- if (!paramString.empty())
- {
- str::Tokenizer tokenizer(paramString, "&;"); //can be & or ;
- str::Tokenizer::Tokens& paramParts =
- (str::Tokenizer::Tokens&) tokenizer;
- for (size_t i = 0, size = paramParts.size(); i < size; ++i)
- {
- std::string param = paramParts[i];
- std::string val = "";
- size_t pos = param.find("=");
- if (pos > 0)
- {
- std::string key = param.substr(0, pos);
- val = (pos < (param.length() - 1)) ? param.substr(pos + 1) : "";
- param = key;
- }
- add(param, val);
- }
- }
-}
-
-bool net::URLParams::contains(std::string key) const
-{
- net::URLParams::Params::const_iterator it = mParams.find(key);
- return it != mParams.end() && it->second.size() > 0;
-}
-
-net::URLParams::ParamValues& net::URLParams::get(std::string key)
-{
- net::URLParams::Params::iterator it = mParams.find(key);
- if (it == mParams.end() || it->second.empty())
- throw except::NoSuchKeyException(Ctxt(key));
- return it->second;
-}
-
-const net::URLParams::ParamValues& net::URLParams::get(std::string key) const
-{
- net::URLParams::Params::const_iterator it = mParams.find(key);
- if (it == mParams.end() || it->second.empty())
- throw except::NoSuchKeyException(Ctxt(key));
- return it->second;
-}
-std::string net::URLParams::getFirst(std::string key) const
-{
- net::URLParams::Params::const_iterator it = mParams.find(key);
- if (it == mParams.end() || it->second.empty())
- throw except::NoSuchKeyException(Ctxt(key));
- return it->second.front();
-}
-void net::URLParams::add(std::string key, std::string value)
-{
- if (mParams.find(key) == mParams.end())
- mParams[key] = net::URLParams::ParamValues();
- mParams[key].push_back(value);
-}
-void net::URLParams::remove(std::string key)
-{
- if (mParams.find(key) != mParams.end())
- mParams.erase(key);
-}
-
-std::string net::URLParams::toString() const
-{
- std::ostringstream s;
- bool firstParam = true;
- for (net::URLParams::Params::const_iterator it = mParams.begin(); it
- != mParams.end(); ++it)
- {
- std::string key = it->first;
- const net::URLParams::ParamValues& vals = it->second;
- for (net::URLParams::ParamValues::const_iterator it2 = vals.begin(); it2
- != vals.end(); ++it2)
- {
- if (!firstParam)
- s << "&";
- s << net::quote(key) << "=" << net::quote(*it2);
- firstParam = false;
- }
- }
- return s.str();
-}
diff --git a/externals/nitro/externals/coda-oss/modules/c++/polygon/include/polygon/Intersections.h b/externals/nitro/externals/coda-oss/modules/c++/polygon/include/polygon/Intersections.h
deleted file mode 100644
index d73ac1f6d..000000000
--- a/externals/nitro/externals/coda-oss/modules/c++/polygon/include/polygon/Intersections.h
+++ /dev/null
@@ -1,288 +0,0 @@
-/* =========================================================================
- * This file is part of polygon-c++
- * =========================================================================
- *
- * (C) Copyright 2004 - 2019, MDA Information Systems LLC
- *
- * polygon-c++ is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; If not,
- * see .
- *
- */
-#ifndef __POLYGON_INTERSECTIONS_H__
-#define __POLYGON_INTERSECTIONS_H__
-
-#include
-#include
-#include
-
-#include
-#include
-
-namespace polygon
-{
-/*!
- * \class Intersections
- * \brief Given a list of points, draws lines between them to create a
- * polygon. Then, given a row, reports the columns that the resulting
- * polygon intersects that row at.
- * \tparam PointT Data type of points. Must be a floating type (float/double)
- * to work properly
- *
- * \note Implementation uses horizontal "scan lines" to determine
- * whether or not an element is inside the polygon's edges. As a result,
- * polygon vertices cannot be exactly on the scanlines. The polygon vertices
- * are bumped "down" if they have integral row indices to avoid falling
- * directly on a scanline. Since the fill algorithm is conservative,
- * horizontal-top-edges will typically not be filled in. For instance, a
- * square will have 1 pixel of its top edge missing.
- */
-template
-struct Intersections final
-{
- /*!
- * \class Intersection
- * \brief Represents an intersection
- */
- struct Intersection final
- {
- //! First (inclusive) column
- size_t first;
-
- //! Last (inclusive) column
- size_t last;
-
- //! \return Number of columns
- size_t length() const noexcept
- {
- return last - first + 1;
- }
- };
-
- /*!
- * \param points List of points
- * \param dims Dimensions to compute a polygon over. If the provided
- * points are not completely within these dimensions, the polygon will
- * simply be truncated at the dimension boundary.
- * \param offset Offset to apply to all input points. Positive row
- * value shifts the polygon up (equivalently the frame shifts down), and
- * positive col value shifts the polygon left (equiv. the frame shifts
- * right). Defaults to no offset.
- */
- Intersections(const std::vector >& points,
- const types::RowCol& dims,
- types::RowCol offset =
- types::RowCol(0, 0)) :
- mDims(dims)
- {
- if (!points.empty())
- {
- computeIntersections(points, dims, offset);
- }
- }
-
- /*!
- * \param row Row to get intersections for
- * \param[out] intersections Polygon intersections for this row. If the
- * vector is empty, that means the polygon does not intersect at this row.
- */
- void get(size_t row, std::vector& intersections) const
- {
- // Clear out any old intersections in the vector we're given
- intersections.clear();
-
- if (row >= mIntersections.size())
- {
- // Could be because of no points or this is a row greater than
- // we computed for
- return;
- }
-
- const std::vector& interRow(mIntersections[row]);
- if (interRow.empty() || interRow.size() % 2 != 0)
- {
- // No intersections on this row
- return;
- }
-
- const size_t numPairs = interRow.size() / 2;
- for (size_t pair = 0, idx = 0; pair < numPairs; ++pair)
- {
- double first = static_cast(interRow[idx++]);
- double last = static_cast(interRow[idx++]);
-
- // If the pair of intersections lies outside of the image,
- // there is no intersection for this pair.
- const auto lastCol = static_cast(mDims.col - 1);
- if ((first < 0.0 && last < 0.0) ||
- (first > lastCol && last > lastCol))
- {
- continue;
- }
-
- // Clamp the intersections to the image boundary
- first = std::max(0.0, std::min(lastCol, first));
- last = std::max(0.0, std::min(lastCol, last));
-
- Intersection intersection;
- intersection.first = static_cast(std::ceil(first));
- intersection.last = static_cast(std::floor(last));
-
- if(intersection.last > intersection.first)
- {
- intersections.push_back(intersection);
- }
- else
- {
- if (first < last)
- {
- // This happens when first = 55.01, last = 55.99
- // Then intersection.first = 56, intersection.last = 55
- // We should count 55 as an intersection
- intersection.first = intersection.last;
- intersections.push_back(intersection);
- }
- }
- }
- }
-
-private:
- void orderPoints(PointT& r0, PointT& c0, PointT& r1, PointT& c1)
- {
- if (r0 > r1)
- {
- std::swap(r0, r1);
- std::swap(c0, c1);
- }
- }
-
- void computeIntersections(
- const std::vector >& points,
- const types::RowCol& dims,
- types::RowCol offset)
- {
- std::vector > shiftedPoints(points);
- for (auto&& shiftedPoint : shiftedPoints)
- {
- // Get the polygon points with respect to the offset
- shiftedPoint -= offset;
-
- // TODO: The original implementation did this (plus subtracted 0.5
- // from each row and col which we're not doing here).
- // Without this small delta, if you have points that are
- // right on a row, we skip drawing some rows
- // (test_draw_polygon will illustrate this). I wonder if we
- // could tweak the sl0 and sl1 logic to avoid this.
- PointT& rowPoint(shiftedPoint.row);
- if (std::floor(rowPoint) == rowPoint)
- {
- // Add small amount to move it off the scan line
- rowPoint += 0.0001;
- }
- }
-
- // We need to get all scanline intersections of polygon edges
- mIntersections.resize(dims.row);
-
- const auto lastRow = gsl::narrow(dims.row) - 1;
-
- for (size_t ii = 0; ii < shiftedPoints.size(); ++ii)
- {
- PointT r1(shiftedPoints[ii].row);
- PointT c1(shiftedPoints[ii].col);
-
- const size_t idx = (ii == 0) ? shiftedPoints.size() - 1 : ii - 1;
- PointT r0(shiftedPoints[idx].row);
- PointT c0(shiftedPoints[idx].col);
-
- // Skip horizontal lines
- if (r1 == r0)
- {
- continue;
- }
-
- // Make sure r0 < r1
- orderPoints(r0, c0, r1, c1);
-
- // Find first and last scan line that we cross
- sys::SSize_T sl0 = static_cast(std::ceil(
- static_cast(r0)));
-
- sys::SSize_T sl1 = static_cast(std::floor(
- static_cast(r1)));
-
- // Skip rows where the edge intersects scan line outside of image
- // Have to do this carefully though... we can't just restrict both
- // sl0 and sl1 to be in the [0, lastRow] range because if they were
- // both negative or both > lastRow, we'd end up capping them both
- // in-bounds and going through the for loop below one time, putting
- // on a bogus point which is going to mess us up later.
- // Instead, first we do a sanity check to see if both points are out
- // of bounds... if so, we skip to the next set of points.
- if (sl0 > lastRow || sl1 < 0)
- {
- continue;
- }
-
- // Now that we know that at least some of our data is in bounds
- // we CAN cap to [0, lastRow].
- if (sl0 < 0)
- {
- sl0 = 0;
- }
- if (sl1 > lastRow)
- {
- sl1 = lastRow;
- }
-
- // Calculate rate of change
- const PointT dcdr = (c1 - c0) / (r1 - r0);
-
- // Calculate intersections
- // We do not clamp to the image dimensions at this time -- this is
- // done inside get(), and allows us to determine if intersection
- // pairs lie fully outside of the image. Clamping here ambiguates
- // that situation.
- for (sys::SSize_T row = sl0; row <= sl1; ++row)
- {
- const auto delt = static_cast(row) - r0;
- const auto sli = c0 + delt * dcdr;
- mIntersections[gsl::narrow(row)].push_back(sli);
- }
- }
-
- // We're going to need these sorted eventually - might as well do it
- // now
- for (size_t row = 0; row < mIntersections.size(); ++row)
- {
- std::vector& interRow(mIntersections[row]);
- if (interRow.size() % 2 == 0)
- {
- std::sort(interRow.begin(), interRow.end());
- }
- }
- }
-
- // `const` member data means copy/move must be implemented
- Intersections(const Intersections&) = delete;
- Intersections& operator=(const Intersections&) = delete;
- Intersections(Intersections&&) = delete;
- Intersections& operator=(Intersections&&) = delete;
-
-private:
- const types::RowCol mDims;
- std::vector > mIntersections;
-};
-}
-
-#endif
diff --git a/externals/nitro/externals/coda-oss/modules/c++/sio.lite/source/FileHeader.cpp b/externals/nitro/externals/coda-oss/modules/c++/sio.lite/source/FileHeader.cpp
deleted file mode 100644
index 8a7c8a40f..000000000
--- a/externals/nitro/externals/coda-oss/modules/c++/sio.lite/source/FileHeader.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-/* =========================================================================
- * This file is part of sio.lite-c++
- * =========================================================================
- *
- * (C) Copyright 2004 - 2014, MDA Information Systems LLC
- *
- * sio.lite-c++ is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; If not,
- * see .
- *
- */
-#include "sio/lite/FileHeader.h"
-
-// magic + nl + ne + et + es
-const int SIO_HEADER_LENGTH = 20;
-
-std::string sio::lite::FileHeader::getElementTypeAsString() const
-{
- std::string type;
- // Switch on the enumerated type and produce something useful
- switch ( et )
- {
- case UNSIGNED:
- type = "Unsigned byte";
- break;
- case SIGNED:
- type = "Signed byte";
- break;
- case FLOAT:
- type = "Float";
- break;
- case COMPLEX_UNSIGNED:
- type = "Complex unsigned";
- break;
- case COMPLEX_SIGNED:
- type = "Complex signed";
- break;
- case COMPLEX_FLOAT:
- type = "Complex float";
- break;
- case N_BYTE_UNSIGNED:
- type = "N-Byte unsigned";
- break;
- case N_BYTE_SIGNED:
- type = "N-Byte signed";
- break;
- default:
- type = "Unknown type";
-
- }
- return type;
-}
-
-long sio::lite::FileHeader::getLength() const
-{
- size_t length = SIO_HEADER_LENGTH;
-
- if (userData.size() > 0)
- length += 4; //num fields int
- for (sio::lite::UserDataDictionary::ConstIterator it = userData.begin();
- it != userData.end(); ++it)
- {
- length += 4; //key size
- length += it->first.length(); //key data
- if (idsAreNullTerminated())
- length += 1; //1 (null-byte)
- length += 4; //data size
- length += it->second.size(); //num bytes of data
- }
- return static_cast(length);
-}
-
-
-bool sio::lite::FileHeader::userDataFieldExists(const std::string& key) const
-{
- return userData.exists(key);
-}
-
-void sio::lite::FileHeader::getAllUserDataFields(
- std::vector& keys) const
-{
- for (sio::lite::UserDataDictionary::ConstIterator p = userData.begin();
- p != userData.end(); ++p)
- keys.push_back(p->first);
-}
-
-std::vector& sio::lite::FileHeader::getUserData(const std::string& key)
-{
- if (!userData.exists(key))
- throw except::NoSuchKeyException(key);
- return userData[key];
-}
-
-
-void sio::lite::FileHeader::to(size_t numBands, io::OutputStream& os)
-{
- if (numBands <= 0) numBands = 1;
- //compare the input numBands to the elementType
-
- int elementType = et;
- int elementSize = es;
-
- if (numBands > 2)
- {
- if (elementType == sio::lite::FileHeader::UNSIGNED)
- {
- elementType = sio::lite::FileHeader::N_BYTE_UNSIGNED;
- elementSize *= static_cast(numBands);
- }
- else if (elementType == sio::lite::FileHeader::SIGNED)
- {
- elementType = sio::lite::FileHeader::N_BYTE_SIGNED;
- elementSize *= static_cast(numBands);
- }
- /*!
- * To really handle this properly, we need to know
- * how to lay out the bands for them. For instance,
- * If the bands were 'interleaved by pixel' we would
- * expect that numElems would be multiplied by numBands
- *
- * For now, we punt...
- */
- else
- nl *= static_cast(numBands);
- }
-
- if (elementType != sio::lite::FileHeader::UNSIGNED && elementType != sio::lite::FileHeader::SIGNED &&
- elementType != sio::lite::FileHeader::FLOAT && elementType != sio::lite::FileHeader::COMPLEX_UNSIGNED &&
- elementType != sio::lite::FileHeader::COMPLEX_SIGNED && elementType != sio::lite::FileHeader::COMPLEX_FLOAT &&
- elementType != sio::lite::FileHeader::N_BYTE_UNSIGNED && elementType != sio::lite::FileHeader::N_BYTE_SIGNED)
- throw except::Exception(Ctxt("Unknown element type"));
-
- //update the version based on the user data fields
- version = getNumUserDataFields() > 0 ? 2 : 1;
-
- //construct the magic byte
- int magic = (255 - version) | 127 << 8 | version << 16 | 255 << 24;
-
- os.write((const sys::byte*)&magic, 4);
- os.write((const sys::byte*)&nl, 4);
- os.write((const sys::byte*)&ne, 4);
- os.write((const sys::byte*)&elementType, 4);
- os.write((const sys::byte*)&elementSize, 4);
-
- if (version > 1)
- writeUserData(os);
-}
-
-void sio::lite::FileHeader::writeUserData(io::OutputStream& os)
-{
- const auto numFields = static_cast(userData.size());
- os.write((const sys::byte*)&numFields, 4);
-
- for(sio::lite::UserDataDictionary::Iterator it = userData.begin();
- it != userData.end(); ++it)
- {
- std::string key = it->first;
- //add 1 for null-byte termination
- const auto keySize = static_cast(key.length() + 1);
- os.write((const sys::byte*)&keySize, 4);
- os.write((const sys::byte*)key.c_str(), keySize);
-
- std::vector& uData = it->second;
- const auto udSize = static_cast(uData.size());
- os.write((const sys::byte*)&udSize, 4);
-
- //Do we need to check for endian-ness and possibly byteswap???
- for (std::vector::iterator iter = uData.begin();
- iter != uData.end(); ++iter)
- {
- sys::byte x = *iter;
- os.write(&x, 1);
- }
- }
-}
-
-void sio::lite::FileHeader::addUserData(const std::string& field,
- const std::string& data)
-{
- const sys::byte* const begin =
- reinterpret_cast(data.c_str());
-
- const std::vector vec(begin, begin + data.length());
- userData.add(field, vec);
-}
-
-
-void sio::lite::FileHeader::addUserData(const std::string& field,
- const std::vector& data)
-{
- userData.add(field, data);
-}
-
-void sio::lite::FileHeader::addUserData(const std::string& field, int data)
-{
- std::vector vec;
- vec.reserve(sizeof(int));
- char* cData = (char*)&data;
- for (int i = 0, size = sizeof(int); i < size; ++i)
- vec.push_back((sys::byte)cData[i]);
- userData.add(field, vec);
-}
-
diff --git a/externals/nitro/externals/coda-oss/modules/c++/str/include/str/Format.h b/externals/nitro/externals/coda-oss/modules/c++/str/include/str/Format.h
deleted file mode 100644
index 240943807..000000000
--- a/externals/nitro/externals/coda-oss/modules/c++/str/include/str/Format.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* =========================================================================
- * This file is part of str-c++
- * =========================================================================
- *
- * (C) Copyright 2004 - 2014, MDA Information Systems LLC
- *
- * str-c++ is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; If not,
- * see .
- *
- */
-
-
-#ifndef __STR_FORMAT_H__
-#define __STR_FORMAT_H__
-
-#include
-#include
-
-#include "config/Exports.h"
-
-namespace str
-{
-
-/*!
- * \param format The format
- * \param ... Any printf like thing
- */
-CODA_OSS_API std::string format(const char* format, ...);
-
-struct CODA_OSS_API Format final
-{
- Format(const char* format, ...);
-
- operator std::string() const
- {
- return mString;
- }
-
- operator std::string& () noexcept
- {
- return mString;
- }
-
-protected:
- std::string mString;
-};
-
-}
-#endif
diff --git a/externals/nitro/externals/coda-oss/modules/c++/str/include/str/Manip.h b/externals/nitro/externals/coda-oss/modules/c++/str/include/str/Manip.h
deleted file mode 100644
index 0e942d91e..000000000
--- a/externals/nitro/externals/coda-oss/modules/c++/str/include/str/Manip.h
+++ /dev/null
@@ -1,210 +0,0 @@
-/* =========================================================================
- * This file is part of str-c++
- * =========================================================================
- *
- * (C) Copyright 2004 - 2014, MDA Information Systems LLC
- *
- * str-c++ is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; If not,
- * see .
- *
- */
-
-#ifndef __STR_MANIP_H__
-#define __STR_MANIP_H__
-
-#include
-#include
-
-#include
-#include
-
-#include "config/compiler_extensions.h"
-#include "config/Exports.h"
-#include "coda_oss/CPlusPlus.h"
-#include "coda_oss/string.h"
-#include "str/Convert.h"
-
-namespace str
-{
-
-CODA_OSS_disable_warning_push
-#if _MSC_VER
-#pragma warning(disable: 26460) //The reference argument 's' for function 'str::data' can be marked as const (con.3).
-#endif
- // non-const overload for .data() in C++17
-template
-inline CharT* data(std::basic_string& s) noexcept
-{
- return s.data();
-}
-CODA_OSS_disable_warning_pop
-template
-inline const CharT* data(const std::basic_string& s) noexcept // to make generic programming easier
-{
- return s.data();
-}
-
-/**
- * Trim the white space off the back and front of a string
- * @param s String to trim
- */
-CODA_OSS_API void trim(std::string& s);
-CODA_OSS_API std::string trim(const std::string& s);
-CODA_OSS_API void trim(coda_oss::u8string& s);
-CODA_OSS_API coda_oss::u8string trim(const coda_oss::u8string& s);
-
-/**
- * Checks the end of s with match
- * @param s String to check
- * @param match String to compare with
- * @return true if it matches, otherwise false
- */
-CODA_OSS_API bool endsWith(const std::string& s, const std::string& match);
-CODA_OSS_API bool ends_with(const std::string& s, const std::string&) noexcept;
-
-/**
- * Checks the start of s with match
- * @param s String to check
- * @param s String to compare with
- * @return true if it matches, otherwise false
- */
-CODA_OSS_API bool startsWith(const std::string& s, const std::string& match);
-CODA_OSS_API bool starts_with(const std::string& s, const std::string&) noexcept;
-
-
-/**
- * finds the first instance of "search" and
- * substitutes it for "replace", it then returns
- * the start of search, so you can loop and replace
- * all instances of "search".
- * @param str String to check
- * @param search String to search for
- * @param replace String to replace with
- * @param start starting position to start search
- * @return position of first find, str.length() if not found
- */
-CODA_OSS_API size_t replace(std::string& str,
- const std::string& search,
- const std::string& replace,
- size_t start = 0);
-
-/**
- * finds all instances of "search" and
- * substitutes them for "replace"
- * @param string String to check
- * @param search String to search for
- * @param replace String to replace with
- */
-CODA_OSS_API void replaceAll(std::string& string,
- const std::string& search,
- const std::string& replace);
-
-/**
- * Returns true if the string contains the match
- */
-CODA_OSS_API bool contains(const std::string& str, const std::string& match);
-
-
-/**
- * Returns true if the string contains only letters.
- */
-CODA_OSS_API bool isAlpha(const std::string& s);
-
-/**
- * Returns true if the string contains only letters and spaces.
- */
-CODA_OSS_API bool isAlphaSpace(const std::string& s);
-
-/**
- * Returns true if the string contains only digits. This does not include
- * decimal points.
- */
-CODA_OSS_API bool isNumeric(const std::string& s);
-
-/**
- * Returns true if the string contains only digits and spaces.
- */
-CODA_OSS_API bool isNumericSpace(const std::string& s);
-
-/**
- * Returns true if the string contains only whitespace characters (or empty).
- */
-CODA_OSS_API bool isWhitespace(const std::string& s);
-
-/**
- * Returns true if the string contains only letters and digits.
- */
-CODA_OSS_API bool isAlphanumeric(const std::string& s);
-
-/**
- * Returns true if the string contains only ASCII printable characters.
- */
-CODA_OSS_API bool isAsciiPrintable(const std::string& s);
-
-/**
- * Returns true if the string contains only the given allowed characters.
- */
-CODA_OSS_API bool containsOnly(const std::string& s, const std::string& validChars);
-
-/**
- * Splits a string based on a splitter string. Similar to tokenization, except
- * the splitter string can be of any length.
- * @param s String to check
- * @param splitter String to split upon
- * @return vector of strings
- */
-CODA_OSS_API std::vector split(const std::string& s,
- const std::string& splitter = " ",
- size_t maxSplit = std::string::npos);
-
-//! Uses std::transform to convert all chars to lower case
-//! Uses std::transform to convert all chars to upper case
-CODA_OSS_API void lower(std::string& s);
-CODA_OSS_API void upper(std::string& s);
-
-/*!
- * Replaces any characters that are invalid in XML (&, <, >, ', ") with their
- * escaped counterparts
- */
-CODA_OSS_API void escapeForXML(std::string& str);
-
-template
-inline std::string join(const std::vector& toks, const std::string& with)
-{
- if (toks.empty())
- return "";
-
- const auto len = toks.size();
- std::ostringstream oss;
- size_t i = 0;
- for (; i < len - 1; i++)
- {
- oss << str::toString(toks[i]) << with;
- }
- oss << str::toString(toks[i]);
- return oss.str();
-}
-
-// CASE INSENSTIVE string comparision routines.
-// Short names w/o a "case insenstive" indicator would seem OK as
-// normal (i.e., case sensitive) comparisons will use `==` and `!=` operators.
-//
-// Note that calling ne() directly can be faster than !eq() because the
-// comparison can stop as soon as a mis-match is found.
-CODA_OSS_API bool eq(const std::string& lhs, const std::string& rhs) noexcept;
-CODA_OSS_API bool ne(const std::string& lhs, const std::string& rhs) noexcept;
-
-}
-
-#endif
diff --git a/externals/nitro/externals/coda-oss/modules/c++/str/include/str/Tokenizer.h b/externals/nitro/externals/coda-oss/modules/c++/str/include/str/Tokenizer.h
deleted file mode 100644
index 4433b1fdc..000000000
--- a/externals/nitro/externals/coda-oss/modules/c++/str/include/str/Tokenizer.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* =========================================================================
- * This file is part of str-c++
- * =========================================================================
- *
- * (C) Copyright 2004 - 2014, MDA Information Systems LLC
- *
- * str-c++ is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; If not,
- * see .
- *
- */
-
-
-#ifndef __STR_TOKENIZER_H__
-#define __STR_TOKENIZER_H__
-
-/*!
- * \file Tokenizer.h
- * \brief A class functor for string tokenization
- *
- * Provides the implemenation of the Tokenizer class, which is
- * a function object that can do tokenization base on a delimiter
- *
- */
-
-#include
-#include
-
-namespace str
-{
-
-/*!
- * \class Tokenizer
- * \brief A class functor for string tokenization
- *
- * By specifying a set of delimiters and an input string,
- * the user can tokenize using this method.
- * example: vector v = Tokenizer(str, ";");
- *
- *
- */
-
-class Tokenizer
-{
-public:
- typedef std::vector Tokens;
- /*!
- * Constructor. Take a string to parse, and a delimiter set
- * \param str String to parse
- * \param delim string to divide str up using
- */
- Tokenizer(const std::string& str, const std::string& delim);
-
- /*!
- * Method to return the resultant vector
- * \return The vector that was created by the tokenizer
- */
- operator Tokenizer::Tokens& () noexcept
- {
- return vec;
- }
-protected:
- Tokenizer::Tokens vec;
-};
-
-}
-#endif
diff --git a/externals/nitro/externals/coda-oss/modules/c++/str/source/Manip.cpp b/externals/nitro/externals/coda-oss/modules/c++/str/source/Manip.cpp
deleted file mode 100644
index 33cbb47c1..000000000
--- a/externals/nitro/externals/coda-oss/modules/c++/str/source/Manip.cpp
+++ /dev/null
@@ -1,359 +0,0 @@
-/* =========================================================================
- * This file is part of str-c++
- * =========================================================================
- *
- * (C) Copyright 2004 - 2014, MDA Information Systems LLC
- *
- * str-c++ is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; If not,
- * see .
- *
- */
-#include "str/Manip.h"
-
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "str/Convert.h"
-#include "str/Encoding.h"
-
-namespace
-{
-char transformCheck(int c, int (*transform)(int))
-{
- // Ensure the character can be represented
- // as an unsigned char or is 'EOF', as the
- // behavior for all other characters is undefined
- if ((c >= 0 && c <= UCHAR_MAX) || c == EOF)
- {
- return static_cast(transform(c));
- }
- else
- {
- // Invalid char for transform: no-op
- return static_cast(c);
- }
-}
-
-char tolowerCheck(char c)
-{
- return transformCheck(c, tolower);
-}
-
-char toupperCheck(char c)
-{
- return transformCheck(c, toupper);
-}
-}
-
-
-namespace str
-{
-
-// TODO: https://stackoverflow.com/questions/31959532/best-way-to-remove-white-spaces-from-stdstring
-template
-inline void trim_(std::basic_string & s)
-{
- size_t i;
- for (i = 0; i < s.length(); i++)
- {
- if (!iswspace(static_cast(s[i])))
- break;
- }
- s.erase(0, i);
-
- for (i = s.length() - 1; (int) i >= 0; i--)
- {
- if (!iswspace(static_cast(s[i])))
- break;
-
- }
- if (i + 1 < s.length())
- s.erase(i + 1);
-}
-void trim(std::string& s)
-{
- trim_(s);
-}
-std::string trim(const std::string& str)
-{
- auto retval = str;
- trim(retval);
- return retval;
-}
-void trim(coda_oss::u8string& s)
-{
- trim_(s);
-}
-coda_oss::u8string trim(const coda_oss::u8string& str)
-{
- auto retval = str;
- trim(retval);
- return retval;
-}
-
-bool ends_with(const std::string& s, const std::string& match) noexcept
-{
- const size_t mLen = match.length();
- const size_t sLen = s.length();
- for (size_t i = 0; i < sLen && i < mLen; ++i)
- if (!(s[sLen - i - 1] == match[mLen - i - 1]))
- return false;
- return sLen >= mLen;
-}
-bool endsWith(const std::string& s, const std::string& match)
-{
- return ends_with(s, match);
-}
-
-bool starts_with(const std::string& s, const std::string& match) noexcept
-{
- const size_t mLen = match.length();
- const size_t sLen = s.length();
- for (size_t i = 0; i < sLen && i < mLen; ++i)
- if (!(s[i] == match[i]))
- return false;
- return sLen >= mLen;
-}
-bool startsWith(const std::string& s, const std::string& match)
-{
- return starts_with(s, match);
-}
-
-size_t replace(std::string& str,
- const std::string& search,
- const std::string& replace,
- size_t start)
-{
- size_t index = str.find(search, start);
-
- if (index != std::string::npos)
- {
- // ASAN error: str.replace(index, search.length(), replace);
- str = str.substr(0, index) + replace + str.substr(index + search.length());
- start = index;
- }
- else
- {
- start = str.length();
- }
-
- return start;
-}
-
-void replaceAll(std::string& string,
- const std::string& search,
- const std::string& replace)
-{
- size_t start = 0;
- while (start < string.length())
- {
- start = str::replace(string, search, replace, start);
- // skip ahead --
- // avoids inifinite loop if replace contains search
- start += replace.length();
- }
-}
-
-bool contains(const std::string& str, const std::string& match)
-{
- return str.find(match) != std::string::npos;
-}
-
-static inline bool isTest(const std::string& s, int (*is)(int))
-{
- for (const auto& ch : s)
- {
- if (!is(ch))
- return false;
- }
- return !s.empty();
-}
-
-bool isAlpha(const std::string& s)
-{
- return isTest(s, isalpha);
-}
-
-template
-static inline bool isTest(const std::string& s, int (*is1)(int), Pred is2)
-{
- for (const auto& ch : s)
- {
- if (!is1(ch) && !is2(ch))
- return false;
- }
- return !s.empty();
-}
-
-bool isAlphaSpace(const std::string& s)
-{
- return isTest(s, isalpha, isspace);
-}
-
-bool isNumeric(const std::string& s)
-{
- return isTest(s, isdigit);
-}
-
-bool isNumericSpace(const std::string& s)
-{
- return isTest(s, isdigit, isspace);
-}
-
-bool isWhitespace(const std::string& s)
-{
- for (const auto& ch : s)
- {
- if (!isspace(ch))
- return false;
- }
- return true;
-}
-
-bool isAlphanumeric(const std::string& s)
-{
- return isTest(s, isalpha, isdigit);
-}
-
-bool isAsciiPrintable(const std::string& s)
-{
- for (const auto& ch : s)
- {
- char c = ch;
- if (c < 32 || c > 126)
- return false;
- }
- return true;
-}
-
-bool containsOnly(const std::string& s, const std::string& validChars)
-{
- typedef std::string::const_iterator StringIter;
- std::vector chars(255, false);
- for (StringIter it = validChars.begin(); it != validChars.end(); ++it)
- chars[(unsigned int)*it] = true;
- for (StringIter it = s.begin(); it != s.end(); ++it)
- if (!chars[(unsigned int)*it])
- return false;
- return true;
-}
-
-std::vector split(const std::string& s,
- const std::string& splitter, size_t maxSplit)
-{
- std::vector < std::string > vec;
- const auto str_l = s.length();
- const auto split_l = splitter.length();
- size_t pos = 0;
- while (pos < str_l && maxSplit != 1)
- {
- auto nextPos = s.find(splitter, pos);
- if (nextPos == std::string::npos)
- nextPos = str_l;
- if (nextPos != pos)
- vec.push_back(s.substr(pos, nextPos - pos));
- pos = nextPos + split_l;
- if (maxSplit != std::string::npos && vec.size() >= maxSplit - 1)
- break;
- }
-
- if (pos < str_l)
- vec.push_back(s.substr(pos));
-
- return vec;
-}
-template
-inline void transform(std::basic_string& s, Fn f)
-{
- (void) std::transform(s.begin(), s.end(), s.begin(), f);
-}
-void lower(std::string& s)
-{
- transform(s, tolowerCheck);
-}
-void upper(std::string& s)
-{
- transform(s, toupperCheck);
-}
-
-void escapeForXML(std::string& str)
-{
- // & needs to be first or else it'll mess up the other characters that we
- // replace
- replaceAll(str, "&", "&");
- replaceAll(str, "<", "<");
- replaceAll(str, ">", ">");
- replaceAll(str, "\"", """);
- replaceAll(str, "'", "'");
- replaceAll(str, "\n", "
");
- replaceAll(str, "\r", "
");
-}
-
-// https://en.cppreference.com/w/cpp/string/char_traits
-class ci_char_traits final : public std::char_traits
-{
- static auto to_upper(char ch) noexcept
- {
- return toupperCheck(ch);
- }
-
- static int compare(const char* s1, const char* s2, std::size_t n) noexcept
- {
- while (n-- != 0)
- {
- if (to_upper(*s1) < to_upper(*s2))
- return -1;
- if (to_upper(*s1) > to_upper(*s2))
- return 1;
- ++s1;
- ++s2;
- }
- return 0;
- }
-
- public:
- static int compare(const std::string& s1, const std::string& s2) noexcept
- {
- if (s1.length() < s2.length())
- {
- return -1;
- }
- if (s1.length() > s2.length())
- {
- return 1;
- }
- assert(s1.length() == s2.length());
- return compare(s1.c_str(), s2.c_str(), s1.length());
- }
-};
-
-bool eq(const std::string& lhs, const std::string& rhs) noexcept
-{
- return ci_char_traits::compare(lhs, rhs) == 0;
-}
-bool ne(const std::string& lhs, const std::string& rhs) noexcept
-{
- return ci_char_traits::compare(lhs, rhs) != 0;
-}
-
-}
diff --git a/externals/nitro/externals/coda-oss/modules/c++/str/unittests/test_str.cpp b/externals/nitro/externals/coda-oss/modules/c++/str/unittests/test_str.cpp
deleted file mode 100644
index 49e4a4894..000000000
--- a/externals/nitro/externals/coda-oss/modules/c++/str/unittests/test_str.cpp
+++ /dev/null
@@ -1,250 +0,0 @@
-/* =========================================================================
- * This file is part of str-c++
- * =========================================================================
- *
- * (C) Copyright 2004 - 2014, MDA Information Systems LLC
- *
- * str-c++ is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; If not,
- * see .
- *
- */
-
-#include // std::ignore
-
-#include
-#include
-#include "TestCase.h"
-
-inline std::string to_string(const std::string& value)
-{
- return value;
-}
-
-TEST_CASE(testTrim)
-{
- std::string s = " test ";
- str::trim( s);
- TEST_ASSERT_EQ(s, "test");
-}
-
-TEST_CASE(testData)
-{
- std::string s;
- // https://en.cppreference.com/w/cpp/string/basic_string/resize
- s.resize(3); // "Resizes the string to contain count characters."
-
- CODA_OSS_disable_warning_push
- #if _MSC_VER
- #pragma warning(disable : 4996) // '...': This function or variable may be unsafe. ...
- #endif
-
- // https://en.cppreference.com/w/cpp/string/basic_string/data
- // "Modifying the past-the-end null terminator stored at data()+size() to any value other than CharT() has undefined behavior."
- std::ignore = strcpy(str::data(s), "abc");
-
- CODA_OSS_disable_warning_pop
- TEST_ASSERT_EQ(s, "abc");
-}
-
-TEST_CASE(testUpper)
-{
- std::string s = "test-something1";
- str::upper( s);
- TEST_ASSERT_EQ(s, "TEST-SOMETHING1");
-}
-
-TEST_CASE(testLower)
-{
- std::string s = "TEST1";
- str::lower( s);
- TEST_ASSERT_EQ(s, "test1");
-}
-
-TEST_CASE(test_eq_ne)
-{
- const auto s1 = "TEST1";
- const auto s2 = "test1";
- const auto s3 = "T2";
-
- TEST_ASSERT_TRUE(str::eq(s1, s1));
- TEST_ASSERT_FALSE(str::ne(s1, s1));
-
- TEST_ASSERT_TRUE(str::eq(s1, s2));
- TEST_ASSERT_FALSE(str::ne(s1, s2));
- TEST_ASSERT_TRUE(str::eq(s2, s1));
- TEST_ASSERT_FALSE(str::ne(s2, s1));
-
- TEST_ASSERT_FALSE(str::eq(s1, s3));
- TEST_ASSERT_TRUE(str::ne(s1, s3));
- TEST_ASSERT_FALSE(str::eq(s3, s1));
- TEST_ASSERT_TRUE(str::ne(s3, s1));
-}
-
-TEST_CASE(testReplace)
-{
- std::string s = "helo world";
- str::replace(s, "l", "ll");
- TEST_ASSERT_EQ(s, "hello world");
-}
-
-TEST_CASE(testReplaceAllInfinite)
-{
- std::string s = "helo hello";
- str::replaceAll(s, "l", "ll");
- TEST_ASSERT_EQ(s, "hello hellllo");
-}
-
-TEST_CASE(testReplaceAllRecurse)
-{
- std::string s = "Mississippi";
- str::replaceAll(s, "i", " ");
- TEST_ASSERT_EQ(s, "M ss ss pp ");
-}
-
-TEST_CASE(testContains)
-{
- std::string s = "Mississippi";
- TEST_ASSERT_TRUE(str::contains(s, "ssiss"));
-}
-
-TEST_CASE(testNotContains)
-{
- std::string s = "Mississippi";
- TEST_ASSERT_FALSE(str::contains(s, "miss"));
-}
-
-TEST_CASE(testSplit)
-{
- std::string s = "space delimited values are the best!";
- std::vector parts = str::split(s, " ");
- TEST_ASSERT_EQ(parts.size(), static_cast(6));
- parts = str::split(s, " ", 3);
- TEST_ASSERT_EQ(parts.size(), static_cast(3));
- TEST_ASSERT_EQ(parts[2], "values are the best!");
-}
-
-TEST_CASE(testIsAlpha)
-{
- TEST_ASSERT(str::isAlpha("abcdefghijklmnopqrstuvwxyz"));
- TEST_ASSERT_FALSE(str::isAlpha("abc123"));
- TEST_ASSERT_FALSE(str::isAlpha("abcs with spaces"));
-}
-TEST_CASE(testIsAlphaSpace)
-{
- TEST_ASSERT(str::isAlphaSpace("abcdefghijklmnopqrstuvwxyz"));
- TEST_ASSERT_FALSE(str::isAlphaSpace("abc123"));
- TEST_ASSERT(str::isAlphaSpace("abcs with spaces"));
-}
-TEST_CASE(testIsNumeric)
-{
- TEST_ASSERT_FALSE(str::isNumeric("abcdefghijklmnopqrstuvwxyz"));
- TEST_ASSERT_FALSE(str::isNumeric("abc123"));
- TEST_ASSERT_FALSE(str::isNumeric("abcs with spaces"));
- TEST_ASSERT(str::isNumeric("42"));
-}
-TEST_CASE(testIsNumericSpace)
-{
- TEST_ASSERT_FALSE(str::isNumericSpace("lotto47"));
- TEST_ASSERT(str::isNumericSpace("42"));
- TEST_ASSERT(str::isNumericSpace("42 15 23 5 12"));
-}
-TEST_CASE(testIsAlphanumeric)
-{
- TEST_ASSERT(str::isAlphanumeric("lotto47"));
- TEST_ASSERT(str::isAlphanumeric("42"));
- TEST_ASSERT_FALSE(str::isAlphanumeric("42 15 23 5 12"));
- TEST_ASSERT(str::isAlphanumeric("justtext"));
-}
-TEST_CASE(testIsWhitespace)
-{
- TEST_ASSERT_FALSE(str::isWhitespace("lotto47"));
- TEST_ASSERT(str::isWhitespace(""));
- TEST_ASSERT(str::isWhitespace(" "));
- TEST_ASSERT(str::isWhitespace(" "));
- TEST_ASSERT(str::isWhitespace("\t"));
- TEST_ASSERT(str::isWhitespace("\t \n"));
-}
-TEST_CASE(testContainsOnly)
-{
- TEST_ASSERT(str::containsOnly("abc", "abcdefghijklmnopqrstuvwxyz"));
- TEST_ASSERT_FALSE(str::containsOnly("abc!", "abcdefghijklmnopqrstuvwxyz"));
- TEST_ASSERT(str::containsOnly("some-cool-id", "-abcdefghijklmnopqrstuvwxyz"));
- TEST_ASSERT(str::containsOnly("\n\r\t ", " \t\n\r0123456789"));
- TEST_ASSERT(str::containsOnly("1-2-3", " \t\n\r0123456789-"));
-}
-TEST_CASE(testRoundDouble)
-{
- double eps = std::numeric_limits::epsilon();
- double numerator = 10005.0;
- double denom = 10007.0;
- double v = numerator / denom;
- std::string s = str::toString(v);
- std::cout << s << std::endl;
-
- double nv = str::toType(s);
- TEST_ASSERT_ALMOST_EQ_EPS(nv, v, eps);
- nv *= denom;
- TEST_ASSERT_ALMOST_EQ_EPS(nv, numerator, eps);
- std::cout << nv << std::endl;
- std::cout << (nv - (int)nv) << std::endl;
- std::cout << std::numeric_limits::epsilon() << std::endl;
- TEST_ASSERT_EQ((int)std::ceil(nv), (int)numerator);
-}
-
-TEST_CASE(testEscapeForXMLNoReplace)
-{
- const std::string origMessage("This is a perfectly fine string");
- std::string message(origMessage);
- str::escapeForXML(message);
- TEST_ASSERT_EQ(message, origMessage);
-}
-
-TEST_CASE(testEscapeForXMLKitchenSink)
-{
- std::string message(
- "This & that with and \"quotes\" & single 'quotes' & "
- "why not a\nnewline & \rcarriage return at the end?");
-
- const std::string expectedMessage(
- "This & that with <angles> and "quotes" & "
- "single 'quotes' & why not a
newline & "
- "
carriage return at the end?");
-
- str::escapeForXML(message);
- TEST_ASSERT_EQ(message, expectedMessage);
-}
-
-TEST_MAIN(
- TEST_CHECK(testTrim);
- TEST_CHECK(testData);
- TEST_CHECK(testUpper);
- TEST_CHECK(testLower);
- TEST_CHECK(test_eq_ne);
- TEST_CHECK(testReplace);
- TEST_CHECK(testReplaceAllInfinite);
- TEST_CHECK(testReplaceAllRecurse);
- TEST_CHECK(testContains);
- TEST_CHECK(testNotContains);
- TEST_CHECK(testSplit);
- TEST_CHECK(testIsAlpha);
- TEST_CHECK(testIsAlphaSpace);
- TEST_CHECK(testIsNumeric);
- TEST_CHECK(testIsNumericSpace);
- TEST_CHECK(testIsAlphanumeric);
- TEST_CHECK(testIsWhitespace);
- TEST_CHECK(testContainsOnly);
- TEST_CHECK(testRoundDouble);
- TEST_CHECK(testEscapeForXMLNoReplace);
- TEST_CHECK(testEscapeForXMLKitchenSink);
- )
\ No newline at end of file
diff --git a/externals/nitro/externals/coda-oss/modules/c++/sys/include/sys/AtomicCounterCpp11.h b/externals/nitro/externals/coda-oss/modules/c++/sys/include/sys/AtomicCounterCpp11.h
deleted file mode 100644
index ce785869f..000000000
--- a/externals/nitro/externals/coda-oss/modules/c++/sys/include/sys/AtomicCounterCpp11.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* =========================================================================
- * This file is part of sys-c++
- * =========================================================================
- *
- * (C) Copyright 2021, Maxar Technologies, Inc.
- *
- * sys-c++ is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; If not,
- * see .
- *
- */
-
-#ifndef CODA_OSS_sys_AtomicCounterCpp11_h_INCLUDED_
-#define CODA_OSS_sys_AtomicCounterCpp11_h_INCLUDED_
-#pragma once
-
-#include
-
-#include // C++11: https://en.cppreference.com/w/cpp/atomic/atomic
-
-namespace sys
-{
-/*!
- * \class AtomicCounter
- * \brief This class provides atomic incrementing, decrementing, and setting
- * of an unsigned integer. All operations are thread-safe.
- */
-struct AtomicCounterImplCpp11 final
-{
- using ValueType = size_t ;
-
- explicit AtomicCounterImplCpp11(ValueType initialValue) noexcept :
- mValue(initialValue)
- {
- }
-
- ValueType getThenIncrement() noexcept
- {
- // https://en.cppreference.com/w/cpp/atomic/atomic/fetch_add
- return mValue.fetch_add(1);
- }
-
- ValueType getThenDecrement() noexcept
- {
- // https://en.cppreference.com/w/cpp/atomic/atomic/fetch_sub
- return mValue.fetch_sub(1);
- }
-
- ValueType get() const noexcept
- {
- // https://en.cppreference.com/w/cpp/atomic/atomic/load
- return mValue.load();
- }
-
- AtomicCounterImplCpp11(const AtomicCounterImplCpp11&) = delete;
- AtomicCounterImplCpp11& operator=(const AtomicCounterImplCpp11&) = delete;
-
-private:
- std::atomic mValue;
-};
-}
-
-#endif // CODA_OSS_sys_AtomicCounterCpp11_h_INCLUDED_
diff --git a/externals/nitro/externals/coda-oss/modules/c++/sys/include/sys/ByteSwap.h b/externals/nitro/externals/coda-oss/modules/c++/sys/include/sys/ByteSwap.h
deleted file mode 100644
index 6b135288d..000000000
--- a/externals/nitro/externals/coda-oss/modules/c++/sys/include/sys/ByteSwap.h
+++ /dev/null
@@ -1,298 +0,0 @@
-/* =========================================================================
- * This file is part of sys-c++
- * =========================================================================
- *
- * (C) Copyright 2004 - 2014, MDA Information Systems LLC
- * (C) Copyright 2023, Maxar Technologies, Inc.
- *
- * sys-c++ is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; If not,
- * see .
- *
- */
-
-#pragma once
-#ifndef CODA_OSS_sys_ByteSwap_h_INCLUDED_
-#define CODA_OSS_sys_ByteSwap_h_INCLUDED_
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-#include "config/Exports.h"
-
-#include "ByteSwapValue.h"
-#include "Runnable.h"
-#include "SysInt.h"
-
-namespace sys
-{
-/*!
- * Swap bytes in-place. Note that a complex pixel
- * is equivalent to two floats so elemSize and numElems
- * must be adjusted accordingly.
- *
- * \param [inout] buffer to transform
- * \param elemSize
- * \param numElems
- */
-coda_oss::span CODA_OSS_API byteSwap(coda_oss::spanbuffer, size_t elemSize);
-void CODA_OSS_API byteSwap(void* buffer, size_t elemSize, size_t numElems);
-
-// If the caller has given us bytes, assume she knows what she's doing; i.e., don't check sizeof(T)
-template
-inline void byteSwap_(TByte* buffer, size_t elemSize, size_t numElems)
-{
- void* const buffer_ = buffer;
- byteSwap(buffer_, elemSize, numElems);
-}
-inline void byteSwap(coda_oss::byte* buffer, size_t elemSize, size_t numElems)
-{
- return byteSwap_(buffer, elemSize, numElems);
-}
-inline void byteSwap(byte* buffer, size_t elemSize, size_t numElems)
-{
- return byteSwap_(buffer, elemSize, numElems);
-}
-inline void byteSwap(ubyte* buffer, size_t elemSize, size_t numElems)
-{
- return byteSwap_(buffer, elemSize, numElems);
-}
-
-namespace details
-{
-template
-inline void check_elemSize(size_t elemSize)
-{
- static_assert(is_byte_swappable(), "T should not be a 'struct'");
- if (sizeof(T) != elemSize)
- {
- throw std::invalid_argument("'elemSize' != sizeof(T)");
- }
-}
-
-// Repackage into a span; the size is 2* because for byte-swapping
-// we want to look at this as an array of `T`, not `std::complex`.
-template
-inline auto make_span(coda_oss::span> s)
-{
- const void* const p_ = s.data();
- auto const p = static_cast(p_);
- const auto sz = s.size() * 2; // real and imag
- return sys::make_span(p, sz);
-}
-template
-inline auto make_span(coda_oss::span> s)
-{
- void* const p_ = s.data();
- auto const p = static_cast(p_);
- const auto sz = s.size() * 2; // real and imag
- return sys::make_span(p, sz);
-}
-
-}
-
-// Otherwise, we can sanity-check the `elemSize` parameter
-template
-inline void byteSwap(T* buffer, size_t elemSize, size_t numElems)
-{
- details::check_elemSize(elemSize);
- void* const buffer_ = buffer;
- byteSwap(buffer_, elemSize, numElems);
-}
-template
-inline void byteSwap(std::complex* buffer, size_t elemSize, size_t numElems) // dont't want `T` as `std::complex<...>`
-{
- details::check_elemSize(elemSize);
- void* const buffer_ = buffer;
- byteSwap(buffer_, elemSize, numElems);
-}
-
-template
-inline auto byteSwap(coda_oss::span buffer)
-{
- static_assert(!std::is_const::value, "T cannot be 'const'");
- static_assert(details::is_byte_swappable(), "T should not be a 'struct'");
- return byteSwap(as_writable_bytes(buffer), sizeof(T));
-}
-
-// Take care of treating std::complex as T[]
-template
-inline auto byteSwap(coda_oss::span> buffer)
-{
- return byteSwap(details::make_span(buffer));
-}
-
-/*!
- * Swap bytes into output buffer. Note that a complex pixel
- * is equivalent to two floats so elemSize and numElems
- * must be adjusted accordingly.
- *
- * \param buffer to transform
- * \param elemSize
- * \param numElems
- * \param[out] outputBuffer buffer to write swapped elements to
- */
-coda_oss::span CODA_OSS_API byteSwap(coda_oss::span buffer,
- size_t elemSize, coda_oss::span outputBuffer);
-void CODA_OSS_API byteSwap(const void* buffer, size_t elemSize, size_t numElems, void* outputBuffer);
-
-// If the caller has given us bytes, assume she knows what she's doing; i.e., don't check sizeof(T)
-template
-inline void byteSwap_(const TByte* buffer, size_t elemSize, size_t numElems, U* outputBuffer)
-{
- const void* const buffer_ = buffer;
- void* const outputBuffer_ = outputBuffer;
- byteSwap(buffer_, elemSize, numElems, outputBuffer_);
-}
-template
-inline void byteSwap(const coda_oss::byte* buffer, size_t elemSize, size_t numElems, U* outputBuffer)
-{
- byteSwap_(buffer, elemSize, numElems, outputBuffer);
-}
-template
-inline void byteSwap(const byte* buffer, size_t elemSize, size_t numElems, U* outputBuffer)
-{
- byteSwap_(buffer, elemSize, numElems, outputBuffer);
-}
-template
-inline void byteSwap(const ubyte* buffer, size_t elemSize, size_t numElems, U* outputBuffer)
-{
- byteSwap_(buffer, elemSize, numElems, outputBuffer);
-}
-
-// Otherwise, we can sanity-check the `elemSize` parameter
-template
-inline void byteSwap(const T* buffer, size_t elemSize, size_t numElems, U* outputBuffer)
-{
- details::check_elemSize(elemSize);
- const void* const buffer_ = buffer;
- void* const outputBuffer_ = outputBuffer;
- byteSwap(buffer_, elemSize, numElems, outputBuffer_);
-}
-template
-inline void byteSwap(const std::complex* buffer, size_t elemSize, size_t numElems, U* outputBuffer) // dont't want `T` as `std::complex<...>`
-{
- details::check_elemSize(elemSize);
- const void* const buffer_ = buffer;
- void* const outputBuffer_ = outputBuffer;
- byteSwap(buffer_, elemSize, numElems, outputBuffer_);
-}
-
-template
-inline auto byteSwap(coda_oss::span buffer, coda_oss::span outputBuffer)
-{
- static_assert(details::is_byte_swappable(), "T should not be a 'struct'");
- return byteSwap(as_bytes(buffer), sizeof(T), outputBuffer);
-}
-// Take care of treating std::complex as T[]
-template
-inline auto byteSwap(coda_oss::span> buffer, coda_oss::span outputBuffer)
-{
- return byteSwap(details::make_span(buffer), outputBuffer);
-}
-
-template
-inline auto byteSwap(coda_oss::span buffer)
-{
- std::vector retval(buffer.size_bytes());
- std::ignore = byteSwap(buffer, make_span(retval));
- return retval;
-}
-// Take care of treating std::complex as T[]
-template
-inline auto byteSwap(coda_oss::span> buffer)
-{
- return byteSwap(details::make_span(buffer));
-}
-
-// With buffer byte-swap now in place, we can safely byte-swap std::complex.
-// This signature is from ByteSwapValue.h
-template
-inline auto byteSwapValue(std::complex z)
-{
- // C++ mandates that `std::complex` be the same as `T cx[2]`; that is
- // the structure is contiguous. https://en.cppreference.com/w/cpp/numeric/complex
- const auto& z_ = reinterpret_cast(z);
- return byteSwap(make_span(z_));
-}
-template
-inline auto byteSwap(std::complex val)
-{
- const auto bytes = byteSwapValue(val);
- assert(bytes.size() == sizeof(val));
-
- const void* const pBytes = bytes.data();
- auto const pRetVal = static_cast*>(pBytes);
- return *pRetVal;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-struct ByteSwapRunnable final : public sys::Runnable
-{
- ByteSwapRunnable(void* buffer, size_t elemSize, size_t startElement, size_t numElements) noexcept :
- mBuffer(static_cast(buffer) + startElement * elemSize),
- mElemSize(elemSize), mNumElements(numElements)
- {
- }
- void run() override
- {
- byteSwap(mBuffer, mElemSize, mNumElements);
- }
-
- virtual ~ByteSwapRunnable() = default;
- ByteSwapRunnable(const ByteSwapRunnable&) = delete;
- ByteSwapRunnable& operator=(const ByteSwapRunnable&) = delete;
- ByteSwapRunnable(ByteSwapRunnable&&) = delete;
- ByteSwapRunnable& operator=(ByteSwapRunnable&&) = delete;
-
-private:
- void* const mBuffer;
- const size_t mElemSize;
- const size_t mNumElements;
-};
-
-struct ByteSwapCopyRunnable final : public sys::Runnable
-{
- ByteSwapCopyRunnable(const void* buffer, size_t elemSize, size_t startElement, size_t numElements, void* outputBuffer) noexcept :
- mBuffer(static_cast(buffer) + startElement * elemSize),
- mElemSize(elemSize), mNumElements(numElements),
- mOutputBuffer(static_cast(outputBuffer) + startElement * elemSize)
- {
- }
- void run() override
- {
- byteSwap(mBuffer, mElemSize, mNumElements, mOutputBuffer);
- }
-
- virtual ~ByteSwapCopyRunnable() = default;
- ByteSwapCopyRunnable(const ByteSwapCopyRunnable&) = delete;
- ByteSwapCopyRunnable& operator=(const ByteSwapCopyRunnable&) = delete;
- ByteSwapCopyRunnable(ByteSwapCopyRunnable&&) = delete;
- ByteSwapCopyRunnable& operator=(ByteSwapCopyRunnable&&) = delete;
-
-private:
- const void* const mBuffer;
- const size_t mElemSize;
- const size_t mNumElements;
- void* const mOutputBuffer;
-};
-
-}
-#endif // CODA_OSS_sys_ByteSwap_h_INCLUDED_
diff --git a/externals/nitro/externals/coda-oss/modules/c++/sys/include/sys/ByteSwapValue.h b/externals/nitro/externals/coda-oss/modules/c++/sys/include/sys/ByteSwapValue.h
deleted file mode 100644
index c36c4428e..000000000
--- a/externals/nitro/externals/coda-oss/modules/c++/sys/include/sys/ByteSwapValue.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/* =========================================================================
- * This file is part of sys-c++
- * =========================================================================
- *
- * (C) Copyright 2004 - 2014, MDA Information Systems LLC
- * (C) Copyright 2021, Maxar Technologies, Inc.
- *
- * sys-c++ is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; If not,
- * see .
- *
- */
-
-#pragma once
-#ifndef CODA_OSS_sys_ByteSwapValue_h_INCLUDED_
-#define CODA_OSS_sys_ByteSwapValue_h_INCLUDED_
-
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include