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,117 @@
|
|
|
1
|
+
#include <OpenXLSX.hpp>
|
|
2
|
+
#include <deque>
|
|
3
|
+
#include <iostream>
|
|
4
|
+
#include <list>
|
|
5
|
+
#include <random>
|
|
6
|
+
|
|
7
|
+
using namespace std;
|
|
8
|
+
using namespace OpenXLSX;
|
|
9
|
+
|
|
10
|
+
int main()
|
|
11
|
+
{
|
|
12
|
+
cout << "********************************************************************************\n";
|
|
13
|
+
cout << "DEMO PROGRAM #08: Row Data - Implicit Conversion\n";
|
|
14
|
+
cout << "********************************************************************************\n";
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
// The previous example showed, among other things, how a std::vector of XLCellValue objects
|
|
18
|
+
// could be assigned to to an XLRow object, to populate the data to the cells in that row.
|
|
19
|
+
// In fact, this can be done with any container supporting bi-directional iterators, holding
|
|
20
|
+
// any data type that is convertible to a valid cell value. This is illustrated in this example.
|
|
21
|
+
|
|
22
|
+
// First, create a new document and access the sheet named 'Sheet1'.
|
|
23
|
+
cout << "\nGenerating spreadsheet ..." << endl;
|
|
24
|
+
XLDocument doc;
|
|
25
|
+
doc.create("./Demo08.xlsx", XLForceOverwrite);
|
|
26
|
+
auto wks = doc.workbook().worksheet("Sheet1");
|
|
27
|
+
|
|
28
|
+
// A std::vector holding values that are convertible to a cell value can be assigned to an XLRow
|
|
29
|
+
// object, using the 'values()' method. For example ints, doubles, bools and std::strings.
|
|
30
|
+
wks.row(1).values() = std::vector<int> { 1, 2, 3, 4, 5, 6, 7, 8 };
|
|
31
|
+
wks.row(2).values() = std::vector<double> { 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 };
|
|
32
|
+
wks.row(3).values() = std::vector<bool> { true, false, true, false, true, false, true, false };
|
|
33
|
+
wks.row(4).values() = std::vector<std::string> { "A", "B", "C", "D", "E", "F", "G", "H" };
|
|
34
|
+
|
|
35
|
+
// Save the sheet...
|
|
36
|
+
cout << "Saving spreadsheet ..." << endl;
|
|
37
|
+
doc.save();
|
|
38
|
+
doc.close();
|
|
39
|
+
|
|
40
|
+
// ...and reopen it (just to make sure that it is a valid .xlsx file)
|
|
41
|
+
cout << "Re-opening spreadsheet ..." << endl << endl;
|
|
42
|
+
doc.open("./Demo08.xlsx");
|
|
43
|
+
wks = doc.workbook().worksheet("Sheet1");
|
|
44
|
+
|
|
45
|
+
// The '.values()' method returns a proxy object that can be converted to any container supporting
|
|
46
|
+
// bi-directional iterators. The following three blocks shows how the row data can be converted to
|
|
47
|
+
// std::vector, std::deque, and std::list. In principle, this will also work with non-stl containers,
|
|
48
|
+
// e.g. containers in the Qt framework. This has not been tested, though.
|
|
49
|
+
|
|
50
|
+
// Conversion to std::vector<XLCellValue>
|
|
51
|
+
cout << "Conversion to std::vector<XLCellValue> ..." << endl;
|
|
52
|
+
for (auto& row : wks.rows()) {
|
|
53
|
+
for (auto& value : std::vector<XLCellValue>(row.values())) {
|
|
54
|
+
cout << value << " ";
|
|
55
|
+
}
|
|
56
|
+
cout << endl;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Conversion to std::deque<XLCellValue>
|
|
60
|
+
cout << endl << "Conversion to std::deque<XLCellValue> ..." << endl;
|
|
61
|
+
for (auto& row : wks.rows()) {
|
|
62
|
+
for (auto& value : std::deque<XLCellValue>(row.values())) {
|
|
63
|
+
cout << value << " ";
|
|
64
|
+
}
|
|
65
|
+
cout << endl;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Conversion to std::list<XLCellValue>
|
|
69
|
+
cout << endl << "Conversion to std::list<XLCellValue> ..." << endl;
|
|
70
|
+
for (auto& row : wks.rows()) {
|
|
71
|
+
for (auto& value : std::list<XLCellValue>(row.values())) {
|
|
72
|
+
cout << value << " ";
|
|
73
|
+
}
|
|
74
|
+
cout << endl;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// In addition to supporting any bi-directional container types, the cell values can also be converted to
|
|
78
|
+
// compatible plain data types instead of XLCellValue objects, e.g. ints, doubles, bools and std::string.
|
|
79
|
+
// This is illustrated in the following three blocks:
|
|
80
|
+
|
|
81
|
+
// Conversion to std::vector<[int, double, bool, std::string]>
|
|
82
|
+
cout << endl << "Conversion to std::vector<[int, double, bool, std::string]> ..." << endl;
|
|
83
|
+
for (auto& value : std::vector<int>(wks.row(1).values())) cout << value << " ";
|
|
84
|
+
cout << endl;
|
|
85
|
+
for (auto& value : std::vector<double>(wks.row(2).values())) cout << value << " ";
|
|
86
|
+
cout << endl;
|
|
87
|
+
for (bool value : std::vector<bool>(wks.row(3).values())) cout << value << " ";
|
|
88
|
+
cout << endl;
|
|
89
|
+
for (auto& value : std::vector<std::string>(wks.row(4).values())) cout << value << " ";
|
|
90
|
+
cout << endl;
|
|
91
|
+
|
|
92
|
+
// Conversion to std::deque<[int, double, bool, std::string]>
|
|
93
|
+
cout << endl << "Conversion to std::deque<[int, double, bool, std::string]> ..." << endl;
|
|
94
|
+
for (auto& value : std::deque<int>(wks.row(1).values())) cout << value << " ";
|
|
95
|
+
cout << endl;
|
|
96
|
+
for (auto& value : std::deque<double>(wks.row(2).values())) cout << value << " ";
|
|
97
|
+
cout << endl;
|
|
98
|
+
for (auto& value : std::deque<bool>(wks.row(3).values())) cout << value << " ";
|
|
99
|
+
cout << endl;
|
|
100
|
+
for (auto& value : std::deque<std::string>(wks.row(4).values())) cout << value << " ";
|
|
101
|
+
cout << endl;
|
|
102
|
+
|
|
103
|
+
// Conversion to std::list<[int, double, bool, std::string]>
|
|
104
|
+
cout << endl << "Conversion to std::list<[int, double, bool, std::string]> ..." << endl;
|
|
105
|
+
for (auto& value : std::list<int>(wks.row(1).values())) cout << value << " ";
|
|
106
|
+
cout << endl;
|
|
107
|
+
for (auto& value : std::list<double>(wks.row(2).values())) cout << value << " ";
|
|
108
|
+
cout << endl;
|
|
109
|
+
for (auto& value : std::list<bool>(wks.row(3).values())) cout << value << " ";
|
|
110
|
+
cout << endl;
|
|
111
|
+
for (auto& value : std::list<std::string>(wks.row(4).values())) cout << value << " ";
|
|
112
|
+
cout << endl;
|
|
113
|
+
|
|
114
|
+
doc.close();
|
|
115
|
+
|
|
116
|
+
return 0;
|
|
117
|
+
}
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
#include <cmath>
|
|
2
|
+
#include <iostream>
|
|
3
|
+
#include <string>
|
|
4
|
+
|
|
5
|
+
#include <OpenXLSX.hpp>
|
|
6
|
+
|
|
7
|
+
bool nowide_status()
|
|
8
|
+
{
|
|
9
|
+
#ifdef ENABLE_NOWIDE
|
|
10
|
+
return true;
|
|
11
|
+
#else
|
|
12
|
+
return false;
|
|
13
|
+
#endif
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
using namespace std;
|
|
17
|
+
using namespace OpenXLSX;
|
|
18
|
+
|
|
19
|
+
int main()
|
|
20
|
+
{
|
|
21
|
+
cout << "********************************************************************************\n";
|
|
22
|
+
cout << "DEMO PROGRAM #09: Cell assignment and access operations and some other features:\n";
|
|
23
|
+
cout << " * XLCellReference::columnAsString, ::columnAsNumber, XLCoordinates::coordinatesFromAddress\n";
|
|
24
|
+
cout << " * Worksheet name manipulations\n";
|
|
25
|
+
cout << " * Range iteration using XLCellIterator::endReached() and showcasing overloaded operator<< for iostream\n";
|
|
26
|
+
cout << " * XLCell and XLCellAssignable copy and move assignment operations\n";
|
|
27
|
+
cout << " * XLCell and XLCellAssignable operator overloads\n";
|
|
28
|
+
cout << " * Manipulate column width\n";
|
|
29
|
+
cout << " * Iterate over XLWorksheet::rows()\n";
|
|
30
|
+
cout << " * XLRow values assignment from/to vector, lists\n";
|
|
31
|
+
cout << " * XLCellValue::typeAsString and ::getString\n";
|
|
32
|
+
cout << " * Behavior of active worksheet when sheet setActive is used and when sheets are hidden\n";
|
|
33
|
+
cout << " * XLRowDataIterator operators == and != (lhs and rhs being tested on both sides)\n";
|
|
34
|
+
cout << "********************************************************************************\n";
|
|
35
|
+
std::cout << "nowide is " << ( nowide_status() ? "enabled" : "disabled" ) << std::endl;
|
|
36
|
+
|
|
37
|
+
// load example file
|
|
38
|
+
XLDocument doc;
|
|
39
|
+
doc.create("./Demo09.xlsx", XLForceOverwrite);
|
|
40
|
+
|
|
41
|
+
std::string version = "12.345";
|
|
42
|
+
doc.setProperty( XLProperty::AppVersion, version );
|
|
43
|
+
std::cout << "doc.property(XLProperty::AppVersion) is \"" << doc.property(XLProperty::AppVersion) << "\"" << std::endl;
|
|
44
|
+
|
|
45
|
+
cout << "\n=== Demonstrate XLCellReference::columnAsString, ::columnAsNumber, XLCoordinates::coordinatesFromAddress ===\n";
|
|
46
|
+
XLCellReference ref("A1");
|
|
47
|
+
std::cout << "column #761 translates to " << ref.columnAsString( 761 ) << std::endl;
|
|
48
|
+
std::cout << "column ACG translates to " << ref.columnAsNumber( "ACG" ) << std::endl;
|
|
49
|
+
|
|
50
|
+
uint32_t maxRows = OpenXLSX::MAX_ROWS;
|
|
51
|
+
std::string address = "XFD" + std::to_string( maxRows ); // last allowed column and row
|
|
52
|
+
XLCoordinates coords = XLCellReference::coordinatesFromAddress(address);
|
|
53
|
+
std::cout << "coords from " << address << " become row " << coords.first << " and col " << coords.second << std::endl;
|
|
54
|
+
|
|
55
|
+
// address = "XFE" + std::to_string( maxRows ); // last allowed column and row
|
|
56
|
+
// coords = XLCellReference::coordinatesFromAddress(address);
|
|
57
|
+
// std::cout << "coords from " << address << " become row " << coords.first << " and col " << coords.second << std::endl;
|
|
58
|
+
|
|
59
|
+
// address = "XFD" + std::to_string( maxRows + 1 ); // last allowed column and row
|
|
60
|
+
// coords = XLCellReference::coordinatesFromAddress(address);
|
|
61
|
+
// std::cout << "coords from " << address << " become row " << coords.first << " and col " << coords.second << std::endl;
|
|
62
|
+
|
|
63
|
+
// address = "12345"; // no column
|
|
64
|
+
// coords = XLCellReference::coordinatesFromAddress(address);
|
|
65
|
+
// std::cout << "coords from " << address << " become row " << coords.first << " and col " << coords.second << std::endl;
|
|
66
|
+
|
|
67
|
+
// address = "AB"; // no row
|
|
68
|
+
// coords = XLCellReference::coordinatesFromAddress(address);
|
|
69
|
+
// std::cout << "coords from " << address << " become row " << coords.first << " and col " << coords.second << std::endl;
|
|
70
|
+
|
|
71
|
+
address = "AA";
|
|
72
|
+
uint16_t col = XLCellReference::columnAsNumber(address);
|
|
73
|
+
std::cout << "columnAsNumber from " << address << " becomes col " << col << std::endl;
|
|
74
|
+
|
|
75
|
+
// address = "XFE";
|
|
76
|
+
// col = XLCellReference::columnAsNumber(address);
|
|
77
|
+
// std::cout << "columnAsNumber from " << address << " becomes col " << col << std::endl;
|
|
78
|
+
|
|
79
|
+
cout << "\n=== Worksheet name manipulations ===\n";
|
|
80
|
+
auto const & wsNames = doc.workbook().worksheetNames();
|
|
81
|
+
for( size_t idx = 0; idx < wsNames.size(); ++idx )
|
|
82
|
+
cout << "worksheet name is " << wsNames[ idx ] << ", index is " << idx << endl;
|
|
83
|
+
|
|
84
|
+
for (std::string name : doc.workbook().chartsheetNames()) // chart sheets are empty - just demonstrate how to access their names
|
|
85
|
+
cout << "chartsheet name is \"" << name << "\"" << endl;
|
|
86
|
+
|
|
87
|
+
auto wks = doc.workbook().worksheet( 1 );
|
|
88
|
+
wks.setName( "Worksheet name test");
|
|
89
|
+
std::cout << "worksheet name is " << wks.name() << std::endl;
|
|
90
|
+
|
|
91
|
+
// assign some data to row 1 from a vector of strings:
|
|
92
|
+
wks.row(1).values() = std::vector< std::string >{ "column A", "column B", "column C", "column D", "column E", "column F", "column G" };
|
|
93
|
+
|
|
94
|
+
cout << "\n=== Range iteration using XLCellIterator::endReached() and showcasing overloaded operator<< for iostream ===\n";
|
|
95
|
+
auto rng1 = wks.range(XLCellReference("A1"), XLCellReference("I2"));
|
|
96
|
+
XLCellIterator i1 = rng1.begin();
|
|
97
|
+
uint32_t count = 0;
|
|
98
|
+
XLCellIterator i2 = i1;
|
|
99
|
+
while( !i2.endReached() ) { ++i2; ++count; }
|
|
100
|
+
std::cout << "i2.endReached() is " << ( i2.endReached() ? "true" : "false" ) << std::endl;
|
|
101
|
+
|
|
102
|
+
i2 = i1;
|
|
103
|
+
for( uint32_t i = 0; i < count * 0.66; ++i, ++i2 );
|
|
104
|
+
std::cout << "distance between " << i1 << " and " << i2 << " is " << i1.distance(i2) << std::endl;
|
|
105
|
+
|
|
106
|
+
while( !i2.endReached() ) ++i2;
|
|
107
|
+
std::cout << "end iterator of rng1 is " << i2 << std::endl;
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
cout << "\n=== XLCell and XLCellAssignable copy and move assignment operations ===\n";
|
|
111
|
+
std::cout << "A1 value() is " << wks.cell("A1") << ", A1 formula() is " << wks.cell("A1").formula() << std::endl;
|
|
112
|
+
std::cout << "B1 value() is " << wks.cell("B1") << ", B1 formula() is " << wks.cell("B1").formula() << std::endl;
|
|
113
|
+
XLCell c = wks.cell("A1"); // XLCell move constructor
|
|
114
|
+
std::cout << "c is " << c << std::endl;
|
|
115
|
+
XLCell c2 = wks.cell("A1"); // XLCell move constructor
|
|
116
|
+
std::cout << "c2 is " << c2 << std::endl;
|
|
117
|
+
c2 = c; // XLCell copy assignment
|
|
118
|
+
std::cout << "c2 is " << c2 << std::endl;
|
|
119
|
+
try {
|
|
120
|
+
// manual invocation of XLCell.copyFrom (automatically used by XLCellAssignable copy assignment operator)
|
|
121
|
+
c2.copyFrom( c ); // copyFrom throws on a cell referencing the same XML cell node
|
|
122
|
+
std::cout << "c2 is " << c2 << std::endl;
|
|
123
|
+
}
|
|
124
|
+
catch( XLInputError const & e ) {
|
|
125
|
+
std::cout << "--ERROR: c2.copyFrom( c ) failed: " << e.what() << std::endl;
|
|
126
|
+
}
|
|
127
|
+
int iteration = 0;
|
|
128
|
+
try {
|
|
129
|
+
XLCell c3;
|
|
130
|
+
while( iteration < 2 ) {
|
|
131
|
+
++iteration;
|
|
132
|
+
c3.copyFrom( wks.cell("A1") ); // copyFrom throws on a cell referencing the same XML cell node
|
|
133
|
+
std::cout << "c3 is " << c3 << std::endl;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
catch( XLInputError const & e ) {
|
|
137
|
+
std::cout << "--ERROR: c3.copyFrom( c ) failed on iteration " << iteration << ": " << e.what() << std::endl;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// XLCellAssignable ca = wks.cell("A1"); // copy constructor
|
|
141
|
+
XLCellAssignable ca;
|
|
142
|
+
ca = c; // XLCellAssignable copy assignment -> refers to "A1"
|
|
143
|
+
std::cout << "ca is " << ca << std::endl;
|
|
144
|
+
|
|
145
|
+
ca = wks.cell("B1"); // XLCellAssignable move assignment -> assigns contents of "B1" to "A1"
|
|
146
|
+
std::cout << "ca is " << ca << std::endl;
|
|
147
|
+
XLCell x = ca; // XLCell copy assignment
|
|
148
|
+
std::cout << "x is " << x << std::endl;
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
cout << "\n=== XLCell and XLCellAssignable operator overloads ===\n";
|
|
152
|
+
wks.cell("A25" ).value() = "42"; // value assignment of any type
|
|
153
|
+
wks.cell("A25" ).formula() = "=4+3"; // formula assignment from string
|
|
154
|
+
std::cout << "A25 value() is " << wks.cell("A25") << ", A25 formula() is " << wks.cell("A25").formula() << std::endl;
|
|
155
|
+
wks.cell("C11") = wks.cell("A25"); // copy assignment of all cell contents (like copy & paste in Excel)
|
|
156
|
+
std::cout << "C11 value() is " << wks.cell("C11") << ", C11 formula() is " << wks.cell("C11").formula() << std::endl;
|
|
157
|
+
|
|
158
|
+
std::cout << "D12 before cell copy: D12 value() is " << wks.cell("D12") << ", D12 formula() is " << wks.cell("D12").formula() << std::endl;
|
|
159
|
+
wks.cell("D12") = wks.cell("A1");
|
|
160
|
+
std::cout << "D12 after copy from A1: D12 value() is " << wks.cell("D12") << ", D12 formula() is " << wks.cell("D12").formula() << std::endl;
|
|
161
|
+
wks.cell("D12") = wks.cell("C11");
|
|
162
|
+
std::cout << "D12 after copy from C11: D12 value() is " << wks.cell("D12") << ", D12 formula() is " << wks.cell("D12").formula() << std::endl;
|
|
163
|
+
|
|
164
|
+
// copy some cell contents around (value, attributes & formula):
|
|
165
|
+
wks.cell("D13") = wks.cell("C11");
|
|
166
|
+
wks.cell("D13") = wks.cell("A1");
|
|
167
|
+
XLCellValue D13 = wks.cell("D13").value();
|
|
168
|
+
std::cout << "D13 hasFormula() is " << ( wks.cell("D13").hasFormula() ? "true" : "false" ) << std::endl;
|
|
169
|
+
std::cout << "D13 value() is " << D13.getString() << ", D13 formula() is " << wks.cell("D13").formula() << std::endl;
|
|
170
|
+
|
|
171
|
+
cout << "\n=== Manipulate column width ===\n";
|
|
172
|
+
std::cout << "wks.column( 3 ).width() is " << wks.column( 3 ).width() << std::endl;
|
|
173
|
+
wks.column( 3 ).setWidth( 1 );
|
|
174
|
+
std::cout << "wks.column( 3 ).width() is " << wks.column( 3 ).width() << std::endl;
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
cout << "\n=== Iterate over XLWorksheet::rows() ===\n";
|
|
178
|
+
// auto rng = wks.range(XLCellReference("A1"), XLCellReference("C7"));
|
|
179
|
+
// auto it = rng.begin();
|
|
180
|
+
// while( it != rng.end() ) {
|
|
181
|
+
// uint32_t row = it->cellReference().row();
|
|
182
|
+
// uint16_t col = it->cellReference().column();
|
|
183
|
+
// std::cout << "cell row is " << row << ", column is " << col << std::endl;
|
|
184
|
+
// ++it; // trigger XCellIterator::operator++
|
|
185
|
+
// }
|
|
186
|
+
std::cout << "wks.rowCount is " << wks.rowCount() << std::endl;
|
|
187
|
+
std::cout << "wks.rows().rowCount is " << wks.rows().rowCount() << std::endl;
|
|
188
|
+
auto row = wks.rows().begin();
|
|
189
|
+
uint32_t limit = 55;
|
|
190
|
+
while( row != wks.rows().end() && row->rowNumber() < limit ) { // iterate over worksheet rows with a safeguard limit
|
|
191
|
+
std::cout << "row number is " << row->rowNumber() << std::endl;
|
|
192
|
+
++row;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
cout << "\n=== Assignment of row values from/to vector, lists ===\n";
|
|
196
|
+
// wks.row(2).values() = std::vector<int> { 1, 2, 3, 4, 5, 6, 7, 8 };
|
|
197
|
+
wks.row(2).values() = std::vector<bool> { true, true, false, false, true, false, true };
|
|
198
|
+
|
|
199
|
+
std::list< XLCellValue > l2;
|
|
200
|
+
for( int i = 0; i < 10; ++i ) {
|
|
201
|
+
l2.push_back( std::move( XLCellValue(i) ) );
|
|
202
|
+
}
|
|
203
|
+
wks.row(3).values() = l2; // assign a std::list of values to a worksheet row
|
|
204
|
+
// wks.row(3).values() = wks.row(2).cells();
|
|
205
|
+
|
|
206
|
+
std::vector< XLCellValue > vec1 = wks.row(1).values(); // get row values as a std::vector of XLCellValue
|
|
207
|
+
for( auto v : vec1 )
|
|
208
|
+
std::cout << "vec1 value is " << v.getString() << std::endl;
|
|
209
|
+
|
|
210
|
+
std::vector< XLCellValue > vec2;
|
|
211
|
+
vec2 = wks.row(4).values();
|
|
212
|
+
std::cout << "vec2.size() before assigning row(4).values() = vec1 is " << vec2.size() << std::endl;
|
|
213
|
+
for( auto v : vec2 )
|
|
214
|
+
std::cout << "vec2 value before assigning row(4).values() = vec1 is " << v.getString() << std::endl;
|
|
215
|
+
|
|
216
|
+
wks.row(4).values() = vec1; // assign a std::vector of XLCellValue to row values
|
|
217
|
+
|
|
218
|
+
vec2 = wks.row(4).values();
|
|
219
|
+
std::cout << "vec2.size() AFTER assigning row(4).values() = vec1 is " << vec2.size() << std::endl;
|
|
220
|
+
for( auto v : vec2 )
|
|
221
|
+
std::cout << "vec2 value AFTER assigning row(4).values() = vec1 is " << v.getString() << std::endl;
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
cout << "\n=== Testing for cell data types & getting a string for any type ===\n";
|
|
225
|
+
XLCellValue B3 = wks.cell("B3").value();
|
|
226
|
+
cout << "Cell B3 (" << B3.typeAsString() << "): " << B3.getString() << endl;
|
|
227
|
+
|
|
228
|
+
XLCellValue G2 = wks.cell("G2").value();
|
|
229
|
+
cout << "Cell G2 (" << G2.typeAsString() << "): " << G2.getString() << endl;
|
|
230
|
+
|
|
231
|
+
XLCellValue G1 = wks.cell("G1").value();
|
|
232
|
+
std::string vG1 = "";
|
|
233
|
+
try {
|
|
234
|
+
vG1 = G1.get< std::string >();
|
|
235
|
+
}
|
|
236
|
+
catch( ... ) {
|
|
237
|
+
std::cout << "failed to G1.get< std::string >(), attempting the new std::visit getString..." << std::endl;
|
|
238
|
+
vG1 = G1.getString();
|
|
239
|
+
}
|
|
240
|
+
std::string sG1 = G1.typeAsString();
|
|
241
|
+
|
|
242
|
+
cout << "Cell G1 (" << sG1 << "): " << vG1 << endl;
|
|
243
|
+
|
|
244
|
+
XLCellValue A1 = wks.cell("A1").value();
|
|
245
|
+
cout << "Cell A1 (" << A1.typeAsString() << "): " << A1.getString() << endl;
|
|
246
|
+
XLCellValue B1 = wks.cell("B1").value();
|
|
247
|
+
cout << "Cell B1 (" << B1.typeAsString() << "): " << B1.getString() << endl;
|
|
248
|
+
XLCellValue C1 = wks.cell("C1").value();
|
|
249
|
+
cout << "Cell C1 (" << C1.typeAsString() << "): " << C1.getString() << endl;
|
|
250
|
+
// if, due to linting (whitespaces), access to cell fails, an empty cell node gets added to the worksheet, returning the empty value
|
|
251
|
+
// --> the correct value is still there, but somehow has the wrong node reference
|
|
252
|
+
XLCellValue D1 = wks.cell("D1").value();
|
|
253
|
+
cout << "Cell D1 (" << D1.typeAsString() << "): " << D1.getString() << endl;
|
|
254
|
+
XLCellValue E1 = wks.cell("E1").value();
|
|
255
|
+
cout << "Cell E1 (" << E1.typeAsString() << "): " << E1.getString() << endl;
|
|
256
|
+
XLCellValue F1 = wks.cell("F1").value();
|
|
257
|
+
cout << "Cell F1 (" << F1.typeAsString() << "): " << F1.getString() << endl;
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
// std::list< XLCellValue > l1 = wks.row(1).values();
|
|
261
|
+
// for( auto v : l1 )
|
|
262
|
+
// std::cout << "l1 value is " << v.getString() << std::endl;
|
|
263
|
+
|
|
264
|
+
XLCellValue Z35 = wks.cell("Z35").value();
|
|
265
|
+
cout << "Cell Z35 (" << Z35.typeAsString() << "): " << Z35.getString() << endl;
|
|
266
|
+
A1 = wks.cell("A35").value();
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
cout << "\n=== Demonstrate behavior of active worksheet when sheet setActive is used and when sheets are hidden ===\n";
|
|
270
|
+
std::cout << "doc.workbook().sheetCount() is " << doc.workbook().sheetCount() << std::endl;
|
|
271
|
+
for( size_t i = 1; i <= doc.workbook().sheetCount(); ++i )
|
|
272
|
+
std::cout << "workbook.worksheet(" << i << ").name() is " << doc.workbook().worksheet(i).name() << std::endl;
|
|
273
|
+
|
|
274
|
+
std::string newSheetName;
|
|
275
|
+
newSheetName = "Sheet2"; if( !doc.workbook().sheetExists( newSheetName ) ) doc.workbook().addWorksheet( newSheetName );
|
|
276
|
+
auto wks2 = doc.workbook().worksheet( newSheetName );
|
|
277
|
+
newSheetName = "Sheet3"; if( !doc.workbook().sheetExists( newSheetName ) ) doc.workbook().addWorksheet( newSheetName );
|
|
278
|
+
auto wks3 = doc.workbook().worksheet( newSheetName );
|
|
279
|
+
|
|
280
|
+
std::cout << "wks.isActive() is " << ( wks.isActive() ? "true" : "false" ) << std::endl;
|
|
281
|
+
std::cout << "wks2.isActive() is " << ( wks2.isActive() ? "true" : "false" ) << std::endl;
|
|
282
|
+
std::cout << "wks3.isActive() is " << ( wks3.isActive() ? "true" : "false" ) << std::endl;
|
|
283
|
+
|
|
284
|
+
for( int sheetIndex = 1; sheetIndex <= 3; ++sheetIndex ) {
|
|
285
|
+
doc.workbook().sheet( sheetIndex ).setSelected(false);
|
|
286
|
+
doc.workbook().sheet( sheetIndex ).setVisibility(XLSheetState::Visible);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
wks.setActive();
|
|
290
|
+
wks2.setActive();
|
|
291
|
+
wks3.setActive();
|
|
292
|
+
std::cout << " wks.isActive() is " << ( wks.isActive() ? "true" : "false" ) << std::endl;
|
|
293
|
+
std::cout << " wks2.isActive() is " << ( wks2.isActive() ? "true" : "false" ) << std::endl;
|
|
294
|
+
std::cout << " wks3.isActive() is " << ( wks3.isActive() ? "true" : "false" ) << std::endl;
|
|
295
|
+
// XLSheetState::Visible, XLSheetState::Hidden, XLSheetState::VeryHidden
|
|
296
|
+
// wks.setVisibility( XLSheetState::Visible );
|
|
297
|
+
std::cout << "Setting wks2 to active..." << ( wks2.setActive() ? " succeeded." : "failed!" ) << std::endl;
|
|
298
|
+
std::cout << " wks.isActive() is " << ( wks.isActive() ? "true" : "false" ) << std::endl;
|
|
299
|
+
std::cout << " wks2.isActive() is " << ( wks2.isActive() ? "true" : "false" ) << std::endl;
|
|
300
|
+
std::cout << " wks3.isActive() is " << ( wks3.isActive() ? "true" : "false" ) << std::endl;
|
|
301
|
+
|
|
302
|
+
std::cout << "Hiding wks2" << std::endl;
|
|
303
|
+
wks2.setVisibility( XLSheetState::VeryHidden );
|
|
304
|
+
std::cout << " wks.isActive() is " << ( wks.isActive() ? "true" : "false" ) << std::endl;
|
|
305
|
+
std::cout << " wks2.isActive() is " << ( wks2.isActive() ? "true" : "false" ) << std::endl;
|
|
306
|
+
std::cout << " wks3.isActive() is " << ( wks3.isActive() ? "true" : "false" ) << std::endl;
|
|
307
|
+
|
|
308
|
+
std::cout << "Setting wks3 to active... " << ( wks3.setActive() ? "succeeded." : "failed!" ) << std::endl;
|
|
309
|
+
std::cout << " wks.isActive() is " << ( wks.isActive() ? "true" : "false" ) << std::endl;
|
|
310
|
+
std::cout << " wks2.isActive() is " << ( wks2.isActive() ? "true" : "false" ) << std::endl;
|
|
311
|
+
std::cout << " wks3.isActive() is " << ( wks3.isActive() ? "true" : "false" ) << std::endl;
|
|
312
|
+
|
|
313
|
+
std::cout << "Setting wks2 to active... " << ( wks2.setActive() ? "succeeded." : "failed!" ) << std::endl;
|
|
314
|
+
std::cout << " wks.isActive() is " << ( wks.isActive() ? "true" : "false" ) << std::endl;
|
|
315
|
+
std::cout << " wks2.isActive() is " << ( wks2.isActive() ? "true" : "false" ) << std::endl;
|
|
316
|
+
std::cout << " wks3.isActive() is " << ( wks3.isActive() ? "true" : "false" ) << std::endl;
|
|
317
|
+
|
|
318
|
+
doc.workbook().setSheetIndex( "Sheet3", 2 );
|
|
319
|
+
// How to get a sheet type from the shared sheet index (indexes both worksheets and chartsheets)
|
|
320
|
+
for( int sheetIndex = 1; sheetIndex <= 3; ++sheetIndex ) {
|
|
321
|
+
auto sheetType = doc.workbook().typeOfSheet( sheetIndex );
|
|
322
|
+
std::string sheetTypeString = "(unknown)";
|
|
323
|
+
if( sheetType == XLSheetType::Worksheet ) sheetTypeString = "Worksheet";
|
|
324
|
+
else if( sheetType == XLSheetType::Chartsheet ) sheetTypeString = "Chartsheet";
|
|
325
|
+
std::cout << "sheet( " << sheetIndex << " ) of type " + sheetTypeString + " has name " << doc.workbook().sheet( sheetIndex ).name()
|
|
326
|
+
<< " and is" << ( doc.workbook().sheet( sheetIndex ).isSelected() ? "" : " NOT" ) << " selected" << std::endl;
|
|
327
|
+
// doc.workbook().sheet( sheetIndex ).print( std::cout );
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// output status before saving workbook:
|
|
331
|
+
std::cout << "sheetNames is:" << std::endl;
|
|
332
|
+
for (std::string name : doc.workbook().sheetNames() )
|
|
333
|
+
std::cout << " " << name << std::endl;
|
|
334
|
+
|
|
335
|
+
std::cout << "worksheetNames is:" << std::endl;
|
|
336
|
+
for (std::string name : doc.workbook().worksheetNames() )
|
|
337
|
+
std::cout << " " << name << std::endl;
|
|
338
|
+
|
|
339
|
+
std::cout << "chartsheetNames is:" << std::endl;
|
|
340
|
+
for (std::string name : doc.workbook().chartsheetNames() )
|
|
341
|
+
std::cout << " " << name << std::endl;
|
|
342
|
+
|
|
343
|
+
cout << "\n=== Demonstrate operators == and != for XLRowDataIterator (lhs and rhs being tested on both sides) ===\n";
|
|
344
|
+
// uint32_t rowNo = 1'048'576; // this would result in wks.row( rowNo ).cells().begin() returning an end iterator
|
|
345
|
+
uint32_t rowNo = 1;
|
|
346
|
+
std::cout << "wks.row( " << rowNo << " ).cells().size() is " << wks.row( rowNo ).cells().size() << std::endl;
|
|
347
|
+
XLRowDataIterator r1 = wks.row( rowNo ).cells().begin();
|
|
348
|
+
XLRowDataIterator rEnd = wks.row( rowNo ).cells().end();
|
|
349
|
+
std::cout << "r1 == rEnd evaluates to " << ( r1 == rEnd ? "true" : "false" ) << std::endl;
|
|
350
|
+
std::cout << "rEnd == r1 evaluates to " << ( rEnd == r1 ? "true" : "false" ) << std::endl;
|
|
351
|
+
std::cout << "r1 == r1 evaluates to " << ( r1 == r1 ? "true" : "false" ) << std::endl;
|
|
352
|
+
std::cout << "rEnd == rEnd evaluates to " << ( rEnd == rEnd ? "true" : "false" ) << std::endl;
|
|
353
|
+
std::cout << std::endl;
|
|
354
|
+
std::cout << "r1 != rEnd evaluates to " << ( r1 != rEnd ? "true" : "false" ) << std::endl;
|
|
355
|
+
std::cout << "rEnd != r1 evaluates to " << ( rEnd != r1 ? "true" : "false" ) << std::endl;
|
|
356
|
+
std::cout << "r1 != r1 evaluates to " << ( r1 != r1 ? "true" : "false" ) << std::endl;
|
|
357
|
+
std::cout << "rEnd != rEnd evaluates to " << ( rEnd != rEnd ? "true" : "false" ) << std::endl;
|
|
358
|
+
|
|
359
|
+
doc.save(); // implies XLForceOverwrite
|
|
360
|
+
doc.close();
|
|
361
|
+
|
|
362
|
+
return 0;
|
|
363
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
find_package(ZLIB REQUIRED)
|
|
2
|
+
|
|
3
|
+
find_path(LIBZIP_INCLUDE_DIR NAMES zip.h)
|
|
4
|
+
mark_as_advanced(LIBZIP_INCLUDE_DIR)
|
|
5
|
+
|
|
6
|
+
find_library(LIBZIP_LIBRARY NAMES zip)
|
|
7
|
+
mark_as_advanced(LIBZIP_LIBRARY)
|
|
8
|
+
|
|
9
|
+
get_filename_component(_libzip_libdir ${LIBZIP_LIBRARY} DIRECTORY)
|
|
10
|
+
find_file(_libzip_pkgcfg libzip.pc
|
|
11
|
+
HINTS ${_libzip_libdir} ${LIBZIP_INCLUDE_DIR}/..
|
|
12
|
+
PATH_SUFFIXES pkgconfig lib/pkgconfig
|
|
13
|
+
NO_DEFAULT_PATH
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
include(FindPackageHandleStandardArgs)
|
|
17
|
+
find_package_handle_standard_args(
|
|
18
|
+
LIBZIP
|
|
19
|
+
REQUIRED_VARS
|
|
20
|
+
LIBZIP_LIBRARY
|
|
21
|
+
LIBZIP_INCLUDE_DIR
|
|
22
|
+
_libzip_pkgcfg
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
if (LIBZIP_FOUND)
|
|
26
|
+
if (NOT TARGET libzip::zip)
|
|
27
|
+
add_library(libzip::zip UNKNOWN IMPORTED)
|
|
28
|
+
set_target_properties(libzip::zip
|
|
29
|
+
PROPERTIES
|
|
30
|
+
INTERFACE_INCLUDE_DIRECTORIES ${LIBZIP_INCLUDE_DIR}
|
|
31
|
+
INTERFACE_LINK_LIBRARIES ZLIB::ZLIB
|
|
32
|
+
IMPORTED_LOCATION ${LIBZIP_LIBRARY}
|
|
33
|
+
)
|
|
34
|
+
# (Ab)use the (always) installed pkgconfig file to check if BZip2 is required
|
|
35
|
+
file(STRINGS ${_libzip_pkgcfg} _have_extra_libs REGEX Libs)
|
|
36
|
+
if(_have_extra_libs MATCHES "-lbz2")
|
|
37
|
+
find_package(BZip2 REQUIRED)
|
|
38
|
+
set_property(TARGET libzip::zip APPEND PROPERTY INTERFACE_LINK_LIBRARIES BZip2::BZip2)
|
|
39
|
+
endif()
|
|
40
|
+
if(_have_extra_libs MATCHES "-lcrypto")
|
|
41
|
+
find_package(OpenSSL REQUIRED)
|
|
42
|
+
set_property(TARGET libzip::zip APPEND PROPERTY INTERFACE_LINK_LIBRARIES OpenSSL::Crypto)
|
|
43
|
+
endif()
|
|
44
|
+
if(_have_extra_libs MATCHES "-lgnutls")
|
|
45
|
+
find_package(GnuTLS::GnuTLS REQUIRED)
|
|
46
|
+
set_property(TARGET libzip::zip APPEND PROPERTY INTERFACE_LINK_LIBRARIES GnuTLS::GnuTLS)
|
|
47
|
+
endif()
|
|
48
|
+
if(_have_extra_libs MATCHES "lgnutls")
|
|
49
|
+
find_package(Nettle::Nettle REQUIRED)
|
|
50
|
+
set_property(TARGET libzip::zip APPEND PROPERTY INTERFACE_LINK_LIBRARIES Nettle::Nettle)
|
|
51
|
+
endif()
|
|
52
|
+
if(_have_extra_libs MATCHES "-llzma")
|
|
53
|
+
find_package(LibLZMA REQUIRED)
|
|
54
|
+
set_property(TARGET libzip::zip APPEND PROPERTY INTERFACE_LINK_LIBRARIES LibLZMA::LibLZMA)
|
|
55
|
+
endif()
|
|
56
|
+
if(_have_extra_libs MATCHES "-lz")
|
|
57
|
+
find_package(ZLIB REQUIRED)
|
|
58
|
+
set_property(TARGET libzip::zip APPEND PROPERTY INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
|
|
59
|
+
endif()
|
|
60
|
+
endif()
|
|
61
|
+
endif()
|