Skip to content

Commit 4b30e4a

Browse files
J. Daniel SmithDan Smith
andauthored
use mem::auto_ptr instead of std::auto_ptr for C++17 (#414)
* add contact details * update .gitignore * not sure what to do with CMakeSettings.json * Create CMakeSettings.json * new/updated "docs" directory * update externals/nitro with latest from nitro repo * use in32_t, etc. instead of nitf::Int32_t * Revert "Merge branch 'feature/update_nitro' into develop/jdsmith" This reverts commit 52001ee, reversing changes made to aac9d2c. * Revert "Merge branch 'feature/use_standard_C_types' into develop/jdsmith" This reverts commit aac9d2c, reversing changes made to 89b7807. * use in32_t, etc. instead of nitf::Int32_t * update externals/nitro with latest from nitro repo * Revert "update externals/nitro with latest from nitro repo" This reverts commit 7eb2813. * update nitro/nrt * update "nitro" * nitf::Int8 -> int8_t * updates from coda-oss and nitro * update externals/nitro with latest from "main" * update externals/coda-oss with latest from "main" * don't want "docs" directory in externals/nitro * fix bad merge * ignore CMake-generated files * std::auto_ptr -> std::unique_ptr * need std::auto_ptr<> overloads for pre-generated Python wrapper code * provide std::auto_ptr "overloads" so that existing Python wrapper code continues to work w/o changes * impelement std::auto_ptr "overrides" * latest from nitro:main * update externals/nitro * update coda-oss * Create codeql-analysis.yml * update coda-oss with latest from "main" * update nitro with latest from "main" * Revert "Create codeql-analysis.yml" This reverts commit b261bbd. * fix nitf::Field to get rid of compiler errors * build externals/coda-oss by itself * build with Visual Studio 2019 (#358) * Revert "Create codeql-analysis.yml" This reverts commit 4388277. * build nitro projects in SIX solution * build "six" as a Visual Studio project * build "scene" with Visual Studio * build cphd with Visual Studio * build cphd03 with Visual Studio * build six.sicd with Visual Studio * build six.sidd with Visual Studio * buid six.convert with Visual Studio * add a GTest project * trying to get a unittest working * build XML_DATA_CONTENT * get a NITF unit-test working :-) * run all "six" unittests * fix dummy DEFAULT_SCHEMA_PATH * allow unit-tests to run in Visual Studio * run SIDD unit-tests from Visual Studio * set SIX_SCHEMA_PATH so unittest works * run SICD unittests in Visual Studio * build and run six.sicd unittests in Visual Studio * set NITF_PLUGIN_PATH for sicd_test_area_plane * build cphd03 unittests in Visual Studio * run remaining cphd03 unittests * fix build error introduced with VS2019 changes * build cphd unittests in Visual Studio * build & run remaining cphd unittests in Visual Studio * use c++11 (#359) * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * get rid of hard-coded paths with <filesystem> (#360) * put common #includes for PCH in a single file * build check_valid_six * use EXIT_* rather than 0/1 * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * use <filesystem> to remove hard-coded paths * in Visual Studio, run check_valid_six with a pre-defined path * tweak plugin dir * can't have "check_valid_six" as a directory for *ix build * build crop_sicd * build crop_sicd in Visual Studio (#361) * put common #includes for PCH in a single file * build check_valid_six * use EXIT_* rather than 0/1 * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * use <filesystem> to remove hard-coded paths * in Visual Studio, run check_valid_six with a pre-defined path * tweak plugin dir * can't have "check_valid_six" as a directory for *ix build * build crop_sicd * build crop_sicd * update coda-oss with latest from "main" * update coda-oss with latest from "main" (#362) * coda-oss updates to make TextEncoding part of the OutputStream * updates from coda-oss to make TextEncoding part of the OutputStream * fix StringStream() .ctor() * one more coda-oss update * latest from coda-oss "main" (#364) * update coda-oss with latest from "main" * coda-oss updates to make TextEncoding part of the OutputStream * updates from coda-oss to make TextEncoding part of the OutputStream * fix StringStream() .ctor() * one more coda-oss update * latest from "main" on coda-oss: xml.lite updates for UTF-8 * restore changes lost in merge * update coda-oss (#365) * update coda-oss with latest from "main" * coda-oss updates to make TextEncoding part of the OutputStream * updates from coda-oss to make TextEncoding part of the OutputStream * fix StringStream() .ctor() * one more coda-oss update * latest from "main" on coda-oss: xml.lite updates for UTF-8 * restore changes lost in merge * latest from coda-oss * another update to coda-oss (#366) * update coda-oss with latest from "main" * coda-oss updates to make TextEncoding part of the OutputStream * updates from coda-oss to make TextEncoding part of the OutputStream * fix StringStream() .ctor() * one more coda-oss update * latest from "main" on coda-oss: xml.lite updates for UTF-8 * restore changes lost in merge * latest from coda-oss * latest from coda-oss * Develop/update externals (#367) * update coda-oss with latest from "main" * coda-oss updates to make TextEncoding part of the OutputStream * updates from coda-oss to make TextEncoding part of the OutputStream * fix StringStream() .ctor() * one more coda-oss update * latest from "main" on coda-oss: xml.lite updates for UTF-8 * restore changes lost in merge * latest from coda-oss * latest from coda-oss * latest from coda-oss * latest from coda-oss (#368) * update coda-oss with latest from "main" * coda-oss updates to make TextEncoding part of the OutputStream * updates from coda-oss to make TextEncoding part of the OutputStream * fix StringStream() .ctor() * one more coda-oss update * latest from "main" on coda-oss: xml.lite updates for UTF-8 * restore changes lost in merge * latest from coda-oss * latest from coda-oss * latest from coda-oss * latest from "main" on coda-oss * latest from coda-oss (#369) * update coda-oss with latest from "main" * coda-oss updates to make TextEncoding part of the OutputStream * updates from coda-oss to make TextEncoding part of the OutputStream * fix StringStream() .ctor() * one more coda-oss update * latest from "main" on coda-oss: xml.lite updates for UTF-8 * restore changes lost in merge * latest from coda-oss * latest from coda-oss * latest from coda-oss * latest from "main" on coda-oss * use Filesystem.h from coda-oss instead of <filesystem> * use sys::Filesystem * update "nitro" and "coda-oss" (#370) * update "nitro" and "coda-oss" * Delete CMakeSettings.json * changeFileHeader() doesn't (yet) work in "externals" * preserve utf8 in XML text (#363) * pass io::Encoding::Utf8 to print() and prettyPrint() to preserve UTF-8 in output * store the value of xml::lite::MinidomParser::preserveCharacterData() so we can figure out the encoding * Don't want to set a dummy schema path to a directory that exists * add a unit-test for UTF-8 characters in "Classification" * fix isUnclassified() so it works for "NON CLASSIFIÉ / UNCLASSIFIED" * Revert "Merge branch 'main' into bugfix/preserve_UTF8_in_classified_field" This reverts commit 12534c9, reversing changes made to 02ce755. * account for coda-oss changes where TextEncoding is part of the OutputStream * get the right verson of Element.h * use new xml::lite to read/write XML in UTF-8 * be sure we can read-in and process UTF-8 from a NITF * assume UTF-8 on *ix and Windows-1252 on Windows * reduce "gratuatous" diffs for simpler merge request * one more unneeded diff * French -> Canada * latest from coda-oss * trying to get the test_valid_six unittest working on Linux * use .tar, not .tar.gz * add another unit-test (#371) * put common #includes for PCH in a single file * build check_valid_six * use EXIT_* rather than 0/1 * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * use <filesystem> to remove hard-coded paths * in Visual Studio, run check_valid_six with a pre-defined path * tweak plugin dir * can't have "check_valid_six" as a directory for *ix build * build crop_sicd * turn on /Wall, fix some warnings * C++17 generates more warnings that I don't want to fix right now * removed some compiler warnings from third-party code * comment-out use of C++17's <filesystem> * tweak project settings for consistency * unit-test for createFakeComplexData() * remove some compiler warnings (#372) * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * turn on compiler warnings * crank-up warning level * enable "Warnings as errors" * turn on all warnings (many #pragma'd away) * get rid of more warnings * adjust more #pragma's * update "nitro" * update coda-oss and fix compiler errors * use int64_t, etc. instead of sys::Int64_T * mem::SharedPtr -> std::shared_ptr * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update externals (#373) * update "nitro" * update coda-oss and fix compiler errors * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * use c++11 features (#374) * update "nitro" * update coda-oss and fix compiler errors * use int64_t, etc. instead of sys::Int64_T * mem::SharedPtr -> std::shared_ptr * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * use std::unique_ptr<[]> instead of mem::ScopedArray * use int32_t et. al. instead of sys::Int32_T * use std::byte (not quite working yet, but need to move code to a faster machine) * build with std::byte * latest "nitro" (#375) * update "nitro" * update coda-oss and fix compiler errors * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * latest from "nitro" * match nitro -> nitf change * make_span() * use std::thread::hardware_concurrency() instead of sys::OS().getNumCPUs() * sys::Off_T -> ptrdiff_t * Revert "sys::Off_T -> ptrdiff_t" This reverts commit aa22a37. * sys::Off_T -> int64_t; sys::SSize_T -> ptrdiff_t * latest from "coda-oss" (#376) * update "nitro" * update coda-oss and fix compiler errors * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * latest from "nitro" * match nitro -> nitf change * make_span() * latest from "coda-oss" * more use of C++11 (#377) * update "nitro" * update coda-oss and fix compiler errors * use int64_t, etc. instead of sys::Int64_T * mem::SharedPtr -> std::shared_ptr * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * use std::unique_ptr<[]> instead of mem::ScopedArray * use int32_t et. al. instead of sys::Int32_T * use std::byte (not quite working yet, but need to move code to a faster machine) * build with std::byte * use std::thread::hardware_concurrency() instead of sys::OS().getNumCPUs() * sys::Off_T -> ptrdiff_t * Revert "sys::Off_T -> ptrdiff_t" This reverts commit aa22a37. * sys::Off_T -> int64_t; sys::SSize_T -> ptrdiff_t * fix build errors from recent changes (#378) * put common #includes for PCH in a single file * build check_valid_six * use EXIT_* rather than 0/1 * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * use <filesystem> to remove hard-coded paths * in Visual Studio, run check_valid_six with a pre-defined path * tweak plugin dir * can't have "check_valid_six" as a directory for *ix build * build crop_sicd * turn on /Wall, fix some warnings * C++17 generates more warnings that I don't want to fix right now * removed some compiler warnings from third-party code * comment-out use of C++17's <filesystem> * tweak project settings for consistency * unit-test for createFakeComplexData() * turn on compiler warnings * crank-up warning level * enable "Warnings as errors" * turn on all warnings (many #pragma'd away) * get rid of more warnings * adjust more #pragma's * update "nitro" * update coda-oss and fix compiler errors * update "nitro" * update coda-oss and fix compiler errors * use "externals" from top-level "install" * use int64_t, etc. instead of sys::Int64_T * mem::SharedPtr -> std::shared_ptr * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * use std::unique_ptr<[]> instead of mem::ScopedArray * use int32_t et. al. instead of sys::Int32_T * use std::byte (not quite working yet, but need to move code to a faster machine) * build with std::byte * build with simplified "externals" scheme * latest from "nitro" * match nitro -> nitf change * make_span() * use std::thread::hardware_concurrency() instead of sys::OS().getNumCPUs() * sys::Off_T -> ptrdiff_t * fix compiler errors from previous merge; mostly #include <thread> * Revert "sys::Off_T -> ptrdiff_t" This reverts commit aa22a37. * sys::Off_T -> int64_t; sys::SSize_T -> ptrdiff_t * latest from "coda-oss" * use filesystem::path and std::endian * less use of sys:: * NULL -> nullptr * NULL -> nullptr (#379) * update "nitro" * update coda-oss and fix compiler errors * use int64_t, etc. instead of sys::Int64_T * mem::SharedPtr -> std::shared_ptr * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * use std::unique_ptr<[]> instead of mem::ScopedArray * use int32_t et. al. instead of sys::Int32_T * use std::byte (not quite working yet, but need to move code to a faster machine) * build with std::byte * use std::thread::hardware_concurrency() instead of sys::OS().getNumCPUs() * sys::Off_T -> ptrdiff_t * Revert "sys::Off_T -> ptrdiff_t" This reverts commit aa22a37. * sys::Off_T -> int64_t; sys::SSize_T -> ptrdiff_t * use filesystem::path and std::endian * less use of sys:: * NULL -> nullptr * latest from coda-oss (#381) * update "nitro" * update coda-oss and fix compiler errors * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * latest from "nitro" * match nitro -> nitf change * make_span() * latest from "coda-oss" * more filesystem from coda-oss * latest from develop/jdsmith (#382) * put common #includes for PCH in a single file * build check_valid_six * use EXIT_* rather than 0/1 * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * use <filesystem> to remove hard-coded paths * in Visual Studio, run check_valid_six with a pre-defined path * tweak plugin dir * can't have "check_valid_six" as a directory for *ix build * build crop_sicd * turn on /Wall, fix some warnings * C++17 generates more warnings that I don't want to fix right now * removed some compiler warnings from third-party code * comment-out use of C++17's <filesystem> * tweak project settings for consistency * unit-test for createFakeComplexData() * turn on compiler warnings * crank-up warning level * enable "Warnings as errors" * turn on all warnings (many #pragma'd away) * get rid of more warnings * adjust more #pragma's * update "nitro" * update coda-oss and fix compiler errors * update "nitro" * update coda-oss and fix compiler errors * use "externals" from top-level "install" * use int64_t, etc. instead of sys::Int64_T * mem::SharedPtr -> std::shared_ptr * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * use std::unique_ptr<[]> instead of mem::ScopedArray * use int32_t et. al. instead of sys::Int32_T * use std::byte (not quite working yet, but need to move code to a faster machine) * build with std::byte * build with simplified "externals" scheme * latest from "nitro" * match nitro -> nitf change * make_span() * use std::thread::hardware_concurrency() instead of sys::OS().getNumCPUs() * sys::Off_T -> ptrdiff_t * fix compiler errors from previous merge; mostly #include <thread> * Revert "sys::Off_T -> ptrdiff_t" This reverts commit aa22a37. * sys::Off_T -> int64_t; sys::SSize_T -> ptrdiff_t * latest from "coda-oss" * use filesystem::path and std::endian * more filesystem from coda-oss * less use of sys:: * NULL -> nullptr * use .data() rather than &d[0] * mem::BufferView -> std::span * const std::span<>& doesn't make much sense * need make_span() overload for pointer+size * latest from "nitro" (#383) * update "nitro" * update coda-oss and fix compiler errors * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * latest from "nitro" * match nitro -> nitf change * make_span() * latest from "coda-oss" * more filesystem from coda-oss * latest from "nitro" * latest from develop/jdsmith (#385) * put common #includes for PCH in a single file * build check_valid_six * use EXIT_* rather than 0/1 * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * use <filesystem> to remove hard-coded paths * in Visual Studio, run check_valid_six with a pre-defined path * tweak plugin dir * can't have "check_valid_six" as a directory for *ix build * build crop_sicd * turn on /Wall, fix some warnings * C++17 generates more warnings that I don't want to fix right now * removed some compiler warnings from third-party code * comment-out use of C++17's <filesystem> * tweak project settings for consistency * unit-test for createFakeComplexData() * turn on compiler warnings * crank-up warning level * enable "Warnings as errors" * turn on all warnings (many #pragma'd away) * get rid of more warnings * adjust more #pragma's * update "nitro" * update coda-oss and fix compiler errors * update "nitro" * update coda-oss and fix compiler errors * use "externals" from top-level "install" * use int64_t, etc. instead of sys::Int64_T * mem::SharedPtr -> std::shared_ptr * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * use std::unique_ptr<[]> instead of mem::ScopedArray * use int32_t et. al. instead of sys::Int32_T * use std::byte (not quite working yet, but need to move code to a faster machine) * build with std::byte * build with simplified "externals" scheme * latest from "nitro" * match nitro -> nitf change * make_span() * use std::thread::hardware_concurrency() instead of sys::OS().getNumCPUs() * sys::Off_T -> ptrdiff_t * fix compiler errors from previous merge; mostly #include <thread> * Revert "sys::Off_T -> ptrdiff_t" This reverts commit aa22a37. * sys::Off_T -> int64_t; sys::SSize_T -> ptrdiff_t * latest from "coda-oss" * use filesystem::path and std::endian * more filesystem from coda-oss * less use of sys:: * NULL -> nullptr * use .data() rather than &d[0] * mem::BufferView -> std::span * const std::span<>& doesn't make much sense * need make_span() overload for pointer+size * latest from "nitro" * std::endian * coda-oss now gives us std::endian * sys::Filesystem -> std::filesystem * don't need to explicitly call fs::path::string() in most cases * sys::Filesystem -> std::filesystem * fix build errors when using C++17 * latest from "nitro" (#387) * update "nitro" * update coda-oss and fix compiler errors * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * latest from "nitro" * match nitro -> nitf change * make_span() * latest from "coda-oss" * more filesystem from coda-oss * latest from "nitro" * std::endian * latest from "nitro" * latest changes from develop/jdsmith (#386) * put common #includes for PCH in a single file * build check_valid_six * use EXIT_* rather than 0/1 * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * use <filesystem> to remove hard-coded paths * in Visual Studio, run check_valid_six with a pre-defined path * tweak plugin dir * can't have "check_valid_six" as a directory for *ix build * build crop_sicd * turn on /Wall, fix some warnings * C++17 generates more warnings that I don't want to fix right now * removed some compiler warnings from third-party code * comment-out use of C++17's <filesystem> * tweak project settings for consistency * unit-test for createFakeComplexData() * turn on compiler warnings * crank-up warning level * enable "Warnings as errors" * turn on all warnings (many #pragma'd away) * get rid of more warnings * adjust more #pragma's * update "nitro" * update coda-oss and fix compiler errors * update "nitro" * update coda-oss and fix compiler errors * use "externals" from top-level "install" * use int64_t, etc. instead of sys::Int64_T * mem::SharedPtr -> std::shared_ptr * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * use std::unique_ptr<[]> instead of mem::ScopedArray * use int32_t et. al. instead of sys::Int32_T * use std::byte (not quite working yet, but need to move code to a faster machine) * build with std::byte * build with simplified "externals" scheme * latest from "nitro" * match nitro -> nitf change * make_span() * use std::thread::hardware_concurrency() instead of sys::OS().getNumCPUs() * sys::Off_T -> ptrdiff_t * fix compiler errors from previous merge; mostly #include <thread> * Revert "sys::Off_T -> ptrdiff_t" This reverts commit aa22a37. * sys::Off_T -> int64_t; sys::SSize_T -> ptrdiff_t * latest from "coda-oss" * use filesystem::path and std::endian * more filesystem from coda-oss * less use of sys:: * NULL -> nullptr * use .data() rather than &d[0] * mem::BufferView -> std::span * const std::span<>& doesn't make much sense * need make_span() overload for pointer+size * latest from "nitro" * std::endian * coda-oss now gives us std::endian * sys::Filesystem -> std::filesystem * don't need to explicitly call fs::path::string() in most cases * sys::Filesystem -> std::filesystem * fix build errors when using C++17 * simplify access to some ImageSubheader values * newReadControl() returns a std::unique_ptr<> rather than a raw pointer * a singleton is much easier in C++11 * don't need to do manual locking in C++11 * use a template and some macros to dramatically simplify Enums * adjust macros for GCC, provide operators for SWIG * got the map entries wrong * make getIndices() a bit more robust * store a std::unique_ptr<> instead of a raw poniter * throw exceptions in getIndices() rather than assuming * use Enum<T>.toString() where possible rather than duplicating code * remove duplicate code converting from a string to Enum<T> * don't explicilty check for "SIDD" as that's already part of getDataType() * use std::string instead of char[] * reduce use of "delete[]" * less use of "SICD" and "SIDD", use six::DataType instead * simplify Region buffer management * reduce some explicit use of std::shared_ptr<> with std::make_shared and/or auto * more reduction in explicit use of std::shared_ptr * latest from "nitro" * simplify use of six::Region * reduce use of explicit .toString() * further reduction in explicit use of toString() * template specialiaton can't be inline with G++ * simplify cphd enum creation * reduce use of toString() with setAttribute() * update externals (#388) * update "nitro" * update coda-oss and fix compiler errors * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * latest from "nitro" * match nitro -> nitf change * make_span() * latest from "coda-oss" * more filesystem from coda-oss * latest from "nitro" * std::endian * latest from "nitro" * latest from "nitro" and "coda-oss" * reduce use of toString() (#389) * put common #includes for PCH in a single file * build check_valid_six * use EXIT_* rather than 0/1 * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * use <filesystem> to remove hard-coded paths * in Visual Studio, run check_valid_six with a pre-defined path * tweak plugin dir * can't have "check_valid_six" as a directory for *ix build * build crop_sicd * turn on /Wall, fix some warnings * C++17 generates more warnings that I don't want to fix right now * removed some compiler warnings from third-party code * comment-out use of C++17's <filesystem> * tweak project settings for consistency * unit-test for createFakeComplexData() * turn on compiler warnings * crank-up warning level * enable "Warnings as errors" * turn on all warnings (many #pragma'd away) * get rid of more warnings * adjust more #pragma's * update "nitro" * update coda-oss and fix compiler errors * update "nitro" * update coda-oss and fix compiler errors * use "externals" from top-level "install" * use int64_t, etc. instead of sys::Int64_T * mem::SharedPtr -> std::shared_ptr * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * use std::unique_ptr<[]> instead of mem::ScopedArray * use int32_t et. al. instead of sys::Int32_T * use std::byte (not quite working yet, but need to move code to a faster machine) * build with std::byte * build with simplified "externals" scheme * latest from "nitro" * match nitro -> nitf change * make_span() * use std::thread::hardware_concurrency() instead of sys::OS().getNumCPUs() * sys::Off_T -> ptrdiff_t * fix compiler errors from previous merge; mostly #include <thread> * Revert "sys::Off_T -> ptrdiff_t" This reverts commit aa22a37. * sys::Off_T -> int64_t; sys::SSize_T -> ptrdiff_t * latest from "coda-oss" * use filesystem::path and std::endian * more filesystem from coda-oss * less use of sys:: * NULL -> nullptr * use .data() rather than &d[0] * mem::BufferView -> std::span * const std::span<>& doesn't make much sense * need make_span() overload for pointer+size * latest from "nitro" * std::endian * coda-oss now gives us std::endian * sys::Filesystem -> std::filesystem * don't need to explicitly call fs::path::string() in most cases * sys::Filesystem -> std::filesystem * fix build errors when using C++17 * simplify access to some ImageSubheader values * newReadControl() returns a std::unique_ptr<> rather than a raw pointer * a singleton is much easier in C++11 * don't need to do manual locking in C++11 * use a template and some macros to dramatically simplify Enums * adjust macros for GCC, provide operators for SWIG * got the map entries wrong * make getIndices() a bit more robust * store a std::unique_ptr<> instead of a raw poniter * throw exceptions in getIndices() rather than assuming * use Enum<T>.toString() where possible rather than duplicating code * remove duplicate code converting from a string to Enum<T> * don't explicilty check for "SIDD" as that's already part of getDataType() * use std::string instead of char[] * reduce use of "delete[]" * less use of "SICD" and "SIDD", use six::DataType instead * simplify Region buffer management * reduce some explicit use of std::shared_ptr<> with std::make_shared and/or auto * more reduction in explicit use of std::shared_ptr * latest from "nitro" * simplify use of six::Region * reduce use of explicit .toString() * further reduction in explicit use of toString() * template specialiaton can't be inline with G++ * simplify cphd enum creation * reduce use of toString() with setAttribute() * latest from "nitro" and "coda-oss" * don't need catch(excep::Exception) ex.toString() as std::exception::what() now does the same thing * really only have two calls to setAttribute(): std::string and size_t * use macros to generate SIDD Enums * add operator<< for Enum<T> to avoid some explicit .toString() calls * add operator==(std::string) overload to redue need for .toString() * add operator<<() to redue need for .toString() * don't implmeent a bunch of six::toString() routines; they sholdn't be called anymore * further reduction in use of toString() * eliminate six::toString() template; just provide a few overloads instead * createSixString() which calls six::toString(t) instead of t.toString() * createSixString() overload with URI parameter * allow different strings (e.g., "1" and "+1") to map to the same value * put "Enum" support code in a separate file * there is now just one NOT_SET_VALUE * latest from coda-oss (#390) * update "nitro" * update coda-oss and fix compiler errors * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * latest from "nitro" * match nitro -> nitf change * make_span() * latest from "coda-oss" * more filesystem from coda-oss * latest from "nitro" * std::endian * latest from "nitro" * latest from "nitro" and "coda-oss" * latest from coda-oss * lost toString<nullptr>() * latest from coda-oss/main * want "std" augmented in this repo * latest from coda-oss and nitro (#391) * update "nitro" * update coda-oss and fix compiler errors * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * latest from "nitro" * match nitro -> nitf change * make_span() * latest from "coda-oss" * more filesystem from coda-oss * latest from "nitro" * std::endian * latest from "nitro" * latest from "nitro" and "coda-oss" * latest from coda-oss * lost toString<nullptr>() * latest from coda-oss/main * want "std" augmented in this repo * partial update from coda-oss/main * latest from coda-oss/main * update coda-oss with latest from https://github.com/mdaus/coda-oss * update externals/nitro/docs * latest from "nitro" * Revert "latest from "nitro"" This reverts commit 0b99300. * latest from nitro/master * ignore build/ directory * Revert "latest from nitro/master" This reverts commit e89da71. * update externals/nitro/docs * update "c", "java", "mex", and "python" directories -- but not "c++" * update other nitro top-level files ... everything except modules/c++ * VCXPROJ files from nitro * several changes from nitro/c++ ... hoping this builds. * fix build error on Linux * more changes from nitro/modules/c++ * fix IOStreamWriter ctor * more changes from nitro/modules/c++ * paths are wrong when in "externals" * remove externals/nitro/docs * slam in "main" * latest from coda-oss/main * adjust coda-oss for our usage * latest from nitro/main * std::span removed from "nitro" * need to redo C++17 * fix missing #include file * remove "nitro" files not needed in externals/nitro * paths are wrong in "externals" * Revert "remove "nitro" files not needed in externals/nitro" This reverts commit da30b96. * Revert "Revert "remove "nitro" files not needed in externals/nitro"" This reverts commit e69391b. * slam in externals as merging creates too many conflicts * merge brought back a deleted #include * add back "java" and "mex" * lates from coda-oss/main * latest from "nitro" * paths are wrong in "externals" * need to redo C++17 support * std::span -> gsl::span * Revert "std::span -> gsl::span" This reverts commit c10f233. * latest from coda-oss and nitro * these are the correct files from "master" * gsl::span -> std::span * get #includes right for PCH * didn't want this change * trigger build on GitHub * #include <nitf/coda-oss.hpp> instead of sys/Conf.h to get stuff added to "std" * remove files that shouldn't have been committed * #define CODA_OSS_AUGMENT_std_namespace before #include <sys/Conf.h> * #include <scene/sys_Conf.h> rather than <nitf/coda-oss.hpp> * do a better job of being sure we have additional stuff in "std" from coda-oss * no auto_ptr in C++17 * no std::auto_ptr in C++17 * mem::auto_ptr instead of std::auto_ptr for C++17 * fix a few more errors with building with C++17 * std::auto_ptr -> mem::auto_ptr for C++17 Co-authored-by: Dan Smith <[email protected]>
1 parent c5f669c commit 4b30e4a

20 files changed

Lines changed: 5388 additions & 5352 deletions

File tree

six/modules/c++/cphd/source/PVPBlock.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
#include <cphd/Metadata.h>
3838
#include <cphd/Utilities.h>
3939

40+
#include <sys/Bit.h>
41+
namespace std
42+
{
43+
using endian = sys::Endian;
44+
}
45+
4046
namespace
4147
{
4248
// Set data from data block into data struct

six/modules/c++/cphd03/source/CPHDWriter.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
#include <cphd03/FileHeader.h>
3131
#include <cphd/ByteSwap.h>
3232

33+
#include <sys/Bit.h>
34+
namespace std
35+
{
36+
using endian = sys::Endian;
37+
}
38+
3339
namespace cphd03
3440
{
3541
CPHDWriter::CPHDWriter(const Metadata& metadata,

six/modules/c++/cphd03/source/VBM.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131

3232
#include <cphd/ByteSwap.h>
3333

34+
#include <sys/Bit.h>
35+
namespace std
36+
{
37+
using endian = sys::Endian;
38+
}
39+
3440
namespace
3541
{
3642
inline void setData(const std::byte*& data,

six/modules/c++/samples/image_to_scene.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <stdexcept>
2525
#include <memory>
2626

27-
#include <nitf/coda-oss.hpp>
27+
#include <sys/Conf.h>
2828
#include <sys/Path.h>
2929
#include <except/Exception.h>
3030
#include <str/Convert.h>
@@ -37,11 +37,11 @@
3737
#include <six/sidd/DerivedXMLControl.h>
3838

3939
#include <sys/Filesystem.h>
40-
namespace fs = std::filesystem;
40+
namespace fs = sys::Filesystem;
4141

4242
namespace
4343
{
44-
void usage(const fs::path& progname, std::ostream& ostr)
44+
void usage(const std::string& progname, std::ostream& ostr)
4545
{
4646
ostr << progname << " -h\n"
4747
<< progname
@@ -51,9 +51,10 @@ void usage(const fs::path& progname, std::ostream& ostr)
5151
<< "-image_to_ground must be specified\n\n";
5252
}
5353

54-
struct Converter final
54+
class Converter
5555
{
56-
Converter(const fs::path& pathname);
56+
public:
57+
Converter(const std::string& pathname);
5758

5859
void groundToImage(const scene::Vector3& groundPt) const;
5960

@@ -74,7 +75,7 @@ struct Converter final
7475
types::RowCol<double> mAOIOffset;
7576
};
7677

77-
Converter::Converter(const fs::path& pathname)
78+
Converter::Converter(const std::string& pathname)
7879
{
7980
// Read in the SICD
8081
six::NITFReadControl reader;
@@ -88,10 +89,10 @@ Converter::Converter(const fs::path& pathname)
8889
new six::XMLControlCreatorT<six::sidd::DerivedXMLControl>());
8990

9091
reader.setXMLControlRegistry(&xmlRegistry);
91-
reader.load(pathname.string());
92+
reader.load(pathname);
9293

9394
// Verify it's a SICD
94-
auto container(reader.getContainer());
95+
std::shared_ptr<const six::Container> container(reader.getContainer());
9596
if (container->getDataType() != six::DataType::COMPLEX)
9697
{
9798
throw except::InvalidFormatException(Ctxt("Expected a SICD NITF"));
@@ -166,7 +167,7 @@ int main(int argc, char** argv)
166167
try
167168
{
168169
// Parse the command line
169-
const auto progname(fs::path(argv[0]).filename());
170+
const std::string progname(fs::path(argv[0]).filename().string());
170171
if (argc < 2)
171172
{
172173
usage(progname, std::cerr);

six/modules/c++/six.sicd/include/six/sicd/Utilities.h

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#include <vector>
2828
#include <utility>
2929

30+
#include <sys/Filesystem.h>
31+
3032
#include <scene/SceneGeometry.h>
3133
#include <scene/ProjectionModel.h>
3234
#include <six/sicd/ComplexData.h>
@@ -83,7 +85,7 @@ class Utilities
8385
* with the valid data polygon.
8486
* \return ProjectionPolynomialFitter from ComplexData
8587
*/
86-
static std::auto_ptr<scene::ProjectionPolynomialFitter>
88+
static mem::auto_ptr<scene::ProjectionPolynomialFitter>
8789
getPolynomialFitter(const ComplexData& complexData,
8890
size_t numPoints1D =
8991
scene::ProjectionPolynomialFitter::DEFAULTS_POINTS_1D,
@@ -126,6 +128,10 @@ class Utilities
126128
const std::vector<std::string>& schemaPaths,
127129
std::unique_ptr<ComplexData>& complexData,
128130
std::vector<std::complex<float> >& widebandData);
131+
static void readSicd(const std::filesystem::path& sicdPathname,
132+
const std::vector<std::string>& schemaPaths,
133+
std::unique_ptr<ComplexData>& complexData,
134+
std::vector<std::complex<float> >& widebandData);
129135

130136
/*
131137
* Given a SICD path name and a list of schema, this function reads
@@ -192,7 +198,7 @@ class Utilities
192198
* \throws except::Exception if file is not a SICD or Complex XML
193199
*/
194200
static
195-
std::auto_ptr<ComplexData> getComplexData(
201+
mem::auto_ptr<ComplexData> getComplexData(
196202
const std::string& pathname,
197203
const std::vector<std::string>& schemaPaths);
198204

@@ -207,7 +213,7 @@ class Utilities
207213
* \throws except::Exception if the provided reader is not a SICD
208214
*
209215
*/
210-
static std::auto_ptr<ComplexData> getComplexData(NITFReadControl& reader);
216+
static mem::auto_ptr<ComplexData> getComplexData(NITFReadControl& reader);
211217

212218
/*
213219
* Given a loaded NITFReadControl and a ComplexData object, this
@@ -381,7 +387,7 @@ class Utilities
381387
*
382388
* \return Data representation of 'xmlStr'
383389
*/
384-
static std::auto_ptr<ComplexData> parseData(
390+
static mem::auto_ptr<ComplexData> parseData(
385391
::io::InputStream& xmlStream,
386392
const std::vector<std::string>& schemaPaths,
387393
logging::Logger& log);
@@ -396,7 +402,7 @@ class Utilities
396402
*
397403
* \return Data representation of the contents of 'pathname'
398404
*/
399-
static std::auto_ptr<ComplexData> parseDataFromFile(
405+
static mem::auto_ptr<ComplexData> parseDataFromFile(
400406
const std::string& pathname,
401407
const std::vector<std::string>& schemaPaths,
402408
logging::Logger& log);
@@ -410,7 +416,7 @@ class Utilities
410416
*
411417
* \return Data representation of 'xmlStr'
412418
*/
413-
static std::auto_ptr<ComplexData> parseDataFromString(
419+
static mem::auto_ptr<ComplexData> parseDataFromString(
414420
const std::string& xmlStr,
415421
const std::vector<std::string>& schemaPaths,
416422
logging::Logger& log);
@@ -437,7 +443,7 @@ class Utilities
437443
*
438444
* \return mock ComplexData object
439445
*/
440-
static std::auto_ptr<ComplexData> createFakeComplexData();
446+
static mem::auto_ptr<ComplexData> createFakeComplexData();
441447

442448
/*
443449
* Given a reference to a loaded NITFReadControl, this function
@@ -447,7 +453,7 @@ class Utilities
447453
* \throws except::Exception if the provided reader is not a SICD
448454
*
449455
*/
450-
static std::auto_ptr<NoiseMesh> getNoiseMesh(NITFReadControl& reader);
456+
static mem::auto_ptr<NoiseMesh> getNoiseMesh(NITFReadControl& reader);
451457

452458
/*
453459
* Given a reference to a loaded NITFReadControl, this function
@@ -460,7 +466,7 @@ class Utilities
460466
*
461467
* \return Scalar Mesh associated with the SICD NITF
462468
*/
463-
static std::auto_ptr<ScalarMesh> getScalarMesh(NITFReadControl& reader);
469+
static mem::auto_ptr<ScalarMesh> getScalarMesh(NITFReadControl& reader);
464470

465471
/*
466472
* Given a reference to a loaded NITFReadControl, this function

six/modules/c++/six.sicd/source/SICDMesh.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
#include <six/sicd/SICDMesh.h>
2828
#include <six/Serialize.h>
2929

30+
#include <sys/Bit.h>
31+
namespace std
32+
{
33+
using endian = sys::Endian;
34+
}
35+
3036
namespace six
3137
{
3238
namespace sicd

six/modules/c++/six.sicd/source/Utilities.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636
#include <sys/Conf.h>
3737
#include <types/RowCol.h>
3838

39-
40-
#include <sys/Filesystem.h>
4139
namespace fs = std::filesystem;
4240

4341
namespace
@@ -518,6 +516,13 @@ void Utilities::readSicd(const std::string& sicdPathname,
518516
{
519517
readSicd_(sicdPathname, schemaPaths, complexData, widebandData);
520518
}
519+
void Utilities::readSicd(const fs::path& sicdPathname,
520+
const std::vector<std::string>& schemaPaths,
521+
std::unique_ptr<ComplexData>& complexData,
522+
std::vector<std::complex<float>>& widebandData)
523+
{
524+
readSicd(sicdPathname.string(), schemaPaths, complexData, widebandData);
525+
}
521526

522527
template<typename TComplexDataPtr, typename TNoiseMeshPtr, typename TScalarMeshPtr>
523528
static void readSicd_(const std::string& sicdPathname,

six/modules/c++/six/source/NITFHeaderCreator.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ void NITFHeaderCreator::setSecurity(const six::Classification& classification,
348348
security.getClassificationSystem().set("US");
349349
}
350350

351-
if (mLog != NULL)
351+
if (mLog != nullptr)
352352
{
353353
classification.setSecurity(prefix, *mLog, security);
354354
}
@@ -597,9 +597,9 @@ void NITFHeaderCreator::addUserDefinedSubheader(
597597
void NITFHeaderCreator::addAdditionalDES(
598598
mem::SharedPtr<nitf::SegmentWriter> segmentWriter)
599599
{
600-
if (segmentWriter.get() == NULL)
600+
if (segmentWriter.get() == nullptr)
601601
{
602-
throw except::Exception(Ctxt("segmentWriter is NULL"));
602+
throw except::Exception(Ctxt("segmentWriter is nullptr"));
603603
}
604604

605605
mSegmentWriters.push_back(segmentWriter);
@@ -860,7 +860,7 @@ void NITFHeaderCreator::initialize(mem::SharedPtr<Container> container)
860860

861861
case PixelType::RGB8LU:
862862
// We should have a legend
863-
if (legend->mLUT.get() == NULL)
863+
if (legend->mLUT.get() == nullptr)
864864
{
865865
throw except::Exception(Ctxt(
866866
"LUT should be present for indexed RGB legend"));

0 commit comments

Comments
 (0)