Skip to content

Commit

Permalink
latest coda-oss and nitro (#401)
Browse files Browse the repository at this point in the history
* 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 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"

* 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

* 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()

* 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"

* 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

* remove files that shouldn't have been committed

Co-authored-by: Dan Smith <[email protected]>
  • Loading branch information
J. Daniel Smith and Dan Smith authored Jan 20, 2021
1 parent 8122354 commit 74727d4
Show file tree
Hide file tree
Showing 26 changed files with 199 additions and 152 deletions.
71 changes: 0 additions & 71 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ The master is considered stable, but official [releases](https://github.com/ngag
All pull request contributions to this project will be released under the LGPL 3.0 license.

Software source code previously released under an open source license and then modified by NGA staff is considered a "joint work" (see 17 USC 101); it is partially copyrighted, partially public domain, and as a whole is protected by the copyrights of the non-government authors and must be released according to the terms of the original open source license.

### Contact
July 2020, [email protected]
3 changes: 1 addition & 2 deletions Test/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@

#include "six/modules/c++/cpp_pch.h"

#include <sys/File.h>
#include <nitf/coda-oss.hpp>

#pragma warning(pop)

#include <sys/Conf.h>
#include <import/except.h>
#include <import/types.h>
#pragma warning(push)
Expand Down
18 changes: 18 additions & 0 deletions externals/coda-oss/modules/c++/gsl/include/gsl/gsl.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,22 @@

#endif

#ifndef CODA_OSS_DEFINE_std_span_
#if CODA_OSS_cpp20 && __has_include(<span>) // __has_include is C++17
#define CODA_OSS_DEFINE_std_span_ -1 // OK to #include <>, below
#else
#define CODA_OSS_DEFINE_std_span_ CODA_OSS_AUGMENT_std_namespace // maybe use our own
#endif // CODA_OSS_cpp20
#endif // CODA_OSS_DEFINE_std_span_

#if CODA_OSS_DEFINE_std_span_ == 1
namespace std // This is slightly uncouth: we're not supposed to augment "std".
{
template<typename T>
using span = gsl::span<T>;
}
#elif CODA_OSS_DEFINE_std_span_ == -1 // set above
#include <span>
#endif // CODA_OSS_DEFINE_std_span_

#endif // CODA_OSS_gsl_h_INCLUDED_
128 changes: 128 additions & 0 deletions externals/coda-oss/modules/c++/gsl/include/gsl/gsl_.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/* =========================================================================
* This file is part of gsl-c++
* =========================================================================
*
* (C) Copyright 2004 - 2014, MDA Information Systems LLC
*
* gsl-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 <http://www.gnu.org/licenses/>.
*
*/

#ifndef CODA_OSS_Gsl__h_INCLUDED_
#define CODA_OSS_Gsl__h_INCLUDED_

#pragma once

// Can't compile all of GSL with older versions of GCC

#include <assert.h>

#include <exception>
#include <type_traits>
#include <utility>

#include <mem/Span.h>

namespace Gsl
{
// narrow_cast(): a searchable way to do narrowing casts of values
template <class T, class U> constexpr T narrow_cast(U&& u) noexcept
{
return static_cast<T>(std::forward<U>(u));
}

struct narrowing_error final : public std::exception { };

namespace details
{
template <typename Exception>
[[noreturn]] void throw_exception(Exception&& e)
{
throw e;
}

template <class T, class U>
struct is_same_signedness final
: public std::integral_constant<bool, std::is_signed<T>::value == std::is_signed<U>::value> { };

// this is messy to preserve "constexpr" with C++11
template <class T>
constexpr T narrow_throw_exception(T t) noexcept(false)
{
return throw_exception(narrowing_error()), t;
}
template <class T, class U>
constexpr T narrow1_(T t, U u) noexcept(false)
{
return (static_cast<U>(t) != u) ? narrow_throw_exception(t) : t;
}
template <class T, class U>
constexpr T narrow2_(T t, U u) noexcept(false)
{
return (!is_same_signedness<T, U>::value && ((t < T{}) != (u < U{}))) ?
narrow_throw_exception(t) : t;
}

template <class T, class U>
constexpr T narrow(T t, U u) noexcept(false)
{
return narrow1_(t, u) ? narrow2_(t, u) : t;
}
} // namespace details
// narrow() : a checked version of narrow_cast() that throws if the cast changed the value
template <class T, class U>
constexpr T narrow(U u) noexcept(false)
{
return details::narrow(narrow_cast<T>(u), u);
}
}

namespace gsl
{
template <class T, class U>
constexpr T narrow_cast(U&& u) noexcept
{
return Gsl::narrow_cast<T>(std::forward<U>(u));
}

template <class T, class U>
constexpr T narrow(U u) noexcept(false)
{
return Gsl::narrow<T>(u);
}


template <typename T>
using span = mem::Span<T>;

template <typename T>
inline span<T> make_span(T* d, size_t sz)
{
return mem::make_Span<T>(d, sz);
}

template <typename TContainer>
inline span<typename TContainer::value_type> make_span(TContainer& c)
{
return mem::make_Span(c);
}
template <typename TContainer>
inline span<typename TContainer::value_type> make_span(const TContainer& c)
{
return make_span(const_cast<TContainer&>(c));
}
}

#endif // CODA_OSS_Gsl__h_INCLUDED_
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,16 @@ class AbstractTiedThreadPool : public AbstractThreadPool<Request_T>
protected:
virtual mt::TiedWorkerThread<Request_T>*
newTiedWorker(mt::RequestQueue<Request_T>* q,
#if CODA_OSS_cpp17
std::unique_ptr<CPUAffinityThreadInitializer>&& init) = 0;
#if !CODA_OSS_cpp17
#else
std::auto_ptr<CPUAffinityThreadInitializer> init) = 0;
virtual mt::TiedWorkerThread<Request_T>*
newTiedWorker(mt::RequestQueue<Request_T>* q,
std::auto_ptr<CPUAffinityThreadInitializer> init) = 0;
std::unique_ptr<CPUAffinityThreadInitializer>&& init) {
std::auto_ptr<CPUAffinityThreadInitializer> init_(init.release());
return newTiedWorker(q, init_);
}
#endif


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class ByteProvider
{
return mFileHeader;
}
void getFileHeader(gsl::span<const std::byte>&) const;
void getFileHeader(std::span<const std::byte>&) const;

