libwz 0.1.0
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/LICENSE +21 -0
- package/README.md +165 -0
- package/binding.gyp +149 -0
- package/deps/tiny-aes/.github/workflows/c-cpp.yml +27 -0
- package/deps/tiny-aes/CMakeLists.txt +17 -0
- package/deps/tiny-aes/Makefile +61 -0
- package/deps/tiny-aes/README.md +83 -0
- package/deps/tiny-aes/aes.c +572 -0
- package/deps/tiny-aes/aes.h +91 -0
- package/deps/tiny-aes/aes.hpp +12 -0
- package/deps/tiny-aes/conanfile.py +73 -0
- package/deps/tiny-aes/library.json +19 -0
- package/deps/tiny-aes/library.properties +11 -0
- package/deps/tiny-aes/test.c +316 -0
- package/deps/tiny-aes/test.cpp +2 -0
- package/deps/tiny-aes/test_package/CMakeLists.txt +11 -0
- package/deps/tiny-aes/test_package/conanfile.py +17 -0
- package/deps/tiny-aes/unlicense.txt +24 -0
- package/deps/zlib/.cmake-format.yaml +245 -0
- package/deps/zlib/.github/workflows/c-std.yml +268 -0
- package/deps/zlib/.github/workflows/cmake.yml +147 -0
- package/deps/zlib/.github/workflows/configure.yml +146 -0
- package/deps/zlib/.github/workflows/contribs.yml +64 -0
- package/deps/zlib/.github/workflows/fuzz.yml +25 -0
- package/deps/zlib/.github/workflows/msys-cygwin.yml +92 -0
- package/deps/zlib/.github/workflows/others.yml +153 -0
- package/deps/zlib/BUILD.bazel +134 -0
- package/deps/zlib/CMakeLists.txt +310 -0
- package/deps/zlib/ChangeLog +1669 -0
- package/deps/zlib/FAQ +371 -0
- package/deps/zlib/INDEX +67 -0
- package/deps/zlib/LICENSE +22 -0
- package/deps/zlib/MODULE.bazel +9 -0
- package/deps/zlib/Makefile.in +426 -0
- package/deps/zlib/README +115 -0
- package/deps/zlib/README-cmake.md +79 -0
- package/deps/zlib/adler32.c +164 -0
- package/deps/zlib/amiga/Makefile.pup +69 -0
- package/deps/zlib/amiga/Makefile.sas +68 -0
- package/deps/zlib/compress.c +99 -0
- package/deps/zlib/configure +1078 -0
- package/deps/zlib/contrib/CMakeLists.txt +61 -0
- package/deps/zlib/contrib/README.contrib +57 -0
- package/deps/zlib/contrib/ada/CMakeLists.txt +217 -0
- package/deps/zlib/contrib/ada/buffer_demo.adb +106 -0
- package/deps/zlib/contrib/ada/cmake/Modules/CMakeADACompiler.cmake.in +23 -0
- package/deps/zlib/contrib/ada/cmake/Modules/CMakeADAInformation.cmake +133 -0
- package/deps/zlib/contrib/ada/cmake/Modules/CMakeDetermineADACompiler.cmake +33 -0
- package/deps/zlib/contrib/ada/cmake/Modules/CMakeTestADACompiler.cmake +46 -0
- package/deps/zlib/contrib/ada/cmake/binder_helper.cmake +47 -0
- package/deps/zlib/contrib/ada/cmake/compile_helper.cmake +32 -0
- package/deps/zlib/contrib/ada/cmake/exe_link_helper.cmake +53 -0
- package/deps/zlib/contrib/ada/cmake/shared_link_helper.cmake +52 -0
- package/deps/zlib/contrib/ada/cmake/static_link_helper.cmake +25 -0
- package/deps/zlib/contrib/ada/mtest.adb +156 -0
- package/deps/zlib/contrib/ada/read.adb +156 -0
- package/deps/zlib/contrib/ada/readme.txt +65 -0
- package/deps/zlib/contrib/ada/test.adb +463 -0
- package/deps/zlib/contrib/ada/zlib-streams.adb +225 -0
- package/deps/zlib/contrib/ada/zlib-streams.ads +114 -0
- package/deps/zlib/contrib/ada/zlib-thin.adb +142 -0
- package/deps/zlib/contrib/ada/zlib-thin.ads +450 -0
- package/deps/zlib/contrib/ada/zlib.adb +701 -0
- package/deps/zlib/contrib/ada/zlib.ads +328 -0
- package/deps/zlib/contrib/ada/zlib.gpr +20 -0
- package/deps/zlib/contrib/blast/CMakeLists.txt +166 -0
- package/deps/zlib/contrib/blast/Makefile +14 -0
- package/deps/zlib/contrib/blast/README +4 -0
- package/deps/zlib/contrib/blast/blast-test.c +42 -0
- package/deps/zlib/contrib/blast/blast.c +422 -0
- package/deps/zlib/contrib/blast/blast.h +84 -0
- package/deps/zlib/contrib/blast/blastConfig.cmake.in +18 -0
- package/deps/zlib/contrib/blast/test/CMakeLists.txt +193 -0
- package/deps/zlib/contrib/blast/test/add_subdirectory_exclude_test.cmake.in +27 -0
- package/deps/zlib/contrib/blast/test/add_subdirectory_test.cmake.in +25 -0
- package/deps/zlib/contrib/blast/test/find_package_no_components_test.cmake.in +24 -0
- package/deps/zlib/contrib/blast/test/find_package_test.cmake.in +24 -0
- package/deps/zlib/contrib/blast/test/find_package_wrong_components_test.cmake.in +24 -0
- package/deps/zlib/contrib/blast/test.pk +0 -0
- package/deps/zlib/contrib/blast/test.txt +1 -0
- package/deps/zlib/contrib/blast/tester.cmake +28 -0
- package/deps/zlib/contrib/crc32vx/CMakeLists.txt +67 -0
- package/deps/zlib/contrib/crc32vx/README +9 -0
- package/deps/zlib/contrib/crc32vx/crc32_vx.c +254 -0
- package/deps/zlib/contrib/crc32vx/crc32_vx_hooks.h +9 -0
- package/deps/zlib/contrib/delphi/ZLib.pas +557 -0
- package/deps/zlib/contrib/delphi/ZLibConst.pas +11 -0
- package/deps/zlib/contrib/delphi/readme.txt +76 -0
- package/deps/zlib/contrib/delphi/zlibd32.mak +99 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs +58 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs +202 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs +83 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/CodecBase.cs +198 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/Deflater.cs +106 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/DotZLib.cs +288 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/DotZLib.csproj +141 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/GZipStream.cs +301 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/Inflater.cs +105 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/UnitTests.cs +274 -0
- package/deps/zlib/contrib/dotzlib/DotZLib.build +33 -0
- package/deps/zlib/contrib/dotzlib/DotZLib.chm +0 -0
- package/deps/zlib/contrib/dotzlib/DotZLib.sln +21 -0
- package/deps/zlib/contrib/dotzlib/LICENSE_1_0.txt +23 -0
- package/deps/zlib/contrib/dotzlib/readme.txt +58 -0
- package/deps/zlib/contrib/gcc_gvmat64/CMakeLists.txt +19 -0
- package/deps/zlib/contrib/gcc_gvmat64/gvmat64.S +570 -0
- package/deps/zlib/contrib/infback9/CMakeLists.txt +19 -0
- package/deps/zlib/contrib/infback9/README +1 -0
- package/deps/zlib/contrib/infback9/infback9.c +603 -0
- package/deps/zlib/contrib/infback9/infback9.h +37 -0
- package/deps/zlib/contrib/infback9/inffix9.h +107 -0
- package/deps/zlib/contrib/infback9/inflate9.h +47 -0
- package/deps/zlib/contrib/infback9/inftree9.c +319 -0
- package/deps/zlib/contrib/infback9/inftree9.h +61 -0
- package/deps/zlib/contrib/iostream/test.cpp +24 -0
- package/deps/zlib/contrib/iostream/zfstream.cpp +329 -0
- package/deps/zlib/contrib/iostream/zfstream.h +128 -0
- package/deps/zlib/contrib/iostream2/zstream.h +306 -0
- package/deps/zlib/contrib/iostream2/zstream_test.cpp +25 -0
- package/deps/zlib/contrib/iostream3/CMakeLists.txt +200 -0
- package/deps/zlib/contrib/iostream3/README +35 -0
- package/deps/zlib/contrib/iostream3/TODO +17 -0
- package/deps/zlib/contrib/iostream3/iostream3Config.cmake.in +23 -0
- package/deps/zlib/contrib/iostream3/test/CMakeLists.txt +191 -0
- package/deps/zlib/contrib/iostream3/test/add_subdirectory_exclude_test.cmake.in +27 -0
- package/deps/zlib/contrib/iostream3/test/add_subdirectory_test.cmake.in +25 -0
- package/deps/zlib/contrib/iostream3/test/find_package_no_components_test.cmake.in +24 -0
- package/deps/zlib/contrib/iostream3/test/find_package_test.cmake.in +24 -0
- package/deps/zlib/contrib/iostream3/test/find_package_wrong_components_test.cmake.in +24 -0
- package/deps/zlib/contrib/iostream3/test.cc +50 -0
- package/deps/zlib/contrib/iostream3/zfstream.cc +479 -0
- package/deps/zlib/contrib/iostream3/zfstream.h +466 -0
- package/deps/zlib/contrib/minizip/CMakeLists.txt +387 -0
- package/deps/zlib/contrib/minizip/LICENSE.Info-Zip +58 -0
- package/deps/zlib/contrib/minizip/Makefile +33 -0
- package/deps/zlib/contrib/minizip/Makefile.am +45 -0
- package/deps/zlib/contrib/minizip/MiniZip64_Changes.txt +6 -0
- package/deps/zlib/contrib/minizip/MiniZip64_info.txt +69 -0
- package/deps/zlib/contrib/minizip/configure.ac +32 -0
- package/deps/zlib/contrib/minizip/crypt.h +125 -0
- package/deps/zlib/contrib/minizip/ints.h +57 -0
- package/deps/zlib/contrib/minizip/ioapi.c +231 -0
- package/deps/zlib/contrib/minizip/ioapi.h +183 -0
- package/deps/zlib/contrib/minizip/iowin32.c +447 -0
- package/deps/zlib/contrib/minizip/iowin32.h +27 -0
- package/deps/zlib/contrib/minizip/make_vms.com +25 -0
- package/deps/zlib/contrib/minizip/miniunz.c +647 -0
- package/deps/zlib/contrib/minizip/miniunzip.1 +63 -0
- package/deps/zlib/contrib/minizip/minizip.1 +46 -0
- package/deps/zlib/contrib/minizip/minizip.c +511 -0
- package/deps/zlib/contrib/minizip/minizip.pc.in +13 -0
- package/deps/zlib/contrib/minizip/minizip.pc.txt +13 -0
- package/deps/zlib/contrib/minizip/minizipConfig.cmake.in +27 -0
- package/deps/zlib/contrib/minizip/mztools.c +294 -0
- package/deps/zlib/contrib/minizip/mztools.h +37 -0
- package/deps/zlib/contrib/minizip/skipset.h +366 -0
- package/deps/zlib/contrib/minizip/test/CMakeLists.txt +176 -0
- package/deps/zlib/contrib/minizip/test/add_subdirectory_exclude_test.cmake.in +29 -0
- package/deps/zlib/contrib/minizip/test/add_subdirectory_test.cmake.in +28 -0
- package/deps/zlib/contrib/minizip/test/find_package_no_components_test.cmake.in +26 -0
- package/deps/zlib/contrib/minizip/test/find_package_test.cmake.in +26 -0
- package/deps/zlib/contrib/minizip/test/find_package_wrong_components_test.cmake.in +26 -0
- package/deps/zlib/contrib/minizip/test/test_helper.cm +32 -0
- package/deps/zlib/contrib/minizip/unzip.c +1984 -0
- package/deps/zlib/contrib/minizip/unzip.h +442 -0
- package/deps/zlib/contrib/minizip/zip.c +2246 -0
- package/deps/zlib/contrib/minizip/zip.h +371 -0
- package/deps/zlib/contrib/nuget/nuget.csproj +45 -0
- package/deps/zlib/contrib/nuget/nuget.sln +22 -0
- package/deps/zlib/contrib/pascal/example.pas +599 -0
- package/deps/zlib/contrib/pascal/readme.txt +76 -0
- package/deps/zlib/contrib/pascal/zlibd32.mak +99 -0
- package/deps/zlib/contrib/pascal/zlibpas.pas +276 -0
- package/deps/zlib/contrib/puff/CMakeLists.txt +154 -0
- package/deps/zlib/contrib/puff/Makefile +42 -0
- package/deps/zlib/contrib/puff/README +63 -0
- package/deps/zlib/contrib/puff/bin-writer.c +26 -0
- package/deps/zlib/contrib/puff/puff.c +840 -0
- package/deps/zlib/contrib/puff/puff.h +35 -0
- package/deps/zlib/contrib/puff/puffConfig.cmake.in +18 -0
- package/deps/zlib/contrib/puff/pufftest.c +168 -0
- package/deps/zlib/contrib/puff/test/CMakeLists.txt +262 -0
- package/deps/zlib/contrib/puff/test/add_subdirectory_exclude_test.cmake.in +26 -0
- package/deps/zlib/contrib/puff/test/add_subdirectory_test.cmake.in +25 -0
- package/deps/zlib/contrib/puff/test/find_package_no_components_test.cmake.in +24 -0
- package/deps/zlib/contrib/puff/test/find_package_test.cmake.in +24 -0
- package/deps/zlib/contrib/puff/test/find_package_wrong_components_test.cmake.in +24 -0
- package/deps/zlib/contrib/puff/test/tester-cov.cmake +58 -0
- package/deps/zlib/contrib/puff/test/tester.cmake +16 -0
- package/deps/zlib/contrib/puff/zeros.raw +0 -0
- package/deps/zlib/contrib/testzlib/CMakeLists.txt +44 -0
- package/deps/zlib/contrib/testzlib/testzlib.c +275 -0
- package/deps/zlib/contrib/testzlib/testzlib.txt +10 -0
- package/deps/zlib/contrib/vstudio/readme.txt +22 -0
- package/deps/zlib/contrib/zlib1-dll/CMakeLists.txt +196 -0
- package/deps/zlib/contrib/zlib1-dll/readme.txt +21 -0
- package/deps/zlib/crc32.c +983 -0
- package/deps/zlib/crc32.h +9446 -0
- package/deps/zlib/deflate.c +2185 -0
- package/deps/zlib/deflate.h +383 -0
- package/deps/zlib/doc/algorithm.txt +209 -0
- package/deps/zlib/doc/crc-doc.1.0.pdf +0 -0
- package/deps/zlib/doc/rfc1950.txt +619 -0
- package/deps/zlib/doc/rfc1951.txt +955 -0
- package/deps/zlib/doc/rfc1952.txt +675 -0
- package/deps/zlib/doc/txtvsbin.txt +107 -0
- package/deps/zlib/examples/README.examples +54 -0
- package/deps/zlib/examples/enough.c +597 -0
- package/deps/zlib/examples/fitblk.c +233 -0
- package/deps/zlib/examples/gun.c +702 -0
- package/deps/zlib/examples/gzappend.c +504 -0
- package/deps/zlib/examples/gzjoin.c +449 -0
- package/deps/zlib/examples/gzlog.c +1061 -0
- package/deps/zlib/examples/gzlog.h +91 -0
- package/deps/zlib/examples/gznorm.c +474 -0
- package/deps/zlib/examples/zlib_how.html +550 -0
- package/deps/zlib/examples/zpipe.c +206 -0
- package/deps/zlib/examples/zran.c +546 -0
- package/deps/zlib/examples/zran.h +53 -0
- package/deps/zlib/gzclose.c +23 -0
- package/deps/zlib/gzguts.h +216 -0
- package/deps/zlib/gzlib.c +609 -0
- package/deps/zlib/gzread.c +668 -0
- package/deps/zlib/gzwrite.c +700 -0
- package/deps/zlib/infback.c +581 -0
- package/deps/zlib/inffast.c +321 -0
- package/deps/zlib/inffast.h +11 -0
- package/deps/zlib/inffixed.h +94 -0
- package/deps/zlib/inflate.c +1413 -0
- package/deps/zlib/inflate.h +126 -0
- package/deps/zlib/inftrees.c +424 -0
- package/deps/zlib/inftrees.h +64 -0
- package/deps/zlib/make_vms.com +867 -0
- package/deps/zlib/msdos/Makefile.bor +115 -0
- package/deps/zlib/msdos/Makefile.dj2 +104 -0
- package/deps/zlib/msdos/Makefile.emx +69 -0
- package/deps/zlib/msdos/Makefile.msc +112 -0
- package/deps/zlib/msdos/Makefile.tc +100 -0
- package/deps/zlib/os400/README400 +48 -0
- package/deps/zlib/os400/bndsrc +144 -0
- package/deps/zlib/os400/make.sh +383 -0
- package/deps/zlib/os400/zlibfixed.rpgle +578 -0
- package/deps/zlib/os400/zlibfree.rpgle +634 -0
- package/deps/zlib/qnx/package.qpg +141 -0
- package/deps/zlib/test/CMakeLists.txt +318 -0
- package/deps/zlib/test/add_subdirectory_exclude_test.cmake.in +29 -0
- package/deps/zlib/test/add_subdirectory_test.cmake.in +28 -0
- package/deps/zlib/test/example.c +552 -0
- package/deps/zlib/test/find_package_no_components_test.cmake.in +27 -0
- package/deps/zlib/test/find_package_test.cmake.in +27 -0
- package/deps/zlib/test/find_package_wrong_components_test.cmake.in +27 -0
- package/deps/zlib/test/infcover.c +672 -0
- package/deps/zlib/test/minigzip.c +592 -0
- package/deps/zlib/treebuild.xml +116 -0
- package/deps/zlib/trees.c +1119 -0
- package/deps/zlib/trees.h +128 -0
- package/deps/zlib/uncompr.c +101 -0
- package/deps/zlib/watcom/watcom_f.mak +43 -0
- package/deps/zlib/watcom/watcom_l.mak +43 -0
- package/deps/zlib/win32/DLL_FAQ.txt +381 -0
- package/deps/zlib/win32/Makefile.bor +109 -0
- package/deps/zlib/win32/Makefile.gcc +177 -0
- package/deps/zlib/win32/Makefile.msc +159 -0
- package/deps/zlib/win32/README-WIN32.txt +103 -0
- package/deps/zlib/win32/VisualC.txt +3 -0
- package/deps/zlib/win32/zlib.def +104 -0
- package/deps/zlib/win32/zlib1.rc +37 -0
- package/deps/zlib/zconf.h.in +551 -0
- package/deps/zlib/zlib.3 +149 -0
- package/deps/zlib/zlib.3.pdf +0 -0
- package/deps/zlib/zlib.h +2057 -0
- package/deps/zlib/zlib.map +116 -0
- package/deps/zlib/zlib.pc.cmakein +14 -0
- package/deps/zlib/zlib.pc.in +14 -0
- package/deps/zlib/zlibConfig.cmake.in +18 -0
- package/deps/zlib/zutil.c +313 -0
- package/deps/zlib/zutil.h +331 -0
- package/dist/index.d.ts +266 -0
- package/dist/index.js +1146 -0
- package/dist/libwz.js +5632 -0
- package/dist/libwz.wasm +0 -0
- package/include/wz/CRC32.h +182 -0
- package/include/wz/PngUtility.h +72 -0
- package/include/wz/PortalType.h +124 -0
- package/include/wz/Properties/WzBinaryProperty.h +70 -0
- package/include/wz/Properties/WzCanvasProperty.h +55 -0
- package/include/wz/Properties/WzConvexProperty.h +34 -0
- package/include/wz/Properties/WzDoubleProperty.h +32 -0
- package/include/wz/Properties/WzFloatProperty.h +30 -0
- package/include/wz/Properties/WzIntProperty.h +30 -0
- package/include/wz/Properties/WzLongProperty.h +30 -0
- package/include/wz/Properties/WzLuaProperty.h +31 -0
- package/include/wz/Properties/WzNullProperty.h +15 -0
- package/include/wz/Properties/WzPngProperty.h +53 -0
- package/include/wz/Properties/WzRawDataProperty.h +46 -0
- package/include/wz/Properties/WzShortProperty.h +31 -0
- package/include/wz/Properties/WzStringProperty.h +32 -0
- package/include/wz/Properties/WzSubProperty.h +35 -0
- package/include/wz/Properties/WzUOLProperty.h +44 -0
- package/include/wz/Properties/WzVectorProperty.h +40 -0
- package/include/wz/Properties/WzVideoProperty.h +43 -0
- package/include/wz/Result.h +58 -0
- package/include/wz/Util/Defines.h +16 -0
- package/include/wz/Util/ListFileParser.h +20 -0
- package/include/wz/Util/WzBinaryReader.h +95 -0
- package/include/wz/Util/WzBinaryWriter.h +72 -0
- package/include/wz/Util/WzBlobDataSource.h +30 -0
- package/include/wz/Util/WzDataSource.h +49 -0
- package/include/wz/Util/WzKeyGenerator.h +28 -0
- package/include/wz/Util/WzMutableKey.h +39 -0
- package/include/wz/Util/WzPath.h +37 -0
- package/include/wz/Util/WzStream.h +86 -0
- package/include/wz/Util/WzTool.h +42 -0
- package/include/wz/WzAESConstant.h +17 -0
- package/include/wz/WzDirectory.h +97 -0
- package/include/wz/WzEnums.h +76 -0
- package/include/wz/WzFile.h +99 -0
- package/include/wz/WzHeader.h +47 -0
- package/include/wz/WzImage.h +97 -0
- package/include/wz/WzImageProperty.h +92 -0
- package/include/wz/WzObject.h +55 -0
- package/include/wz/WzPropertyCollection.h +115 -0
- package/include/wz/wz.h +41 -0
- package/include/wz/wz_api.h +432 -0
- package/package.json +93 -0
- package/src/PngUtility.cpp +328 -0
- package/src/Properties/WzBinaryProperty.cpp +183 -0
- package/src/Properties/WzCanvasProperty.cpp +262 -0
- package/src/Properties/WzConvexProperty.cpp +159 -0
- package/src/Properties/WzDoubleProperty.cpp +12 -0
- package/src/Properties/WzFloatProperty.cpp +17 -0
- package/src/Properties/WzIntProperty.cpp +12 -0
- package/src/Properties/WzLongProperty.cpp +12 -0
- package/src/Properties/WzLuaProperty.cpp +37 -0
- package/src/Properties/WzNullProperty.cpp +11 -0
- package/src/Properties/WzPngProperty.cpp +637 -0
- package/src/Properties/WzRawDataProperty.cpp +116 -0
- package/src/Properties/WzShortProperty.cpp +12 -0
- package/src/Properties/WzStringProperty.cpp +44 -0
- package/src/Properties/WzSubProperty.cpp +129 -0
- package/src/Properties/WzUOLProperty.cpp +136 -0
- package/src/Properties/WzVectorProperty.cpp +22 -0
- package/src/Properties/WzVideoProperty.cpp +115 -0
- package/src/Util/ListFileParser.cpp +48 -0
- package/src/Util/WzBinaryReader.cpp +368 -0
- package/src/Util/WzBinaryWriter.cpp +305 -0
- package/src/Util/WzBlobDataSource.cpp +47 -0
- package/src/Util/WzDataSource.cpp +61 -0
- package/src/Util/WzKeyGenerator.cpp +43 -0
- package/src/Util/WzMutableKey.cpp +59 -0
- package/src/Util/WzStream.cpp +196 -0
- package/src/Util/WzTool.cpp +266 -0
- package/src/WzAESConstant.cpp +12 -0
- package/src/WzDirectory.cpp +669 -0
- package/src/WzEnums.cpp +20 -0
- package/src/WzFile.cpp +450 -0
- package/src/WzImage.cpp +350 -0
- package/src/WzImageProperty.cpp +469 -0
- package/src/WzObject.cpp +174 -0
- package/src/WzPropertyCollection.cpp +84 -0
- package/src/capi/wz_api.cpp +1996 -0
- package/src/node/binding.cpp +1776 -0
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) 1997
|
|
4
|
+
* Christian Michelsen Research AS
|
|
5
|
+
* Advanced Computing
|
|
6
|
+
* Fantoftvegen 38, 5036 BERGEN, Norway
|
|
7
|
+
*
|
|
8
|
+
* Permission to use, copy, modify, distribute and sell this software
|
|
9
|
+
* and its documentation for any purpose is hereby granted without fee,
|
|
10
|
+
* provided that the above copyright notice appear in all copies and
|
|
11
|
+
* that both that copyright notice and this permission notice appear
|
|
12
|
+
* in supporting documentation. Christian Michelsen Research AS makes no
|
|
13
|
+
* representations about the suitability of this software for any
|
|
14
|
+
* purpose. It is provided "as is" without express or implied warranty.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
#ifndef ZSTREAM__H
|
|
19
|
+
#define ZSTREAM__H
|
|
20
|
+
|
|
21
|
+
/*
|
|
22
|
+
* zstream.h - C++ interface to the 'zlib' general purpose compression library
|
|
23
|
+
* $Id: zstream.h 1.1 1997-06-25 12:00:56+02 tyge Exp tyge $
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
#include <strstream.h>
|
|
27
|
+
#include <string.h>
|
|
28
|
+
#include <stdio.h>
|
|
29
|
+
#include "zlib.h"
|
|
30
|
+
|
|
31
|
+
#if defined(_WIN32)
|
|
32
|
+
# include <fcntl.h>
|
|
33
|
+
# include <io.h>
|
|
34
|
+
# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
|
|
35
|
+
#else
|
|
36
|
+
# define SET_BINARY_MODE(file)
|
|
37
|
+
#endif
|
|
38
|
+
|
|
39
|
+
class zstringlen {
|
|
40
|
+
public:
|
|
41
|
+
zstringlen(class izstream&);
|
|
42
|
+
zstringlen(class ozstream&, const char*);
|
|
43
|
+
size_t value() const { return val.word; }
|
|
44
|
+
private:
|
|
45
|
+
struct Val { unsigned char byte; size_t word; } val;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// ----------------------------- izstream -----------------------------
|
|
49
|
+
|
|
50
|
+
class izstream
|
|
51
|
+
{
|
|
52
|
+
public:
|
|
53
|
+
izstream() : m_fp(0) {}
|
|
54
|
+
izstream(FILE* fp) : m_fp(0) { open(fp); }
|
|
55
|
+
izstream(const char* name) : m_fp(0) { open(name); }
|
|
56
|
+
~izstream() { close(); }
|
|
57
|
+
|
|
58
|
+
/* Opens a gzip (.gz) file for reading.
|
|
59
|
+
* open() can be used to read a file which is not in gzip format;
|
|
60
|
+
* in this case read() will directly read from the file without
|
|
61
|
+
* decompression. errno can be checked to distinguish two error
|
|
62
|
+
* cases (if errno is zero, the zlib error is Z_MEM_ERROR).
|
|
63
|
+
*/
|
|
64
|
+
void open(const char* name) {
|
|
65
|
+
if (m_fp) close();
|
|
66
|
+
m_fp = ::gzopen(name, "rb");
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
void open(FILE* fp) {
|
|
70
|
+
SET_BINARY_MODE(fp);
|
|
71
|
+
if (m_fp) close();
|
|
72
|
+
m_fp = ::gzdopen(fileno(fp), "rb");
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Flushes all pending input if necessary, closes the compressed file
|
|
76
|
+
* and deallocates all the (de)compression state. The return value is
|
|
77
|
+
* the zlib error number (see function error() below).
|
|
78
|
+
*/
|
|
79
|
+
int close() {
|
|
80
|
+
int r = ::gzclose(m_fp);
|
|
81
|
+
m_fp = 0; return r;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Binary read the given number of bytes from the compressed file.
|
|
85
|
+
*/
|
|
86
|
+
int read(void* buf, size_t len) {
|
|
87
|
+
return ::gzread(m_fp, buf, len);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Returns the error message for the last error which occurred on the
|
|
91
|
+
* given compressed file. errnum is set to zlib error number. If an
|
|
92
|
+
* error occurred in the file system and not in the compression library,
|
|
93
|
+
* errnum is set to Z_ERRNO and the application may consult errno
|
|
94
|
+
* to get the exact error code.
|
|
95
|
+
*/
|
|
96
|
+
const char* error(int* errnum) {
|
|
97
|
+
return ::gzerror(m_fp, errnum);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
gzFile fp() { return m_fp; }
|
|
101
|
+
|
|
102
|
+
private:
|
|
103
|
+
gzFile m_fp;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/*
|
|
107
|
+
* Binary read the given (array of) object(s) from the compressed file.
|
|
108
|
+
* If the input file was not in gzip format, read() copies the objects number
|
|
109
|
+
* of bytes into the buffer.
|
|
110
|
+
* returns the number of uncompressed bytes actually read
|
|
111
|
+
* (0 for end of file, -1 for error).
|
|
112
|
+
*/
|
|
113
|
+
template <class T, class Items>
|
|
114
|
+
inline int read(izstream& zs, T* x, Items items) {
|
|
115
|
+
return ::gzread(zs.fp(), x, items*sizeof(T));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/*
|
|
119
|
+
* Binary input with the '>' operator.
|
|
120
|
+
*/
|
|
121
|
+
template <class T>
|
|
122
|
+
inline izstream& operator>(izstream& zs, T& x) {
|
|
123
|
+
::gzread(zs.fp(), &x, sizeof(T));
|
|
124
|
+
return zs;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
inline zstringlen::zstringlen(izstream& zs) {
|
|
129
|
+
zs > val.byte;
|
|
130
|
+
if (val.byte == 255) zs > val.word;
|
|
131
|
+
else val.word = val.byte;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/*
|
|
135
|
+
* Read length of string + the string with the '>' operator.
|
|
136
|
+
*/
|
|
137
|
+
inline izstream& operator>(izstream& zs, char* x) {
|
|
138
|
+
zstringlen len(zs);
|
|
139
|
+
::gzread(zs.fp(), x, len.value());
|
|
140
|
+
x[len.value()] = '\0';
|
|
141
|
+
return zs;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
inline char* read_string(izstream& zs) {
|
|
145
|
+
zstringlen len(zs);
|
|
146
|
+
char* x = new char[len.value()+1];
|
|
147
|
+
::gzread(zs.fp(), x, len.value());
|
|
148
|
+
x[len.value()] = '\0';
|
|
149
|
+
return x;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// ----------------------------- ozstream -----------------------------
|
|
153
|
+
|
|
154
|
+
class ozstream
|
|
155
|
+
{
|
|
156
|
+
public:
|
|
157
|
+
ozstream() : m_fp(0), m_os(0) {
|
|
158
|
+
}
|
|
159
|
+
ozstream(FILE* fp, int level = Z_DEFAULT_COMPRESSION)
|
|
160
|
+
: m_fp(0), m_os(0) {
|
|
161
|
+
open(fp, level);
|
|
162
|
+
}
|
|
163
|
+
ozstream(const char* name, int level = Z_DEFAULT_COMPRESSION)
|
|
164
|
+
: m_fp(0), m_os(0) {
|
|
165
|
+
open(name, level);
|
|
166
|
+
}
|
|
167
|
+
~ozstream() {
|
|
168
|
+
close();
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* Opens a gzip (.gz) file for writing.
|
|
172
|
+
* The compression level parameter should be in 0..9
|
|
173
|
+
* errno can be checked to distinguish two error cases
|
|
174
|
+
* (if errno is zero, the zlib error is Z_MEM_ERROR).
|
|
175
|
+
*/
|
|
176
|
+
void open(const char* name, int level = Z_DEFAULT_COMPRESSION) {
|
|
177
|
+
char mode[4] = "wb\0";
|
|
178
|
+
if (level != Z_DEFAULT_COMPRESSION) mode[2] = '0'+level;
|
|
179
|
+
if (m_fp) close();
|
|
180
|
+
m_fp = ::gzopen(name, mode);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* open from a FILE pointer.
|
|
184
|
+
*/
|
|
185
|
+
void open(FILE* fp, int level = Z_DEFAULT_COMPRESSION) {
|
|
186
|
+
SET_BINARY_MODE(fp);
|
|
187
|
+
char mode[4] = "wb\0";
|
|
188
|
+
if (level != Z_DEFAULT_COMPRESSION) mode[2] = '0'+level;
|
|
189
|
+
if (m_fp) close();
|
|
190
|
+
m_fp = ::gzdopen(fileno(fp), mode);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* Flushes all pending output if necessary, closes the compressed file
|
|
194
|
+
* and deallocates all the (de)compression state. The return value is
|
|
195
|
+
* the zlib error number (see function error() below).
|
|
196
|
+
*/
|
|
197
|
+
int close() {
|
|
198
|
+
if (m_os) {
|
|
199
|
+
::gzwrite(m_fp, m_os->str(), m_os->pcount());
|
|
200
|
+
delete[] m_os->str(); delete m_os; m_os = 0;
|
|
201
|
+
}
|
|
202
|
+
int r = ::gzclose(m_fp); m_fp = 0; return r;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* Binary write the given number of bytes into the compressed file.
|
|
206
|
+
*/
|
|
207
|
+
int write(const void* buf, size_t len) {
|
|
208
|
+
return ::gzwrite(m_fp, (voidp) buf, len);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/* Flushes all pending output into the compressed file. The parameter
|
|
212
|
+
* _flush is as in the deflate() function. The return value is the zlib
|
|
213
|
+
* error number (see function gzerror below). flush() returns Z_OK if
|
|
214
|
+
* the flush_ parameter is Z_FINISH and all output could be flushed.
|
|
215
|
+
* flush() should be called only when strictly necessary because it can
|
|
216
|
+
* degrade compression.
|
|
217
|
+
*/
|
|
218
|
+
int flush(int _flush) {
|
|
219
|
+
os_flush();
|
|
220
|
+
return ::gzflush(m_fp, _flush);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* Returns the error message for the last error which occurred on the
|
|
224
|
+
* given compressed file. errnum is set to zlib error number. If an
|
|
225
|
+
* error occurred in the file system and not in the compression library,
|
|
226
|
+
* errnum is set to Z_ERRNO and the application may consult errno
|
|
227
|
+
* to get the exact error code.
|
|
228
|
+
*/
|
|
229
|
+
const char* error(int* errnum) {
|
|
230
|
+
return ::gzerror(m_fp, errnum);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
gzFile fp() { return m_fp; }
|
|
234
|
+
|
|
235
|
+
ostream& os() {
|
|
236
|
+
if (m_os == 0) m_os = new ostrstream;
|
|
237
|
+
return *m_os;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
void os_flush() {
|
|
241
|
+
if (m_os && m_os->pcount()>0) {
|
|
242
|
+
ostrstream* oss = new ostrstream;
|
|
243
|
+
oss->fill(m_os->fill());
|
|
244
|
+
oss->flags(m_os->flags());
|
|
245
|
+
oss->precision(m_os->precision());
|
|
246
|
+
oss->width(m_os->width());
|
|
247
|
+
::gzwrite(m_fp, m_os->str(), m_os->pcount());
|
|
248
|
+
delete[] m_os->str(); delete m_os; m_os = oss;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
private:
|
|
253
|
+
gzFile m_fp;
|
|
254
|
+
ostrstream* m_os;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
/*
|
|
258
|
+
* Binary write the given (array of) object(s) into the compressed file.
|
|
259
|
+
* returns the number of uncompressed bytes actually written
|
|
260
|
+
* (0 in case of error).
|
|
261
|
+
*/
|
|
262
|
+
template <class T, class Items>
|
|
263
|
+
inline int write(ozstream& zs, const T* x, Items items) {
|
|
264
|
+
return ::gzwrite(zs.fp(), (voidp) x, items*sizeof(T));
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/*
|
|
268
|
+
* Binary output with the '<' operator.
|
|
269
|
+
*/
|
|
270
|
+
template <class T>
|
|
271
|
+
inline ozstream& operator<(ozstream& zs, const T& x) {
|
|
272
|
+
::gzwrite(zs.fp(), (voidp) &x, sizeof(T));
|
|
273
|
+
return zs;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
inline zstringlen::zstringlen(ozstream& zs, const char* x) {
|
|
277
|
+
val.byte = 255; val.word = ::strlen(x);
|
|
278
|
+
if (val.word < 255) zs < (val.byte = val.word);
|
|
279
|
+
else zs < val;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/*
|
|
283
|
+
* Write length of string + the string with the '<' operator.
|
|
284
|
+
*/
|
|
285
|
+
inline ozstream& operator<(ozstream& zs, const char* x) {
|
|
286
|
+
zstringlen len(zs, x);
|
|
287
|
+
::gzwrite(zs.fp(), (voidp) x, len.value());
|
|
288
|
+
return zs;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
#ifdef _MSC_VER
|
|
292
|
+
inline ozstream& operator<(ozstream& zs, char* const& x) {
|
|
293
|
+
return zs < (const char*) x;
|
|
294
|
+
}
|
|
295
|
+
#endif
|
|
296
|
+
|
|
297
|
+
/*
|
|
298
|
+
* Ascii write with the << operator;
|
|
299
|
+
*/
|
|
300
|
+
template <class T>
|
|
301
|
+
inline ostream& operator<<(ozstream& zs, const T& x) {
|
|
302
|
+
zs.os_flush();
|
|
303
|
+
return zs.os() << x;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
#endif
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#include "zstream.h"
|
|
2
|
+
#include <math.h>
|
|
3
|
+
#include <stdlib.h>
|
|
4
|
+
#include <iomanip.h>
|
|
5
|
+
|
|
6
|
+
void main() {
|
|
7
|
+
char h[256] = "Hello";
|
|
8
|
+
char* g = "Goodbye";
|
|
9
|
+
ozstream out("temp.gz");
|
|
10
|
+
out < "This works well" < h < g;
|
|
11
|
+
out.close();
|
|
12
|
+
|
|
13
|
+
izstream in("temp.gz"); // read it back
|
|
14
|
+
char *x = read_string(in), *y = new char[256], z[256];
|
|
15
|
+
in > y > z;
|
|
16
|
+
in.close();
|
|
17
|
+
cout << x << endl << y << endl << z << endl;
|
|
18
|
+
|
|
19
|
+
out.open("temp.gz"); // try ascii output; zcat temp.gz to see the results
|
|
20
|
+
out << setw(50) << setfill('#') << setprecision(20) << x << endl << y << endl << z << endl;
|
|
21
|
+
out << z << endl << y << endl << x << endl;
|
|
22
|
+
out << 1.1234567890123456789 << endl;
|
|
23
|
+
|
|
24
|
+
delete[] x; delete[] y;
|
|
25
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.12...3.31)
|
|
2
|
+
|
|
3
|
+
project(
|
|
4
|
+
iostreamV3
|
|
5
|
+
VERSION 1.0.0
|
|
6
|
+
LANGUAGES CXX
|
|
7
|
+
DESCRIPTION "A library for using C++ IOStreams with zlib V3"
|
|
8
|
+
HOMEPAGE_URL "https://www.zlib.net")
|
|
9
|
+
|
|
10
|
+
option(ZLIB_IOSTREAM3_BUILD_SHARED "Enable building blast shared library" ON)
|
|
11
|
+
option(ZLIB_IOSTREAM3_BUILD_STATIC "Enable building blast static library" ON)
|
|
12
|
+
option(ZLIB_IOSTREAM3_BUILD_TESTING "Enable building tests for blast" ON)
|
|
13
|
+
option(ZLIB_IOSTREAM3_INSTALL "Enable installation of iostream" ON)
|
|
14
|
+
|
|
15
|
+
include(GNUInstallDirs)
|
|
16
|
+
include(CMakePackageConfigHelpers)
|
|
17
|
+
|
|
18
|
+
if(NOT DEFINED ZLIB_BUILD_IOSTREAM3)
|
|
19
|
+
if(ZLIB_IOSTREAM3_BUILD_SHARED)
|
|
20
|
+
list(APPEND REQUIRED_COMPONENTS "shared")
|
|
21
|
+
endif(ZLIB_IOSTREAM3_BUILD_SHARED)
|
|
22
|
+
|
|
23
|
+
if(ZLIB_IOSTREAM3_BUILD_STATIC)
|
|
24
|
+
list(APPEND REQUIRED_COMPONENTS "static")
|
|
25
|
+
endif(ZLIB_IOSTREAM3_BUILD_STATIC)
|
|
26
|
+
|
|
27
|
+
find_package(ZLIB REQUIRED COMPONENTS ${REQUIRED_COMPONENTS} CONFIG)
|
|
28
|
+
endif(NOT DEFINED ZLIB_BUILD_IOSTREAM3)
|
|
29
|
+
|
|
30
|
+
if(WIN32 OR CYGWIN)
|
|
31
|
+
set(zlibIOStream3_static_suffix "s")
|
|
32
|
+
set(CMAKE_DEBUG_POSTFIX "d")
|
|
33
|
+
endif(WIN32 OR CYGWIN)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
function(iostreamv3_findTestEnv testName)
|
|
37
|
+
set(testEnv "PATH=")
|
|
38
|
+
|
|
39
|
+
if(MSVC OR MINGW)
|
|
40
|
+
set(separator "\\\;")
|
|
41
|
+
else()
|
|
42
|
+
set(separator ":")
|
|
43
|
+
endif()
|
|
44
|
+
|
|
45
|
+
string(APPEND testEnv "$<TARGET_FILE_DIR:zlib_iostream3_iostreamv3>${separator}")
|
|
46
|
+
string(APPEND testEnv "$<TARGET_FILE_DIR:ZLIB::ZLIB>${separator}")
|
|
47
|
+
string(APPEND testEnv "$ENV{PATH}")
|
|
48
|
+
|
|
49
|
+
set_tests_properties(${testName} PROPERTIES ENVIRONMENT "${testEnv}")
|
|
50
|
+
endfunction(iostreamv3_findTestEnv testName)
|
|
51
|
+
|
|
52
|
+
if(ZLIB_IOSTREAM3_BUILD_SHARED)
|
|
53
|
+
add_library(zlib_iostream3_iostreamv3 SHARED
|
|
54
|
+
zfstream.cc
|
|
55
|
+
zfstream.h)
|
|
56
|
+
|
|
57
|
+
add_library(IOSTREAMV3::IOSTREAMV3 ALIAS zlib_iostream3_iostreamv3)
|
|
58
|
+
|
|
59
|
+
if(NOT CYGWIN)
|
|
60
|
+
set_target_properties(zlib_iostream3_iostreamv3
|
|
61
|
+
PROPERTIES
|
|
62
|
+
SOVERSION ${iostreamV3_VERSION_MAJOR}
|
|
63
|
+
VERSION ${iostreamV3_VERSION})
|
|
64
|
+
endif(NOT CYGWIN)
|
|
65
|
+
|
|
66
|
+
set_target_properties(zlib_iostream3_iostreamv3
|
|
67
|
+
PROPERTIES
|
|
68
|
+
EXPORT_NAME IOSTREAMV3
|
|
69
|
+
OUTPUT_NAME iostream3)
|
|
70
|
+
|
|
71
|
+
target_link_libraries(zlib_iostream3_iostreamv3
|
|
72
|
+
PUBLIC ZLIB::ZLIB)
|
|
73
|
+
|
|
74
|
+
if(ZLIB_IOSTREAM3_BUILD_TESTING)
|
|
75
|
+
enable_testing()
|
|
76
|
+
|
|
77
|
+
add_executable(zlib_iostream3_test test.cc zfstream.h)
|
|
78
|
+
|
|
79
|
+
target_link_libraries(zlib_iostream3_test
|
|
80
|
+
PRIVATE zlib_iostream3_iostreamv3)
|
|
81
|
+
|
|
82
|
+
add_test(NAME zlib_iostream3_test COMMAND zlib_iostream3_test)
|
|
83
|
+
|
|
84
|
+
set_tests_properties(zlib_iostream3_test
|
|
85
|
+
PROPERTIES
|
|
86
|
+
FIXTURES_REQUIRED zlib_iostream3_cleanup)
|
|
87
|
+
|
|
88
|
+
if(MSVC
|
|
89
|
+
OR MSYS
|
|
90
|
+
OR MINGW
|
|
91
|
+
OR CYGWIN)
|
|
92
|
+
iostreamv3_findtestenv(zlib_iostream3_test)
|
|
93
|
+
endif(
|
|
94
|
+
MSVC
|
|
95
|
+
OR MSYS
|
|
96
|
+
OR MINGW
|
|
97
|
+
OR CYGWIN)
|
|
98
|
+
endif(ZLIB_IOSTREAM3_BUILD_TESTING)
|
|
99
|
+
endif(ZLIB_IOSTREAM3_BUILD_SHARED)
|
|
100
|
+
|
|
101
|
+
if(ZLIB_IOSTREAM3_BUILD_STATIC)
|
|
102
|
+
add_library(zlib_iostream3_iostreamv3Static STATIC
|
|
103
|
+
zfstream.cc
|
|
104
|
+
zfstream.h)
|
|
105
|
+
|
|
106
|
+
add_library(IOSTREAMV3::IOSTREAMV3STATIC
|
|
107
|
+
ALIAS zlib_iostream3_iostreamv3Static)
|
|
108
|
+
|
|
109
|
+
target_link_libraries(zlib_iostream3_iostreamv3Static
|
|
110
|
+
PUBLIC ZLIB::ZLIBSTATIC)
|
|
111
|
+
|
|
112
|
+
set_target_properties(zlib_iostream3_iostreamv3Static
|
|
113
|
+
PROPERTIES
|
|
114
|
+
EXPORT_NAME IOSTREAMV3STATIC
|
|
115
|
+
OUTPUT_NAME iostream3${zlib_IOStream3_static_suffix})
|
|
116
|
+
|
|
117
|
+
if(ZLIB_IOSTREAM3_BUILD_TESTING)
|
|
118
|
+
enable_testing()
|
|
119
|
+
|
|
120
|
+
add_executable(zlib_iostream3_testStatic test.cc zfstream.h)
|
|
121
|
+
|
|
122
|
+
target_link_libraries(zlib_iostream3_testStatic
|
|
123
|
+
PRIVATE zlib_iostream3_iostreamv3Static)
|
|
124
|
+
|
|
125
|
+
add_test(NAME zlib_iostream3_testStatic
|
|
126
|
+
COMMAND zlib_iostream3_testStatic)
|
|
127
|
+
|
|
128
|
+
set_tests_properties(zlib_iostream3_testStatic
|
|
129
|
+
PROPERTIES
|
|
130
|
+
FIXTURES_REQUIRED zlib_iostream3_cleanup)
|
|
131
|
+
endif(ZLIB_IOSTREAM3_BUILD_TESTING)
|
|
132
|
+
endif(ZLIB_IOSTREAM3_BUILD_STATIC)
|
|
133
|
+
|
|
134
|
+
if(ZLIB_IOSTREAM3_BUILD_TESTING)
|
|
135
|
+
add_test(NAME zlib_iostream3_cleanup COMMAND ${CMAKE_COMMAND} -E rm
|
|
136
|
+
${CMAKE_CURRENT_BINARY_DIR}/test1.txt.gz
|
|
137
|
+
${CMAKE_CURRENT_BINARY_DIR}/test2.txt.gz)
|
|
138
|
+
|
|
139
|
+
set_tests_properties(zlib_iostream3_cleanup
|
|
140
|
+
PROPERTIES
|
|
141
|
+
FIXTURES_CLEANUP zlib_iostream3_cleanup)
|
|
142
|
+
|
|
143
|
+
add_subdirectory(test)
|
|
144
|
+
endif(ZLIB_IOSTREAM3_BUILD_TESTING)
|
|
145
|
+
|
|
146
|
+
if(ZLIB_IOSTREAM3_INSTALL)
|
|
147
|
+
if(ZLIB_IOSTREAM3_BUILD_SHARED)
|
|
148
|
+
install(
|
|
149
|
+
TARGETS zlib_iostream3_iostreamv3
|
|
150
|
+
COMPONENT Runtime
|
|
151
|
+
EXPORT zlibiostream3SharedExport
|
|
152
|
+
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
|
153
|
+
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
|
154
|
+
install(
|
|
155
|
+
EXPORT zlibiostream3SharedExport
|
|
156
|
+
FILE iostreamv3-shared.cmake
|
|
157
|
+
NAMESPACE IOSTREAMV3::
|
|
158
|
+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/iostreamv3)
|
|
159
|
+
|
|
160
|
+
if(MSVC)
|
|
161
|
+
install(
|
|
162
|
+
FILES $<TARGET_PDB_FILE:zlib_iostream3_iostreamv3>
|
|
163
|
+
COMPONENT Development
|
|
164
|
+
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
165
|
+
CONFIGURATIONS Debug OR RelWithDebInfo
|
|
166
|
+
OPTIONAL)
|
|
167
|
+
endif(MSVC)
|
|
168
|
+
endif(ZLIB_IOSTREAM3_BUILD_SHARED)
|
|
169
|
+
|
|
170
|
+
if(ZLIB_IOSTREAM3_BUILD_STATIC)
|
|
171
|
+
install(
|
|
172
|
+
TARGETS zlib_iostream3_iostreamv3Static
|
|
173
|
+
COMPONENT Development
|
|
174
|
+
EXPORT iostream3StaticExport
|
|
175
|
+
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
|
176
|
+
install(
|
|
177
|
+
EXPORT iostream3StaticExport
|
|
178
|
+
FILE iostreamv3-static.cmake
|
|
179
|
+
NAMESPACE IOSTREAMV3::
|
|
180
|
+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/iostreamv3)
|
|
181
|
+
endif(ZLIB_IOSTREAM3_BUILD_STATIC)
|
|
182
|
+
|
|
183
|
+
configure_package_config_file(
|
|
184
|
+
${iostreamV3_SOURCE_DIR}/iostream3Config.cmake.in
|
|
185
|
+
${iostreamV3_BINARY_DIR}/iostreamv3Config.cmake
|
|
186
|
+
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/iostreamv3)
|
|
187
|
+
|
|
188
|
+
write_basic_package_version_file(
|
|
189
|
+
"${iostreamV3_BINARY_DIR}/iostreamv3ConfigVersion.cmake"
|
|
190
|
+
VERSION "${iostream3_VERSION}"
|
|
191
|
+
COMPATIBILITY AnyNewerVersion)
|
|
192
|
+
|
|
193
|
+
install(FILES ${iostreamV3_BINARY_DIR}/iostreamv3Config.cmake
|
|
194
|
+
${iostreamV3_BINARY_DIR}/iostreamv3ConfigVersion.cmake
|
|
195
|
+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/iostreamv3)
|
|
196
|
+
install(
|
|
197
|
+
FILES zfstream.h
|
|
198
|
+
COMPONENT Development
|
|
199
|
+
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
|
200
|
+
endif(ZLIB_IOSTREAM3_INSTALL)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
These classes provide a C++ stream interface to the zlib library. It allows you
|
|
2
|
+
to do things like:
|
|
3
|
+
|
|
4
|
+
gzofstream outf("blah.gz");
|
|
5
|
+
outf << "These go into the gzip file " << 123 << endl;
|
|
6
|
+
|
|
7
|
+
It does this by deriving a specialized stream buffer for gzipped files, which is
|
|
8
|
+
the way Stroustrup would have done it. :->
|
|
9
|
+
|
|
10
|
+
The gzifstream and gzofstream classes were originally written by Kevin Ruland
|
|
11
|
+
and made available in the zlib contrib/iostream directory. The older version still
|
|
12
|
+
compiles under gcc 2.xx, but not under gcc 3.xx, which sparked the development of
|
|
13
|
+
this version.
|
|
14
|
+
|
|
15
|
+
The new classes are as standard-compliant as possible, closely following the
|
|
16
|
+
approach of the standard library's fstream classes. It compiles under gcc versions
|
|
17
|
+
3.2 and 3.3, but not under gcc 2.xx. This is mainly due to changes in the standard
|
|
18
|
+
library naming scheme. The new version of gzifstream/gzofstream/gzfilebuf differs
|
|
19
|
+
from the previous one in the following respects:
|
|
20
|
+
- added showmanyc
|
|
21
|
+
- added setbuf, with support for unbuffered output via setbuf(0,0)
|
|
22
|
+
- a few bug fixes of stream behavior
|
|
23
|
+
- gzipped output file opened with default compression level instead of maximum level
|
|
24
|
+
- setcompressionlevel()/strategy() members replaced by single setcompression()
|
|
25
|
+
|
|
26
|
+
The code is provided "as is", with the permission to use, copy, modify, distribute
|
|
27
|
+
and sell it for any purpose without fee.
|
|
28
|
+
|
|
29
|
+
Ludwig Schwardt
|
|
30
|
+
<schwardt@sun.ac.za>
|
|
31
|
+
|
|
32
|
+
DSP Lab
|
|
33
|
+
Electrical & Electronic Engineering Department
|
|
34
|
+
University of Stellenbosch
|
|
35
|
+
South Africa
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Possible upgrades to gzfilebuf:
|
|
2
|
+
|
|
3
|
+
- The ability to do putback (e.g. putbackfail)
|
|
4
|
+
|
|
5
|
+
- The ability to seek (zlib supports this, but could be slow/tricky)
|
|
6
|
+
|
|
7
|
+
- Simultaneous read/write access (does it make sense?)
|
|
8
|
+
|
|
9
|
+
- Support for ios_base::ate open mode
|
|
10
|
+
|
|
11
|
+
- Locale support?
|
|
12
|
+
|
|
13
|
+
- Check public interface to see which calls give problems
|
|
14
|
+
(due to dependence on library internals)
|
|
15
|
+
|
|
16
|
+
- Override operator<<(ostream&, gzfilebuf*) to allow direct copying
|
|
17
|
+
of stream buffer to stream ( i.e. os << is.rdbuf(); )
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@PACKAGE_INIT@
|
|
2
|
+
|
|
3
|
+
set(_iostreamv3_supported_components "shared" "static")
|
|
4
|
+
include(CMakeFindDependencyMacro)
|
|
5
|
+
|
|
6
|
+
if(iostreamv3_FIND_COMPONENTS)
|
|
7
|
+
find_dependency(ZLIB CONFIG COMPONENTS ${iostreamv3_FIND_COMPONENTS})
|
|
8
|
+
|
|
9
|
+
foreach(_comp ${iostreamv3_FIND_COMPONENTS})
|
|
10
|
+
if(NOT _comp IN_LIST _iostreamv3_supported_components)
|
|
11
|
+
set(iostreamv3_FOUND False)
|
|
12
|
+
set(iostreamv3_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}")
|
|
13
|
+
endif(NOT _comp IN_LIST _iostreamv3_supported_components)
|
|
14
|
+
|
|
15
|
+
include("${CMAKE_CURRENT_LIST_DIR}/iostreamv3-${_comp}.cmake")
|
|
16
|
+
endforeach(_comp ${iostreamv3_FIND_COMPONENTS})
|
|
17
|
+
else(iostream3_FIND_COMPONENTS)
|
|
18
|
+
find_dependency(ZLIB CONFIG)
|
|
19
|
+
|
|
20
|
+
foreach(_component_config IN LISTS _iostreamv3_supported_components)
|
|
21
|
+
include("${CMAKE_CURRENT_LIST_DIR}/iostreamv3-${_component_config}.cmake")
|
|
22
|
+
endforeach(_component_config IN LISTS _iostreamv3_supported_components)
|
|
23
|
+
endif(iostreamv3_FIND_COMPONENTS)
|