react-native-nitro-xlsx 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NitroXlsx.podspec +26 -27
- package/Package.swift +31 -10
- package/README.md +21 -9
- package/android/CMakeLists.txt +20 -27
- package/cpp/HybridNitroXlsx.cpp +25 -1
- package/cpp/HybridXlsxCellFormat.cpp +46 -146
- package/cpp/HybridXlsxCellFormat.hpp +9 -41
- package/cpp/HybridXlsxConditionalFormat.cpp +4 -1
- package/cpp/HybridXlsxConditionalFormats.cpp +5 -1
- package/cpp/HybridXlsxWorkbook.cpp +38 -8
- package/cpp/HybridXlsxWorkbook.hpp +10 -1
- package/cpp/HybridXlsxWorksheet.cpp +422 -141
- package/cpp/HybridXlsxWorksheet.hpp +4 -1
- package/cpp/XlsxCacheDir.cpp +25 -2
- package/cpp/XlsxCacheDir.hpp +3 -1
- package/cpp/XlsxCellStyle.hpp +360 -0
- package/cpp/XlsxJson.cpp +29 -8
- package/package.json +2 -2
- package/scripts/run-cpp-tests.sh +1 -1
- package/scripts/sync-openxlsx-headers.sh +34 -0
- package/src/__mocks__/react-native-nitro-modules.ts +523 -20
- package/src/__tests__/index.test.ts +124 -16
- package/src/index.ts +13 -13
- package/thirdparty/OpenXLSX/.clang-format +118 -0
- package/thirdparty/OpenXLSX/.clang-tidy +28 -0
- package/thirdparty/OpenXLSX/.gitignore +130 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_before_XMLNode_wrappers +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespace_and_stripping +49 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespace_char_support +49 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespace_support +49 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespaced_name_disabled +49 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-08-11-benchmarks_post-XLCellIterator-Rework +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-08-14-benchmarks_post-default-row-column-style-support +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-09-02-benchmarks +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-12-19-benchmarks +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-12-30-benchmarks-post-XLSharedStrings-by-ref +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-01-09-benchmarks-post-conditionalFormatsAndSheetProtection +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-01-10-benchmarks-post-XLCellValue-bugfix +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-01-31-benchmarks-post-XLComments-implementation +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-02-02-benchmarks-post-XLRowIterator-Rework +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-07-20-benchmarks-after-hiding-pugixml-internals +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-08-29-benchmarks-after-code-review-with-libzip +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/Benchmark.cpp +249 -0
- package/thirdparty/OpenXLSX/Benchmarks/CMakeLists.txt +19 -0
- package/thirdparty/OpenXLSX/CMakeLists.txt +466 -0
- package/thirdparty/OpenXLSX/Documentation/CMakeLists.txt +31 -0
- package/thirdparty/OpenXLSX/Documentation/Doxyfile.in +2471 -0
- package/thirdparty/OpenXLSX/Documentation/DoxygenLayout.xml +194 -0
- package/thirdparty/OpenXLSX/Documentation/customdoxygen.css +1355 -0
- package/thirdparty/OpenXLSX/Examples/CMakeLists.txt +103 -0
- package/thirdparty/OpenXLSX/Examples/Demo1.cpp +279 -0
- package/thirdparty/OpenXLSX/Examples/Demo10.cpp +545 -0
- package/thirdparty/OpenXLSX/Examples/Demo1A.cpp +137 -0
- package/thirdparty/OpenXLSX/Examples/Demo2.cpp +65 -0
- package/thirdparty/OpenXLSX/Examples/Demo3.cpp +89 -0
- package/thirdparty/OpenXLSX/Examples/Demo4.cpp +86 -0
- package/thirdparty/OpenXLSX/Examples/Demo5.cpp +77 -0
- package/thirdparty/OpenXLSX/Examples/Demo6.cpp +103 -0
- package/thirdparty/OpenXLSX/Examples/Demo7.cpp +79 -0
- package/thirdparty/OpenXLSX/Examples/Demo8.cpp +117 -0
- package/thirdparty/OpenXLSX/Examples/Demo9.cpp +363 -0
- package/thirdparty/OpenXLSX/Examples/cmake/FindLIBZIP.cmake +61 -0
- package/thirdparty/OpenXLSX/Examples/external/CustomZip/CustomZip.hpp +256 -0
- package/thirdparty/OpenXLSX/LICENSE.md +29 -0
- package/thirdparty/OpenXLSX/Makefile.GNU +530 -0
- package/thirdparty/OpenXLSX/Notes/TBDs.txt +16 -0
- package/thirdparty/OpenXLSX/Notes/confirmed-TBCs.txt +8 -0
- package/thirdparty/OpenXLSX/Notes/styles-missing-support.xml +12 -0
- package/thirdparty/OpenXLSX/Notes/todo-list.txt +108 -0
- package/thirdparty/OpenXLSX/OpenXLSX/CMakeLists.txt +631 -0
- package/thirdparty/OpenXLSX/OpenXLSX/OpenXLSX.hpp +63 -0
- package/thirdparty/OpenXLSX/OpenXLSX/OpenXLSXConfig.cmake +11 -0
- package/thirdparty/OpenXLSX/OpenXLSX/cmake/bundle_static_library.cmake +198 -0
- package/thirdparty/OpenXLSX/OpenXLSX/cmake/patch_pkg_config.cmake +69 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/IZipArchive.hpp +361 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/IZipArchive.hpp +361 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/OpenXLSX-Exports.hpp +12 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLCell.hpp +367 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLCellIterator.hpp +252 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLCellRange.hpp +223 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLCellReference.hpp +317 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLCellValue.hpp +793 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLColor.hpp +232 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLColumn.hpp +159 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLCommandQuery.hpp +228 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLComments.hpp +270 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLConstants.hpp +18 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLContentTypes.hpp +264 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLDateTime.hpp +175 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLDocument.hpp +505 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLDrawing.hpp +452 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLException.hpp +161 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLFormula.hpp +375 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLIterator.hpp +40 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLMergeCells.hpp +216 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLProperties.hpp +348 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLRelationships.hpp +348 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLRow.hpp +721 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLRowData.hpp +488 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLSharedStrings.hpp +204 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLSheet.hpp +1640 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLStyles.hpp +2390 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLTables.hpp +132 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLWorkbook.hpp +404 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLXmlData.hpp +283 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLXmlFile.hpp +194 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLXmlParser.hpp +282 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLXmlParserForwardDeclarations.hpp +85 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/XLZipArchive.hpp +232 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/detail/LibZip.hpp +447 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/detail/OpenXLSXFileSystemTools.hpp +207 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX/detail/Zippy.hpp +1375 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX-Exports.hpp +12 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCell.hpp +367 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellIterator.hpp +252 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellRange.hpp +223 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellReference.hpp +317 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellValue.hpp +793 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLColor.hpp +232 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLColumn.hpp +159 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCommandQuery.hpp +228 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLComments.hpp +270 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLConstants.hpp +18 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLContentTypes.hpp +264 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLDateTime.hpp +175 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLDocument.hpp +505 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLDrawing.hpp +452 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLException.hpp +161 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLFormula.hpp +375 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLIterator.hpp +40 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLMergeCells.hpp +216 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLProperties.hpp +348 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLRelationships.hpp +348 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLRow.hpp +721 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLRowData.hpp +488 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLSharedStrings.hpp +204 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLSheet.hpp +1640 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLStyles.hpp +2390 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLTables.hpp +132 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLWorkbook.hpp +404 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlData.hpp +283 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlFile.hpp +194 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlParser.hpp +282 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlParserForwardDeclarations.hpp +85 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLZipArchive.hpp +232 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/detail/LibZip.hpp +447 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/detail/OpenXLSXFileSystemTools.hpp +207 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/detail/Zippy.hpp +1375 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCell.cpp +340 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellIterator.cpp +427 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellRange.cpp +221 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellReference.cpp +408 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellValue.cpp +519 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLColor.cpp +202 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLColumn.cpp +141 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLComments.cpp +637 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLContentTypes.cpp +329 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLDateTime.cpp +269 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLDocument.cpp +1678 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLDrawing.cpp +784 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLFormula.cpp +201 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLMergeCells.cpp +357 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLProperties.cpp +810 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLRelationships.cpp +529 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLRow.cpp +918 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLRowData.cpp +508 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLSharedStrings.cpp +220 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLSheet.cpp +1970 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLStyles.cpp +3014 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLTables.cpp +125 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLWorkbook.cpp +784 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLXmlData.cpp +247 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLXmlFile.cpp +160 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLXmlParser.cpp +261 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLZipArchive.cpp +266 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/utilities/XLUtilities.hpp +478 -0
- package/thirdparty/OpenXLSX/README.md +1279 -0
- package/thirdparty/OpenXLSX/Scripts/cmake-cleanup.sh +102 -0
- package/thirdparty/OpenXLSX/Scripts/compile.sh +23 -0
- package/thirdparty/OpenXLSX/Scripts/demos-cleanup.sh +25 -0
- package/thirdparty/OpenXLSX/Scripts/demos-run-all.sh +60 -0
- package/thirdparty/OpenXLSX/Scripts/guarded-xml-format.sh +47 -0
- package/thirdparty/OpenXLSX/Scripts/make-gnu.sh +11 -0
- package/thirdparty/OpenXLSX/Scripts/uninstall-manifest.sh +48 -0
- package/thirdparty/OpenXLSX/Scripts/xml-format-all.sh +19 -0
- package/thirdparty/OpenXLSX/Scripts/xml-format.sh +38 -0
- package/thirdparty/OpenXLSX/Tests/CMakeLists.txt +37 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch.hpp +17799 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_automake.hpp +68 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_sonarqube.hpp +182 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_tap.hpp +278 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_teamcity.hpp +212 -0
- package/thirdparty/OpenXLSX/Tests/main.cpp +55 -0
- package/thirdparty/OpenXLSX/Tests/testXLCell.cpp +176 -0
- package/thirdparty/OpenXLSX/Tests/testXLCellRange.cpp +180 -0
- package/thirdparty/OpenXLSX/Tests/testXLCellReference.cpp +160 -0
- package/thirdparty/OpenXLSX/Tests/testXLCellValue.cpp +366 -0
- package/thirdparty/OpenXLSX/Tests/testXLCellValueProxy.cpp +255 -0
- package/thirdparty/OpenXLSX/Tests/testXLColor.cpp +75 -0
- package/thirdparty/OpenXLSX/Tests/testXLDateTime.cpp +229 -0
- package/thirdparty/OpenXLSX/Tests/testXLDocument.cpp +197 -0
- package/thirdparty/OpenXLSX/Tests/testXLFormula.cpp +131 -0
- package/thirdparty/OpenXLSX/Tests/testXLRow.cpp +597 -0
- package/thirdparty/OpenXLSX/Tests/testXLSheet.cpp +77 -0
- package/thirdparty/OpenXLSX/Tests/ziptest-with-libs.cpp +88 -0
- package/thirdparty/OpenXLSX/Tests/ziptest.cpp +735 -0
- package/thirdparty/OpenXLSX/cmake/get-git-HEAD-ID.cmake +45 -0
- package/thirdparty/OpenXLSX/cmake/libopenxlsxCPackOptions.cmake.in +20 -0
- package/thirdparty/OpenXLSX/cmake/manage_dependency.cmake +813 -0
- package/thirdparty/OpenXLSX/cmake/recursive_library_type_test.cmake +52 -0
- package/thirdparty/OpenXLSX/gnu-make-crutch/OpenXLSX-Exports-shared.hpp +42 -0
- package/thirdparty/OpenXLSX/gnu-make-crutch/OpenXLSX-Exports-static.hpp +42 -0
- package/thirdparty/OpenXLSX/vcpkg.json +24 -0
- package/thirdparty/README.md +46 -0
- package/thirdparty/miniz/.clang-format +47 -0
- package/thirdparty/miniz/.travis.yml +2 -0
- package/thirdparty/miniz/CMakeLists.txt +333 -0
- package/thirdparty/miniz/CMakePresets.json +31 -0
- package/thirdparty/miniz/ChangeLog.md +272 -0
- package/thirdparty/miniz/Config.cmake.in +1 -0
- package/thirdparty/miniz/LICENSE +22 -0
- package/thirdparty/miniz/amalgamate.sh +57 -0
- package/thirdparty/miniz/examples/example1.c +105 -0
- package/thirdparty/miniz/examples/example2.c +164 -0
- package/thirdparty/miniz/examples/example3.c +269 -0
- package/thirdparty/miniz/examples/example4.c +102 -0
- package/thirdparty/miniz/examples/example5.c +327 -0
- package/thirdparty/miniz/examples/example6.c +189 -0
- package/thirdparty/miniz/meson.build +21 -0
- package/thirdparty/miniz/miniz.c +646 -0
- package/thirdparty/miniz/miniz.h +615 -0
- package/thirdparty/miniz/miniz.pc.in +13 -0
- package/thirdparty/miniz/miniz_common.h +89 -0
- package/thirdparty/miniz/miniz_export.h +20 -0
- package/thirdparty/miniz/miniz_tdef.c +1602 -0
- package/thirdparty/miniz/miniz_tdef.h +199 -0
- package/thirdparty/miniz/miniz_tinfl.c +778 -0
- package/thirdparty/miniz/miniz_tinfl.h +150 -0
- package/thirdparty/miniz/miniz_zip.c +4895 -0
- package/thirdparty/miniz/miniz_zip.h +454 -0
- package/thirdparty/miniz/readme.md +46 -0
- package/thirdparty/miniz/test.sh +36 -0
- package/thirdparty/miniz/tests/add_in_place_fuzzer.c +87 -0
- package/thirdparty/miniz/tests/catch_amalgamated.cpp +10795 -0
- package/thirdparty/miniz/tests/catch_amalgamated.hpp +13143 -0
- package/thirdparty/miniz/tests/checksum_fuzzer.c +26 -0
- package/thirdparty/miniz/tests/compress_fuzzer.c +91 -0
- package/thirdparty/miniz/tests/flush_fuzzer.c +88 -0
- package/thirdparty/miniz/tests/fuzz_main.c +55 -0
- package/thirdparty/miniz/tests/large_fuzzer.c +133 -0
- package/thirdparty/miniz/tests/main.cpp +185 -0
- package/thirdparty/miniz/tests/miniz_tdefl_fuzzer.cc +115 -0
- package/thirdparty/miniz/tests/miniz_tester.cpp +1881 -0
- package/thirdparty/miniz/tests/miniz_zip_validate_fuzzer.cc +71 -0
- package/thirdparty/miniz/tests/miniz_zip_writer_fuzzer.cc +96 -0
- package/thirdparty/miniz/tests/ossfuzz.sh +48 -0
- package/thirdparty/miniz/tests/small_fuzzer.c +126 -0
- package/thirdparty/miniz/tests/timer.cpp +152 -0
- package/thirdparty/miniz/tests/timer.h +40 -0
- package/thirdparty/miniz/tests/uncompress2_fuzzer.c +21 -0
- package/thirdparty/miniz/tests/uncompress_fuzzer.c +30 -0
- package/thirdparty/miniz/tests/zip.dict +9 -0
- package/thirdparty/miniz/tests/zip_fuzzer.c +63 -0
- package/thirdparty/pugixml/.codecov.yml +7 -0
- package/thirdparty/pugixml/.gitattributes +1 -0
- package/thirdparty/pugixml/CMakeLists.txt +330 -0
- package/thirdparty/pugixml/LICENSE.md +24 -0
- package/thirdparty/pugixml/Makefile +98 -0
- package/thirdparty/pugixml/README.md +81 -0
- package/thirdparty/pugixml/SECURITY.md +9 -0
- package/thirdparty/pugixml/appveyor.yml +50 -0
- package/thirdparty/pugixml/docs/config.adoc +7 -0
- package/thirdparty/pugixml/docs/images/dom_tree.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_link1.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_link2.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_pch1.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_pch2.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_pch3.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_pch4.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2010_link1.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2010_link2.png +0 -0
- package/thirdparty/pugixml/docs/manual.adoc +3326 -0
- package/thirdparty/pugixml/docs/manual.html +6395 -0
- package/thirdparty/pugixml/docs/quickstart.adoc +287 -0
- package/thirdparty/pugixml/docs/quickstart.html +1107 -0
- package/thirdparty/pugixml/docs/samples/character.xml +8 -0
- package/thirdparty/pugixml/docs/samples/custom_memory_management.cpp +27 -0
- package/thirdparty/pugixml/docs/samples/include.cpp +64 -0
- package/thirdparty/pugixml/docs/samples/load_error_handling.cpp +33 -0
- package/thirdparty/pugixml/docs/samples/load_file.cpp +16 -0
- package/thirdparty/pugixml/docs/samples/load_memory.cpp +66 -0
- package/thirdparty/pugixml/docs/samples/load_options.cpp +30 -0
- package/thirdparty/pugixml/docs/samples/load_stream.cpp +97 -0
- package/thirdparty/pugixml/docs/samples/modify_add.cpp +29 -0
- package/thirdparty/pugixml/docs/samples/modify_base.cpp +43 -0
- package/thirdparty/pugixml/docs/samples/modify_remove.cpp +27 -0
- package/thirdparty/pugixml/docs/samples/save_custom_writer.cpp +116 -0
- package/thirdparty/pugixml/docs/samples/save_declaration.cpp +27 -0
- package/thirdparty/pugixml/docs/samples/save_file.cpp +17 -0
- package/thirdparty/pugixml/docs/samples/save_options.cpp +48 -0
- package/thirdparty/pugixml/docs/samples/save_stream.cpp +18 -0
- package/thirdparty/pugixml/docs/samples/save_subtree.cpp +26 -0
- package/thirdparty/pugixml/docs/samples/text.cpp +35 -0
- package/thirdparty/pugixml/docs/samples/transitions.xml +7 -0
- package/thirdparty/pugixml/docs/samples/traverse_base.cpp +51 -0
- package/thirdparty/pugixml/docs/samples/traverse_iter.cpp +27 -0
- package/thirdparty/pugixml/docs/samples/traverse_predicate.cpp +48 -0
- package/thirdparty/pugixml/docs/samples/traverse_rangefor.cpp +32 -0
- package/thirdparty/pugixml/docs/samples/traverse_walker.cpp +35 -0
- package/thirdparty/pugixml/docs/samples/tree.xml +12 -0
- package/thirdparty/pugixml/docs/samples/weekly-shift_jis.xml +78 -0
- package/thirdparty/pugixml/docs/samples/weekly-utf-16.xml +0 -0
- package/thirdparty/pugixml/docs/samples/weekly-utf-8.xml +78 -0
- package/thirdparty/pugixml/docs/samples/xgconsole.xml +12 -0
- package/thirdparty/pugixml/docs/samples/xpath_error.cpp +43 -0
- package/thirdparty/pugixml/docs/samples/xpath_query.cpp +36 -0
- package/thirdparty/pugixml/docs/samples/xpath_select.cpp +28 -0
- package/thirdparty/pugixml/docs/samples/xpath_variables.cpp +38 -0
- package/thirdparty/pugixml/readme.txt +50 -0
- package/thirdparty/pugixml/scripts/archive.py +54 -0
- package/thirdparty/pugixml/scripts/cocoapods_push.sh +4 -0
- package/thirdparty/pugixml/scripts/natvis/pugixml.natvis +77 -0
- package/thirdparty/pugixml/scripts/natvis/pugixml_compact.natvis +506 -0
- package/thirdparty/pugixml/scripts/nuget/build/native/pugixml-propertiesui.xml +17 -0
- package/thirdparty/pugixml/scripts/nuget/build/native/pugixml.targets +28 -0
- package/thirdparty/pugixml/scripts/nuget/pugixml.nuspec +20 -0
- package/thirdparty/pugixml/scripts/nuget_build.ps1 +60 -0
- package/thirdparty/pugixml/scripts/premake4.lua +92 -0
- package/thirdparty/pugixml/scripts/pugixml-config.cmake.in +12 -0
- package/thirdparty/pugixml/scripts/pugixml.pc.in +11 -0
- package/thirdparty/pugixml/scripts/pugixml.podspec +14 -0
- package/thirdparty/pugixml/scripts/pugixml.xcodeproj/project.pbxproj +212 -0
- package/thirdparty/pugixml/scripts/pugixml_airplay.mkf +13 -0
- package/thirdparty/pugixml/scripts/pugixml_codeblocks.cbp +44 -0
- package/thirdparty/pugixml/scripts/pugixml_codelite.project +56 -0
- package/thirdparty/pugixml/scripts/pugixml_dll.rc +45 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2005.vcproj +343 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2005_static.vcproj +343 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2008.vcproj +339 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2008_static.vcproj +339 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2010.vcxproj +191 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2010_static.vcxproj +191 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2013.vcxproj +199 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2013_static.vcxproj +199 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2015.vcxproj +172 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2015_static.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2017.vcxproj +172 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2017_static.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2019.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2019_static.vcxproj +180 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2022.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2022_static.vcxproj +180 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2026.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2026_static.vcxproj +180 -0
- package/thirdparty/pugixml/scripts/sbom.cdx.json +47 -0
- package/thirdparty/pugixml/src/pugiconfig.hpp +81 -0
- package/thirdparty/pugixml/src/pugixml.cpp +13776 -0
- package/thirdparty/pugixml/src/pugixml.hpp +1604 -0
- package/thirdparty/pugixml/tests/allocator.cpp +175 -0
- package/thirdparty/pugixml/tests/allocator.hpp +10 -0
- package/thirdparty/pugixml/tests/autotest-appveyor.ps1 +93 -0
- package/thirdparty/pugixml/tests/cmake-appveyor.ps1 +57 -0
- package/thirdparty/pugixml/tests/data/empty.xml +0 -0
- package/thirdparty/pugixml/tests/data/large.xml +1 -0
- package/thirdparty/pugixml/tests/data/latintest_latin1.xml +1 -0
- package/thirdparty/pugixml/tests/data/latintest_utf8.xml +1 -0
- package/thirdparty/pugixml/tests/data/multiline.xml +3 -0
- package/thirdparty/pugixml/tests/data/small.xml +1 -0
- package/thirdparty/pugixml/tests/data/truncation.xml +19 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_be.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_be_bom.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_be_clean.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_be_nodecl.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_le.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_le_bom.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_le_clean.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_le_nodecl.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_be.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_be_bom.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_be_clean.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_be_nodecl.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_le.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_le_bom.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_le_clean.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_le_nodecl.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf8.xml +87 -0
- package/thirdparty/pugixml/tests/data/utftest_utf8_bom.xml +87 -0
- package/thirdparty/pugixml/tests/data/utftest_utf8_clean.xml +84 -0
- package/thirdparty/pugixml/tests/data/utftest_utf8_nodecl.xml +86 -0
- package/thirdparty/pugixml/tests/data//321/202/320/265/321/201/321/202.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/basic.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/doctype.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/refs.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/types.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/utf16.xml +0 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/utf32.xml +0 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/basic.xpath +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/functions.xpath +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/math.xpath +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/path.xpath +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/predicate.xpath +1 -0
- package/thirdparty/pugixml/tests/fuzz_parse.cpp +14 -0
- package/thirdparty/pugixml/tests/fuzz_parse.dict +72 -0
- package/thirdparty/pugixml/tests/fuzz_setup.sh +11 -0
- package/thirdparty/pugixml/tests/fuzz_xpath.cpp +46 -0
- package/thirdparty/pugixml/tests/fuzz_xpath.dict +72 -0
- package/thirdparty/pugixml/tests/helpers.hpp +114 -0
- package/thirdparty/pugixml/tests/main.cpp +218 -0
- package/thirdparty/pugixml/tests/test.cpp +220 -0
- package/thirdparty/pugixml/tests/test.hpp +175 -0
- package/thirdparty/pugixml/tests/test_compact.cpp +150 -0
- package/thirdparty/pugixml/tests/test_deprecated.cpp +25 -0
- package/thirdparty/pugixml/tests/test_document.cpp +1910 -0
- package/thirdparty/pugixml/tests/test_dom_modify.cpp +2122 -0
- package/thirdparty/pugixml/tests/test_dom_text.cpp +601 -0
- package/thirdparty/pugixml/tests/test_dom_traverse.cpp +1481 -0
- package/thirdparty/pugixml/tests/test_header_guard.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_iosfwd_1.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_iosfwd_2.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_iostream_1.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_iostream_2.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_only_1.cpp +21 -0
- package/thirdparty/pugixml/tests/test_header_only_2.cpp +21 -0
- package/thirdparty/pugixml/tests/test_header_string_1.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_string_2.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_string_iostream.cpp +5 -0
- package/thirdparty/pugixml/tests/test_memory.cpp +303 -0
- package/thirdparty/pugixml/tests/test_parse.cpp +1463 -0
- package/thirdparty/pugixml/tests/test_parse_doctype.cpp +366 -0
- package/thirdparty/pugixml/tests/test_unicode.cpp +152 -0
- package/thirdparty/pugixml/tests/test_version.cpp +5 -0
- package/thirdparty/pugixml/tests/test_write.cpp +757 -0
- package/thirdparty/pugixml/tests/test_xpath.cpp +833 -0
- package/thirdparty/pugixml/tests/test_xpath_api.cpp +646 -0
- package/thirdparty/pugixml/tests/test_xpath_functions.cpp +844 -0
- package/thirdparty/pugixml/tests/test_xpath_operators.cpp +566 -0
- package/thirdparty/pugixml/tests/test_xpath_parse.cpp +428 -0
- package/thirdparty/pugixml/tests/test_xpath_paths.cpp +787 -0
- package/thirdparty/pugixml/tests/test_xpath_paths_abbrev_w3c.cpp +219 -0
- package/thirdparty/pugixml/tests/test_xpath_paths_w3c.cpp +312 -0
- package/thirdparty/pugixml/tests/test_xpath_variables.cpp +683 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_1.cpp +411 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_2.cpp +417 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_3.cpp +321 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_4.cpp +300 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_5.cpp +295 -0
- package/thirdparty/pugixml/tests/writer_string.cpp +79 -0
- package/thirdparty/pugixml/tests/writer_string.hpp +27 -0
- package/scripts/prepare-openxlsx.js +0 -126
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Kenneth Balslev on 24/08/2020.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
#ifndef OPENXLSX_XLROWDATA_HPP
|
|
6
|
+
#define OPENXLSX_XLROWDATA_HPP
|
|
7
|
+
|
|
8
|
+
#ifdef _MSC_VER // conditionally enable MSVC specific pragmas to avoid other compilers warning about unknown pragmas
|
|
9
|
+
# pragma warning(push)
|
|
10
|
+
# pragma warning(disable : 4251)
|
|
11
|
+
# pragma warning(disable : 4275)
|
|
12
|
+
#endif // _MSC_VER
|
|
13
|
+
|
|
14
|
+
// ===== External Includes ===== //
|
|
15
|
+
#include <deque>
|
|
16
|
+
#include <iterator>
|
|
17
|
+
#include <list>
|
|
18
|
+
#include <memory>
|
|
19
|
+
#include <vector>
|
|
20
|
+
|
|
21
|
+
// ===== OpenXLSX Includes ===== //
|
|
22
|
+
#include "OpenXLSX-Exports.hpp"
|
|
23
|
+
#include "XLCell.hpp"
|
|
24
|
+
#include "XLConstants.hpp"
|
|
25
|
+
#include "XLException.hpp"
|
|
26
|
+
#include "XLIterator.hpp"
|
|
27
|
+
#include "XLXmlParserForwardDeclarations.hpp"
|
|
28
|
+
|
|
29
|
+
// ========== CLASS AND ENUM TYPE DEFINITIONS ========== //
|
|
30
|
+
namespace OpenXLSX
|
|
31
|
+
{
|
|
32
|
+
class XLRow;
|
|
33
|
+
class XLRowDataRange;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @brief This class encapsulates a (non-const) iterator, for iterating over the cells in a row.
|
|
37
|
+
* @todo Consider implementing a const iterator also
|
|
38
|
+
*/
|
|
39
|
+
class OPENXLSX_EXPORT XLRowDataIterator
|
|
40
|
+
{
|
|
41
|
+
friend class XLRowDataRange;
|
|
42
|
+
|
|
43
|
+
public:
|
|
44
|
+
using iterator_category = std::forward_iterator_tag;
|
|
45
|
+
using value_type = XLCell;
|
|
46
|
+
using difference_type = int64_t;
|
|
47
|
+
using pointer = XLCell*;
|
|
48
|
+
using reference = XLCell&;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @brief Destructor.
|
|
52
|
+
*/
|
|
53
|
+
~XLRowDataIterator();
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @brief Copy constructor.
|
|
57
|
+
* @param other Object to be copied.
|
|
58
|
+
*/
|
|
59
|
+
XLRowDataIterator(const XLRowDataIterator& other);
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @brief Move constructor.
|
|
63
|
+
* @param other Object to be moved.
|
|
64
|
+
*/
|
|
65
|
+
XLRowDataIterator(XLRowDataIterator&& other) noexcept;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @brief Copy assignment operator.
|
|
69
|
+
* @param other Object to be copied.
|
|
70
|
+
* @return Reference to the copied-to object.
|
|
71
|
+
*/
|
|
72
|
+
XLRowDataIterator& operator=(const XLRowDataIterator& other);
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @brief Move assignment operator.
|
|
76
|
+
* @param other Object to be moved.
|
|
77
|
+
* @return Reference to the moved-to object.
|
|
78
|
+
*/
|
|
79
|
+
XLRowDataIterator& operator=(XLRowDataIterator&& other) noexcept;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @brief Pre-increment of the iterator.
|
|
83
|
+
* @return Reference to the iterator object.
|
|
84
|
+
*/
|
|
85
|
+
XLRowDataIterator& operator++();
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @brief Post-increment of the iterator.
|
|
89
|
+
* @return Reference to the iterator object.
|
|
90
|
+
*/
|
|
91
|
+
XLRowDataIterator operator++(int); // NOLINT
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @brief Dereferencing operator.
|
|
95
|
+
* @return Reference to the object pointed to by the iterator.
|
|
96
|
+
*/
|
|
97
|
+
reference operator*();
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* @brief Arrow operator.
|
|
101
|
+
* @return Pointer to the object pointed to by the iterator.
|
|
102
|
+
*/
|
|
103
|
+
pointer operator->();
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* @brief Equality operator.
|
|
107
|
+
* @param rhs XLRowDataIterator to compare to.
|
|
108
|
+
* @return true if equal, otherwise false.
|
|
109
|
+
*/
|
|
110
|
+
bool operator==(const XLRowDataIterator& rhs) const;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @brief Non-equality operator.
|
|
114
|
+
* @param rhs XLRowDataIterator to compare to.
|
|
115
|
+
* @return false if equal, otherwise true.
|
|
116
|
+
*/
|
|
117
|
+
bool operator!=(const XLRowDataIterator& rhs) const;
|
|
118
|
+
|
|
119
|
+
private:
|
|
120
|
+
/**
|
|
121
|
+
* @brief Constructor.
|
|
122
|
+
* @param rowDataRange The range to iterate over.
|
|
123
|
+
* @param loc The location of the iterator (begin or end).
|
|
124
|
+
*/
|
|
125
|
+
XLRowDataIterator(const XLRowDataRange& rowDataRange, XLIteratorLocation loc);
|
|
126
|
+
|
|
127
|
+
std::unique_ptr<XLRowDataRange> m_dataRange; /**< A pointer to the range to iterate over. */
|
|
128
|
+
std::unique_ptr<XMLNode> m_cellNode; /**< The XML node representing the cell currently pointed at. */
|
|
129
|
+
XLCell m_currentCell; /**< The XLCell currently pointed at. */
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @brief This class encapsulates the concept of a contiguous range of cells in a row.
|
|
134
|
+
*/
|
|
135
|
+
class OPENXLSX_EXPORT XLRowDataRange
|
|
136
|
+
{
|
|
137
|
+
friend class XLRowDataIterator;
|
|
138
|
+
friend class XLRowDataProxy;
|
|
139
|
+
friend class XLRow;
|
|
140
|
+
|
|
141
|
+
private:
|
|
142
|
+
/**
|
|
143
|
+
* @brief Constructor for an empty range.
|
|
144
|
+
*/
|
|
145
|
+
explicit XLRowDataRange();
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @brief Constructor.
|
|
149
|
+
* @param rowNode XMLNode representing the row of the range.
|
|
150
|
+
* @param firstColumn The index of the first column.
|
|
151
|
+
* @param lastColumn The index of the last column.
|
|
152
|
+
* @param sharedStrings A pointer to the shared strings repository.
|
|
153
|
+
* @throws XLOverflowError if firstColumn > lastColumn
|
|
154
|
+
*/
|
|
155
|
+
explicit XLRowDataRange(const XMLNode& rowNode, uint16_t firstColumn, uint16_t lastColumn, const XLSharedStrings& sharedStrings);
|
|
156
|
+
|
|
157
|
+
public:
|
|
158
|
+
/**
|
|
159
|
+
* @brief Copy constructor.
|
|
160
|
+
* @param other Object to be copied.
|
|
161
|
+
*/
|
|
162
|
+
XLRowDataRange(const XLRowDataRange& other);
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @brief Move constructor.
|
|
166
|
+
* @param other Object to be moved.
|
|
167
|
+
*/
|
|
168
|
+
XLRowDataRange(XLRowDataRange&& other) noexcept;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @brief Destructor.
|
|
172
|
+
*/
|
|
173
|
+
~XLRowDataRange();
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* @brief Copy assignment operator.
|
|
177
|
+
* @param other Object to be copied.
|
|
178
|
+
* @return A reference to the copied-to object.
|
|
179
|
+
*/
|
|
180
|
+
XLRowDataRange& operator=(const XLRowDataRange& other);
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* @brief Move assignment operator.
|
|
184
|
+
* @param other Object to be moved.
|
|
185
|
+
* @return A reference to the moved-to object.
|
|
186
|
+
*/
|
|
187
|
+
XLRowDataRange& operator=(XLRowDataRange&& other) noexcept;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* @brief Get the size (length) of the range.
|
|
191
|
+
* @return The size of the range.
|
|
192
|
+
*/
|
|
193
|
+
uint16_t size() const;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @brief Get an iterator to the first element.
|
|
197
|
+
* @return An XLRowDataIterator pointing to the first element.
|
|
198
|
+
*/
|
|
199
|
+
XLRowDataIterator begin();
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @brief Get an iterator to (one-past) the last element.
|
|
203
|
+
* @return An XLRowDataIterator pointing to (one past) the last element.
|
|
204
|
+
*/
|
|
205
|
+
XLRowDataIterator end();
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* @brief Templated assignment operator - assign value to all existing cells in the row
|
|
209
|
+
* @note CAUTION: non-existing cells will not be assigned
|
|
210
|
+
* @tparam T The type of the value argument.
|
|
211
|
+
* @param value The value.
|
|
212
|
+
* @return A reference to the assigned-to object.
|
|
213
|
+
*/
|
|
214
|
+
template<typename T,
|
|
215
|
+
typename = std::enable_if_t<
|
|
216
|
+
std::is_integral_v<T> || std::is_floating_point_v<T> || std::is_same_v<std::decay_t<T>, std::string> ||
|
|
217
|
+
std::is_same_v<std::decay_t<T>, std::string_view> || std::is_same_v<std::decay_t<T>, const char*> ||
|
|
218
|
+
std::is_same_v<std::decay_t<T>, char*> || std::is_same_v<T, XLDateTime>>>
|
|
219
|
+
XLRowDataRange& operator=(T value)
|
|
220
|
+
{
|
|
221
|
+
// forward implementation to templated XLCellValue& XLCellValue::operator=(T value)
|
|
222
|
+
for (auto it = begin(); it != end(); ++it) it->value() = value;
|
|
223
|
+
return *this;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
private:
|
|
227
|
+
std::unique_ptr<XMLNode> m_rowNode; /**< */
|
|
228
|
+
uint16_t m_firstCol { 1 }; /**< The cell reference of the first cell in the range */
|
|
229
|
+
uint16_t m_lastCol { 1 }; /**< The cell reference of the last cell in the range */
|
|
230
|
+
XLSharedStringsRef m_sharedStrings; /**< */
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* @brief The XLRowDataProxy is used as a proxy object when getting or setting row data. The class facilitates easy conversion
|
|
235
|
+
* to/from containers.
|
|
236
|
+
*/
|
|
237
|
+
class OPENXLSX_EXPORT XLRowDataProxy
|
|
238
|
+
{
|
|
239
|
+
friend class XLRow;
|
|
240
|
+
|
|
241
|
+
public:
|
|
242
|
+
/**
|
|
243
|
+
* @brief explicitly delete default constructor.
|
|
244
|
+
*/
|
|
245
|
+
XLRowDataProxy() = delete;
|
|
246
|
+
|
|
247
|
+
private:
|
|
248
|
+
/**
|
|
249
|
+
* @brief constructor.
|
|
250
|
+
* @param row Pointer to the parent XLRow object.
|
|
251
|
+
* @param rowNode Pointer to the underlying XML node representing the row.
|
|
252
|
+
*/
|
|
253
|
+
XLRowDataProxy(XLRow* row, XMLNode* rowNode);
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* @brief copy constructor.
|
|
257
|
+
* @param other Object to be copied.
|
|
258
|
+
* @note The copy constructor is private in order to prevent use of the auto keyword in client code.
|
|
259
|
+
*/
|
|
260
|
+
XLRowDataProxy(const XLRowDataProxy& other);
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* @brief move constructor.
|
|
264
|
+
* @param other Object to be moved.
|
|
265
|
+
* @note Made private, as move construction should only be allowed when the parent object is moved. Disallowed for client code.
|
|
266
|
+
*/
|
|
267
|
+
XLRowDataProxy(XLRowDataProxy&& other) noexcept;
|
|
268
|
+
|
|
269
|
+
public:
|
|
270
|
+
/**
|
|
271
|
+
* @brief destructor
|
|
272
|
+
*/
|
|
273
|
+
~XLRowDataProxy();
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* @brief copy assignment operator.
|
|
277
|
+
* @param other Object to be copied.
|
|
278
|
+
* @return A reference to the copied-to object.
|
|
279
|
+
*/
|
|
280
|
+
XLRowDataProxy& operator=(const XLRowDataProxy& other);
|
|
281
|
+
|
|
282
|
+
private:
|
|
283
|
+
/**
|
|
284
|
+
* @brief move assignment operator.
|
|
285
|
+
* @param other Object to be moved.
|
|
286
|
+
* @return Reference to the moved-to object.
|
|
287
|
+
* @note Made private, as move assignment is disallowed for client code.
|
|
288
|
+
*/
|
|
289
|
+
XLRowDataProxy& operator=(XLRowDataProxy&& other) noexcept;
|
|
290
|
+
|
|
291
|
+
public:
|
|
292
|
+
/**
|
|
293
|
+
* @brief Assignment operator taking a std::vector of XLCellValues as an argument.
|
|
294
|
+
* @param values A std::vector of XLCellValues representing the values to be assigned.
|
|
295
|
+
* @return A reference to the copied-to object.
|
|
296
|
+
*/
|
|
297
|
+
XLRowDataProxy& operator=(const std::vector<XLCellValue>& values);
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* @brief Assignment operator taking a std::vector of bool values as an argument.
|
|
301
|
+
* @param values A std::vector of bool values representing the values to be assigned.
|
|
302
|
+
* @return A reference to the copied-to object.
|
|
303
|
+
*/
|
|
304
|
+
XLRowDataProxy& operator=(const std::vector<bool>& values);
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* @brief Templated assignment operator taking any container supporting bidirectional iterators.
|
|
308
|
+
* @tparam T The container and value type (will be auto deducted by the compiler).
|
|
309
|
+
* @param values The container of the values to be assigned.
|
|
310
|
+
* @return A reference to the copied-to object.
|
|
311
|
+
* @throws XLOverflowError if size of container exceeds maximum number of columns.
|
|
312
|
+
*/
|
|
313
|
+
template<typename T,
|
|
314
|
+
typename = std::enable_if_t<!std::is_same_v<T, XLRowDataProxy> &&
|
|
315
|
+
std::is_base_of_v<std::bidirectional_iterator_tag,
|
|
316
|
+
typename std::iterator_traits<typename T::iterator>::iterator_category>,
|
|
317
|
+
T>>
|
|
318
|
+
XLRowDataProxy& operator=(const T& values) // 2024-04-30: whitespace support
|
|
319
|
+
{
|
|
320
|
+
if (values.size() > MAX_COLS) throw XLOverflowError("Container size exceeds maximum number of columns.");
|
|
321
|
+
if (values.size() == 0) return *this;
|
|
322
|
+
|
|
323
|
+
// ===== If the container value_type is XLCellValue, the values can be copied directly.
|
|
324
|
+
if constexpr (std::is_same_v<typename T::value_type, XLCellValue>) {
|
|
325
|
+
// ===== First, delete the values in the first N columns.
|
|
326
|
+
deleteCellValues(values.size()); // 2024-04-30: whitespace support
|
|
327
|
+
|
|
328
|
+
// ===== Then, prepend new cell nodes to current row node
|
|
329
|
+
auto colNo = values.size();
|
|
330
|
+
for (auto value = values.rbegin(); value != values.rend(); ++value) { // NOLINT
|
|
331
|
+
prependCellValue(*value, colNo); // 2024-04-30: whitespace support: this is safe because only prependCellValue (with
|
|
332
|
+
// whitespace support) touches the row data
|
|
333
|
+
--colNo;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// ===== If the container value_type is a POD type, use the overloaded operator= on each cell.
|
|
338
|
+
else {
|
|
339
|
+
auto range = XLRowDataRange(*m_rowNode, 1, values.size(), getSharedStrings());
|
|
340
|
+
auto dst = range.begin(); // 2024-04-30: whitespace support: safe because XLRowDataRange::begin invokes whitespace-safe
|
|
341
|
+
// getCellNode for column 1
|
|
342
|
+
auto src = values.begin();
|
|
343
|
+
|
|
344
|
+
while (true) {
|
|
345
|
+
dst->value() = *src;
|
|
346
|
+
++src;
|
|
347
|
+
if (src == values.end()) break;
|
|
348
|
+
++dst; // 2024-04-30: whitespace support: XLRowDataIterator::operator++ is whitespace-safe
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
return *this;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// // BEGIN working template header
|
|
356
|
+
// template<
|
|
357
|
+
// typename T,
|
|
358
|
+
// typename std::enable_if<
|
|
359
|
+
// !std::is_same_v< T, XLRowDataProxy >
|
|
360
|
+
// && std::is_base_of_v< XMLNode, T >,
|
|
361
|
+
// T
|
|
362
|
+
// >::type* = nullptr
|
|
363
|
+
// >
|
|
364
|
+
// // END working template header
|
|
365
|
+
// XLRowDataProxy& operator=(const T& values)
|
|
366
|
+
// {
|
|
367
|
+
// using namespace std::literals::string_literals;
|
|
368
|
+
// throw XLInternalError( "templated XLRowDataProxy& operator=(const T& values) instantiated for an XMLNode ("s+ typeid(T).name() +
|
|
369
|
+
// "), this function must be implemented then"s );
|
|
370
|
+
//
|
|
371
|
+
// }
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* @brief Implicit conversion to std::vector of XLCellValues.
|
|
375
|
+
* @return A std::vector of XLCellValues.
|
|
376
|
+
*/
|
|
377
|
+
operator std::vector<XLCellValue>() const; // NOLINT
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* @brief Implicit conversion to std::deque of XLCellValues.
|
|
381
|
+
* @return A std::deque of XLCellValues.
|
|
382
|
+
*/
|
|
383
|
+
operator std::deque<XLCellValue>() const; // NOLINT
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* @brief Implicit conversion to std::list of XLCellValues.
|
|
387
|
+
* @return A std::list of XLCellValues.
|
|
388
|
+
*/
|
|
389
|
+
operator std::list<XLCellValue>() const; // NOLINT
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* @brief Explicit conversion operator.
|
|
393
|
+
* @details This function calls the convertContainer template function to convert the row data to the container
|
|
394
|
+
* stipulated by the client. The reason that this function is marked explicit is that the implicit conversion operators
|
|
395
|
+
* above will be ambiguous.
|
|
396
|
+
* @tparam Container The container (and value) type to convert the row data to.
|
|
397
|
+
* @return The required container with the row data.
|
|
398
|
+
*/
|
|
399
|
+
template<typename Container,
|
|
400
|
+
typename =
|
|
401
|
+
std::enable_if_t<!std::is_same_v<Container, XLRowDataProxy> &&
|
|
402
|
+
std::is_base_of_v<std::bidirectional_iterator_tag,
|
|
403
|
+
typename std::iterator_traits<typename Container::iterator>::iterator_category>,
|
|
404
|
+
Container>>
|
|
405
|
+
explicit operator Container() const
|
|
406
|
+
{
|
|
407
|
+
return convertContainer<Container>();
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* @brief Clears all values for the current row.
|
|
412
|
+
*/
|
|
413
|
+
void clear();
|
|
414
|
+
|
|
415
|
+
private:
|
|
416
|
+
//---------- Private Member Functions ---------- //
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* @brief Get the cell values for the row.
|
|
420
|
+
* @return A std::vector of XLCellValues.
|
|
421
|
+
*/
|
|
422
|
+
std::vector<XLCellValue> getValues() const;
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* @brief Helper function for getting a reference to the shared strings repository.
|
|
426
|
+
* @return A reference to the XLSharedStrings object.
|
|
427
|
+
* @note needed for templated XLRowDataProxy& operator=
|
|
428
|
+
*/
|
|
429
|
+
const XLSharedStrings& getSharedStrings() const;
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* @brief Convenience function for erasing the first 'count' numbers of values in the row.
|
|
433
|
+
* @param count The number of values to erase.
|
|
434
|
+
*/
|
|
435
|
+
void deleteCellValues(uint16_t count);
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* @brief Convenience function for prepending a row value with a given column number.
|
|
439
|
+
* @param value The XLCellValue object.
|
|
440
|
+
* @param col The column of the value.
|
|
441
|
+
*/
|
|
442
|
+
void prependCellValue(const XLCellValue& value, uint16_t col);
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* @brief Convenience function for converting the row data to a user-supplied container.
|
|
446
|
+
* @details This function can convert row data to any user-supplied container that adheres to the design
|
|
447
|
+
* of STL containers and supports bidirectional iterators. This could be std::vector, std::deque, or
|
|
448
|
+
* std::list, but any container with the same interface should work.
|
|
449
|
+
* @tparam Container The container (and value) type to be returned.
|
|
450
|
+
* @return The row data in the required format.
|
|
451
|
+
* @throws bad_variant_access if Container::value type is not XLCellValue and does not match the type contained.
|
|
452
|
+
*/
|
|
453
|
+
template<typename Container,
|
|
454
|
+
typename =
|
|
455
|
+
std::enable_if_t<!std::is_same_v<Container, XLRowDataProxy> &&
|
|
456
|
+
std::is_base_of_v<std::bidirectional_iterator_tag,
|
|
457
|
+
typename std::iterator_traits<typename Container::iterator>::iterator_category>,
|
|
458
|
+
Container>>
|
|
459
|
+
Container convertContainer() const // 2024-04-30: whitespace support
|
|
460
|
+
{
|
|
461
|
+
Container c;
|
|
462
|
+
auto it = std::inserter(c, c.end());
|
|
463
|
+
for (const auto& v : getValues()) {
|
|
464
|
+
// ===== If the value_type of the container is XLCellValue, the value can be assigned directly.
|
|
465
|
+
if constexpr (std::is_same_v<typename Container::value_type, XLCellValue>) *it++ = v;
|
|
466
|
+
|
|
467
|
+
// ===== If the value_type is something else, the underlying value has to be extracted from the XLCellValue object.
|
|
468
|
+
// ===== Note that if the type contained in the XLCellValue object does not match the value_type, a bad_variant_access
|
|
469
|
+
// ===== exception will be thrown.
|
|
470
|
+
else
|
|
471
|
+
*it++ = v.get<typename Container::value_type>();
|
|
472
|
+
}
|
|
473
|
+
return c;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
//---------- Private Member Variables ---------- //
|
|
477
|
+
|
|
478
|
+
XLRow* m_row { nullptr }; /**< Pointer to the parent XLRow object. */
|
|
479
|
+
XMLNode* m_rowNode { nullptr }; /**< Pointer the the XML node representing the row. */
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
} // namespace OpenXLSX
|
|
483
|
+
|
|
484
|
+
#ifdef _MSC_VER // conditionally enable MSVC specific pragmas to avoid other compilers warning about unknown pragmas
|
|
485
|
+
# pragma warning(pop)
|
|
486
|
+
#endif // _MSC_VER
|
|
487
|
+
|
|
488
|
+
#endif // OPENXLSX_XLROWDATA_HPP
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|
|
3
|
+
____ ____ ___ ____ ____ ____ ___
|
|
4
|
+
6MMMMb `MM( )M' `MM' 6MMMMb\`MM( )M'
|
|
5
|
+
8P Y8 `MM. d' MM 6M' ` `MM. d'
|
|
6
|
+
6M Mb __ ____ ____ ___ __ `MM. d' MM MM `MM. d'
|
|
7
|
+
MM MM `M6MMMMb 6MMMMb `MM 6MMb `MM. d' MM YM. `MM. d'
|
|
8
|
+
MM MM MM' `Mb 6M' `Mb MMM9 `Mb `MMd MM YMMMMb `MMd
|
|
9
|
+
MM MM MM MM MM MM MM' MM dMM. MM `Mb dMM.
|
|
10
|
+
MM MM MM MM MMMMMMMM MM MM d'`MM. MM MM d'`MM.
|
|
11
|
+
YM M9 MM MM MM MM MM d' `MM. MM MM d' `MM.
|
|
12
|
+
8b d8 MM. ,M9 YM d9 MM MM d' `MM. MM / L ,M9 d' `MM.
|
|
13
|
+
YMMMM9 MMYMMM9 YMMMM9 _MM_ _MM_M(_ _)MM_ _MMMMMMM MYMMMM9 _M(_ _)MM_
|
|
14
|
+
MM
|
|
15
|
+
MM
|
|
16
|
+
_MM_
|
|
17
|
+
|
|
18
|
+
Copyright (c) 2018, Kenneth Troldal Balslev
|
|
19
|
+
|
|
20
|
+
All rights reserved.
|
|
21
|
+
|
|
22
|
+
Redistribution and use in source and binary forms, with or without
|
|
23
|
+
modification, are permitted provided that the following conditions are met:
|
|
24
|
+
- Redistributions of source code must retain the above copyright
|
|
25
|
+
notice, this list of conditions and the following disclaimer.
|
|
26
|
+
- Redistributions in binary form must reproduce the above copyright
|
|
27
|
+
notice, this list of conditions and the following disclaimer in the
|
|
28
|
+
documentation and/or other materials provided with the distribution.
|
|
29
|
+
- Neither the name of the author nor the
|
|
30
|
+
names of any contributors may be used to endorse or promote products
|
|
31
|
+
derived from this software without specific prior written permission.
|
|
32
|
+
|
|
33
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
34
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
35
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
36
|
+
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
|
37
|
+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
38
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
39
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
40
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
41
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
42
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
43
|
+
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
#ifndef OPENXLSX_XLSHAREDSTRINGS_HPP
|
|
47
|
+
#define OPENXLSX_XLSHAREDSTRINGS_HPP
|
|
48
|
+
|
|
49
|
+
#ifdef _MSC_VER // conditionally enable MSVC specific pragmas to avoid other compilers warning about unknown pragmas
|
|
50
|
+
# pragma warning(push)
|
|
51
|
+
# pragma warning(disable : 4251)
|
|
52
|
+
# pragma warning(disable : 4275)
|
|
53
|
+
#endif // _MSC_VER
|
|
54
|
+
|
|
55
|
+
#include <deque>
|
|
56
|
+
#include <functional> // std::reference_wrapper
|
|
57
|
+
#include <limits> // std::numeric_limits
|
|
58
|
+
#include <ostream> // std::basic_ostream
|
|
59
|
+
#include <string>
|
|
60
|
+
|
|
61
|
+
// ===== OpenXLSX Includes ===== //
|
|
62
|
+
#include "OpenXLSX-Exports.hpp"
|
|
63
|
+
#include "XLXmlFile.hpp"
|
|
64
|
+
|
|
65
|
+
namespace OpenXLSX
|
|
66
|
+
{
|
|
67
|
+
constexpr size_t XLMaxSharedStrings = (std::numeric_limits< int32_t >::max)(); // pull request #261: wrapped max in parentheses to prevent expansion of windows.h "max" macro
|
|
68
|
+
|
|
69
|
+
class XLSharedStrings; // forward declaration
|
|
70
|
+
typedef std::reference_wrapper< const XLSharedStrings > XLSharedStringsRef;
|
|
71
|
+
|
|
72
|
+
extern const XLSharedStrings XLSharedStringsDefaulted; // to be used for default initialization of all references of type XLSharedStrings
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @brief This class encapsulate the Excel concept of Shared Strings. In Excel, instead of havig individual strings
|
|
76
|
+
* in each cell, cells have a reference to an entry in the SharedStrings register. This results in smalle file
|
|
77
|
+
* sizes, as repeated strings are referenced easily.
|
|
78
|
+
*/
|
|
79
|
+
class OPENXLSX_EXPORT XLSharedStrings : public XLXmlFile
|
|
80
|
+
{
|
|
81
|
+
//---------- Friend Declarations ----------//
|
|
82
|
+
friend class XLDocument; // for access to protected function rewriteXmlFromCache
|
|
83
|
+
|
|
84
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
85
|
+
// Public Member Functions
|
|
86
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
87
|
+
|
|
88
|
+
public:
|
|
89
|
+
/**
|
|
90
|
+
* @brief Default constructor
|
|
91
|
+
*/
|
|
92
|
+
XLSharedStrings();
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @brief
|
|
96
|
+
* @param xmlData
|
|
97
|
+
* @param stringCache
|
|
98
|
+
*/
|
|
99
|
+
explicit XLSharedStrings(XLXmlData* xmlData, std::deque<std::string>* stringCache);
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @brief Copy constructor
|
|
103
|
+
* @param other
|
|
104
|
+
*/
|
|
105
|
+
XLSharedStrings(const XLSharedStrings& other);
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @brief Move constructor
|
|
109
|
+
* @param other
|
|
110
|
+
*/
|
|
111
|
+
XLSharedStrings(XLSharedStrings&& other) noexcept;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @brief Destructor
|
|
115
|
+
*/
|
|
116
|
+
~XLSharedStrings();
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* @brief Copy assignment operator
|
|
120
|
+
* @param other
|
|
121
|
+
* @return
|
|
122
|
+
*/
|
|
123
|
+
XLSharedStrings& operator=(const XLSharedStrings& other);
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @brief Move assignment operator
|
|
127
|
+
* @param other
|
|
128
|
+
* @return
|
|
129
|
+
*/
|
|
130
|
+
XLSharedStrings& operator=(XLSharedStrings&& other) noexcept;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @brief return the amount of shared string entries currently in the cache
|
|
134
|
+
* @return
|
|
135
|
+
*/
|
|
136
|
+
int32_t stringCount() const { return m_stringCache->size(); }
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @brief
|
|
140
|
+
* @param str
|
|
141
|
+
* @return
|
|
142
|
+
*/
|
|
143
|
+
int32_t getStringIndex(const std::string& str) const;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* @brief
|
|
147
|
+
* @param str
|
|
148
|
+
* @return
|
|
149
|
+
*/
|
|
150
|
+
bool stringExists(const std::string& str) const;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* @brief
|
|
154
|
+
* @param index
|
|
155
|
+
* @return
|
|
156
|
+
*/
|
|
157
|
+
const char* getString(int32_t index) const;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* @brief Append a new string to the list of shared strings.
|
|
161
|
+
* @param str The string to append.
|
|
162
|
+
* @return An int32_t with the index of the appended string
|
|
163
|
+
*/
|
|
164
|
+
int32_t appendString(const std::string& str) const;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @brief Clear the string at the given index.
|
|
168
|
+
* @param index The index to clear.
|
|
169
|
+
* @note There is no 'deleteString' member function, as deleting a shared string node will invalidate the
|
|
170
|
+
* shared string indices for the cells in the spreadsheet. Instead use this member functions, which clears
|
|
171
|
+
* the contents of the string, but keeps the XMLNode holding the string.
|
|
172
|
+
*/
|
|
173
|
+
void clearString(int32_t index) const;
|
|
174
|
+
|
|
175
|
+
// 2024-06-18 TBD if this is ever needed
|
|
176
|
+
// /**
|
|
177
|
+
// * @brief check m_stringCache is initialized
|
|
178
|
+
// * @return true if m_stringCache != nullptr, false otherwise
|
|
179
|
+
// * @note 2024-05-28 added function to enable other classes to check m_stringCache status
|
|
180
|
+
// */
|
|
181
|
+
// bool initialized() const { return m_stringCache != nullptr; }
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* @brief print the XML contents of the shared strings document using the underlying XMLNode print function
|
|
185
|
+
*/
|
|
186
|
+
void print(std::basic_ostream<char>& ostr) const;
|
|
187
|
+
|
|
188
|
+
protected:
|
|
189
|
+
/**
|
|
190
|
+
* @brief clear & rewrite the full shared strings XML from the shared strings cache
|
|
191
|
+
* @return the amount of strings written to XML (should be equal to m_stringCache->size())
|
|
192
|
+
*/
|
|
193
|
+
int32_t rewriteXmlFromCache();
|
|
194
|
+
|
|
195
|
+
private:
|
|
196
|
+
std::deque<std::string>* m_stringCache {}; /** < Each string must have an unchanging memory address; hence the use of std::deque */
|
|
197
|
+
};
|
|
198
|
+
} // namespace OpenXLSX
|
|
199
|
+
|
|
200
|
+
#ifdef _MSC_VER // conditionally enable MSVC specific pragmas to avoid other compilers warning about unknown pragmas
|
|
201
|
+
# pragma warning(pop)
|
|
202
|
+
#endif // _MSC_VER
|
|
203
|
+
|
|
204
|
+
#endif // OPENXLSX_XLSHAREDSTRINGS_HPP
|