/*!
* \return The raw bytes for each image subheader. Vector size matches the
Expand All @@ -141,7 +141,7 @@ class ByteProvider
{
return mImageSubheaders;
}
void getImageSubheaders(std::vector<gsl::span<const std::byte>>&) const;
void getImageSubheaders(std::vector<std::span<const std::byte>>&) const;

/*!
* \return The raw bytes for each DES (subheader immediately followed by
Expand All @@ -151,7 +151,7 @@ class ByteProvider
{
return mDesSubheaderAndData;
}
void getDesSubheaderAndData(gsl::span<const std::byte>&) const;
void getDesSubheaderAndData(std::span<const std::byte>&) const;

/*!
* \return The file offset for each image subheader. Vector size matches
Expand Down
5 changes: 2 additions & 3 deletions externals/nitro/modules/c++/nitf/include/nitf/System.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@

#include <stdint.h>

#include <sys/CStdDef.h>
#include <sys/Conf.h>

#include "nitf/System.h"
#include "nitf/Field.h"
#include "nitf/Types.h"

#include "nitf/coda-oss.hpp"

namespace nitf
{
// Keeping these here so that code using "nitf::Uint64" still compiles;
Expand Down
8 changes: 4 additions & 4 deletions externals/nitro/modules/c++/nitf/source/ByteProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,18 +570,18 @@ void ByteProvider::getBytes(const void* imageData,
}
}

static gsl::span<const std::byte> make_span(const std::vector<sys::byte>& v)
static std::span<const std::byte> make_span(const std::vector<sys::byte>& v)
{
auto pData = reinterpret_cast<const std::byte*>(v.data());
return gsl::make_span(pData, v.size());
}

void nitf::ByteProvider::getFileHeader(gsl::span<const std::byte>& result) const
void nitf::ByteProvider::getFileHeader(std::span<const std::byte>& result) const
{
result = make_span(getFileHeader());
}

void nitf::ByteProvider::getImageSubheaders(std::vector<gsl::span<const std::byte>>& result) const
void nitf::ByteProvider::getImageSubheaders(std::vector<std::span<const std::byte>>& result) const
{
auto& headers = getImageSubheaders();
for (auto& header : headers)
Expand All @@ -590,7 +590,7 @@ void nitf::ByteProvider::getImageSubheaders(std::vector<gsl::span<const std::byt
}
}

void nitf::ByteProvider::getDesSubheaderAndData(gsl::span<const std::byte>& result) const
void nitf::ByteProvider::getDesSubheaderAndData(std::span<const std::byte>& result) const
{
result = make_span(getDesSubheaderAndData());
}
8 changes: 4 additions & 4 deletions externals/nitro/modules/c++/nitf/source/SegmentSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ nitf::SegmentMemorySource::SegmentMemorySource(const std::string& data,
{
}
template<>
nitf::SegmentMemorySource::SegmentMemorySource(const gsl::span<const sys::byte>& data, nitf::Off start,
nitf::SegmentMemorySource::SegmentMemorySource(const std::span<const sys::byte>& data, nitf::Off start,
int byteSkip, bool copyData)
: SegmentMemorySource(reinterpret_cast<const char*>(data.data()), gsl::narrow<nitf::Off>(data.size()), start, byteSkip, copyData)
{
}
template<>
nitf::SegmentMemorySource::SegmentMemorySource(const gsl::span<const std::byte>& data, nitf::Off start,
nitf::SegmentMemorySource::SegmentMemorySource(const std::span<const std::byte>& data, nitf::Off start,
int byteSkip, bool copyData)
: SegmentMemorySource(reinterpret_cast<const char*>(data.data()), gsl::narrow<nitf::Off>(data.size()), start, byteSkip, copyData)
{
}

inline gsl::span<const std::byte> make_span(const std::vector<std::byte>& data)
inline std::span<const std::byte> make_span(const std::vector<std::byte>& data)
{
return gsl::make_span(data);
}
Expand All @@ -63,7 +63,7 @@ nitf::SegmentMemorySource::SegmentMemorySource(const std::vector<std::byte>& dat
{
}

inline gsl::span<const sys::byte> make_span(const std::vector<sys::byte>& data)
inline std::span<const sys::byte> make_span(const std::vector<sys::byte>& data)
{
return gsl::make_span(data);
}
Expand Down
16 changes: 8 additions & 8 deletions externals/nitro/modules/java/cgm/src/fixme_test/log4j.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ------------------------------------------------------------------------
# L O G 4 J C O N F I G U R A T I O N
# ------------------------------------------------------------------------
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%-20d{dd MMM yyyy HH:mm:ss} [%t][%c%x] --> %-5p - %m%n

log4j.rootCategory = DEBUG, console
# ------------------------------------------------------------------------
# L O G 4 J C O N F I G U R A T I O N
# ------------------------------------------------------------------------
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%-20d{dd MMM yyyy HH:mm:ss} [%t][%c%x] --> %-5p - %m%n

log4j.rootCategory = DEBUG, console
Loading

0 comments on commit 74727d4

Please sign in to comment.