├── .gitattributes ├── .gitignore ├── Config ├── Project_Includes.props ├── Project_compile.props ├── Project_optimize.props ├── Project_paths.props └── VC-LTL helper for Visual Studio.props ├── Documents ├── chinese.json ├── test_script.txt ├── test_script8.txt └── test_scriptU.txt ├── Libraries ├── Libraries.props ├── Libraries_defs.props ├── ShowImage │ ├── DrawPicture.cpp │ ├── SavePicture.cpp │ ├── ShowImage.vcxproj │ ├── ShowImage.vcxproj.filters │ ├── ShowPicture.cpp │ ├── ShowPicture.h │ ├── ShowPictureInterface.cpp │ ├── ShowPictureInterface.h │ ├── ShowPictureWithZoom.cpp │ ├── ShowPictureWithZoom.h │ ├── ShowPictureWithZoomInterface.cpp │ ├── ShowPictureWithZoomInterface.h │ ├── WndProc.cpp │ ├── config.h │ ├── dds │ │ ├── DDS.h │ │ ├── DDSTextureLoader.cpp │ │ ├── DDSTextureLoader.h │ │ ├── DdsTgaDecoder.cpp │ │ ├── DdsTgaDecoder.h │ │ ├── DdsTgaDecoderBuildDIB.cpp │ │ ├── DdsTgaDecoderDefine.h │ │ ├── DdsTgaDecoderDetectFormat.cpp │ │ └── dxgiformat.h │ ├── showimgpch.cpp │ └── showimgpch.h ├── nlohmann │ ├── README.md │ └── json.hpp ├── thirdparty │ ├── libdeflate │ │ ├── .gitignore │ │ ├── COPYING │ │ ├── Makefile │ │ ├── Makefile.msc │ │ ├── NEWS │ │ ├── README.md │ │ ├── common │ │ │ ├── common_defs.h │ │ │ ├── compiler_gcc.h │ │ │ ├── compiler_msc.h │ │ │ └── msvc_conf.h │ │ ├── lib │ │ │ ├── adler32.c │ │ │ ├── adler32_vec_template.h │ │ │ ├── aligned_malloc.c │ │ │ ├── aligned_malloc.h │ │ │ ├── bt_matchfinder.h │ │ │ ├── crc32.c │ │ │ ├── crc32_table.h │ │ │ ├── crc32_vec_template.h │ │ │ ├── decompress_template.h │ │ │ ├── deflate_compress.c │ │ │ ├── deflate_compress.h │ │ │ ├── deflate_constants.h │ │ │ ├── deflate_decompress.c │ │ │ ├── gzip_compress.c │ │ │ ├── gzip_constants.h │ │ │ ├── gzip_decompress.c │ │ │ ├── hc_matchfinder.h │ │ │ ├── lib_common.h │ │ │ ├── matchfinder_common.h │ │ │ ├── unaligned.h │ │ │ ├── zlib_compress.c │ │ │ ├── zlib_constants.h │ │ │ └── zlib_decompress.c │ │ ├── libdeflate.h │ │ ├── libdeflate.sln │ │ ├── libdeflate.vcxproj │ │ ├── libdeflate.vcxproj.filters │ │ ├── programs │ │ │ ├── benchmark.c │ │ │ ├── checksum.c │ │ │ ├── detect.sh │ │ │ ├── gzip.c │ │ │ ├── prog_util.c │ │ │ ├── prog_util.h │ │ │ ├── test_checksums.c │ │ │ ├── test_incomplete_codes.c │ │ │ ├── test_slow_decompression.c │ │ │ ├── test_util.c │ │ │ ├── test_util.h │ │ │ └── tgetopt.c │ │ └── tools │ │ │ ├── afl-fuzz │ │ │ ├── Makefile │ │ │ ├── deflate_compress │ │ │ │ ├── fuzz.c │ │ │ │ └── inputs │ │ │ │ │ └── 0 │ │ │ ├── deflate_decompress │ │ │ │ ├── fuzz.c │ │ │ │ └── inputs │ │ │ │ │ └── 0 │ │ │ ├── gzip_decompress │ │ │ │ ├── fuzz.c │ │ │ │ └── inputs │ │ │ │ │ └── 0 │ │ │ ├── prepare_for_fuzz.sh │ │ │ └── zlib_decompress │ │ │ │ ├── fuzz.c │ │ │ │ └── inputs │ │ │ │ └── 0 │ │ │ ├── android_build.sh │ │ │ ├── checksum_benchmarks.sh │ │ │ ├── exec_tests.sh │ │ │ ├── gen_crc32_multipliers.c │ │ │ ├── gen_crc32_table.c │ │ │ ├── gzip_tests.sh │ │ │ ├── make-windows-releases │ │ │ ├── mips_build.sh │ │ │ ├── msc_test.bat │ │ │ ├── pgo_build.sh │ │ │ ├── produce_gzip_benchmark_table.sh │ │ │ ├── run_tests.sh │ │ │ └── windows_build.sh │ └── zlib │ │ ├── adler32.c │ │ ├── compress.c │ │ ├── contrib │ │ ├── README.contrib │ │ ├── amd64 │ │ │ └── amd64-match.S │ │ ├── asm686 │ │ │ ├── README.686 │ │ │ └── match.S │ │ ├── inflate86 │ │ │ ├── inffas86.c │ │ │ └── inffast.S │ │ ├── masmx64 │ │ │ ├── gvmat64.asm │ │ │ ├── inffas8664.c │ │ │ └── inffasx64.asm │ │ └── masmx86 │ │ │ ├── inffas32.asm │ │ │ └── match686.asm │ │ ├── crc32.c │ │ ├── crc32.h │ │ ├── deflate.c │ │ ├── deflate.h │ │ ├── gzguts.h │ │ ├── infback.c │ │ ├── inffast.c │ │ ├── inffast.h │ │ ├── inffixed.h │ │ ├── inflate.c │ │ ├── inflate.h │ │ ├── inftrees.c │ │ ├── inftrees.h │ │ ├── trees.c │ │ ├── trees.h │ │ ├── uncompr.c │ │ ├── zconf.h │ │ ├── zlib.h │ │ ├── zlib.vcxproj │ │ ├── zlib.vcxproj.filters │ │ ├── zutil.c │ │ └── zutil.h └── thread-pool │ ├── .clang-format │ ├── .gitignore │ ├── CHANGELOG.md │ ├── CITATION.bib │ ├── CITATION.cff │ ├── LICENSE.txt │ ├── README.md │ ├── include │ ├── BS_thread_pool.hpp │ └── BS_thread_pool_light.hpp │ └── tests │ ├── BS_thread_pool_test.cpp │ └── BS_thread_pool_test.ps1 ├── PckDll ├── DictHash │ ├── DictHash.cpp │ └── DictHash.h ├── PckClass │ ├── PckAlgorithmId.cpp │ ├── PckAlgorithmId.h │ ├── PckClass.cpp │ ├── PckClass.h │ ├── PckClassAppendFiles.cpp │ ├── PckClassBaseFeatures.cpp │ ├── PckClassBaseFeatures.h │ ├── PckClassCodepage.cpp │ ├── PckClassCodepage.h │ ├── PckClassExtract.cpp │ ├── PckClassFileDisk.cpp │ ├── PckClassFileDisk.h │ ├── PckClassHeadTail.cpp │ ├── PckClassHeadTail.h │ ├── PckClassHeadTailWriter.cpp │ ├── PckClassHeadTailWriter.h │ ├── PckClassIndex.cpp │ ├── PckClassIndex.h │ ├── PckClassIndexRead.cpp │ ├── PckClassIndexWriter.cpp │ ├── PckClassIndexWriter.h │ ├── PckClassLog.cpp │ ├── PckClassLog.h │ ├── PckClassMount.cpp │ ├── PckClassNode.cpp │ ├── PckClassNode.h │ ├── PckClassRebuild.cpp │ ├── PckClassRebuildFilter.cpp │ ├── PckClassRebuildFilter.h │ ├── PckClassRenamer.cpp │ ├── PckClassVersionDetect.cpp │ ├── PckClassVersionDetect.h │ ├── PckClassVersionFillDataTemplate.h │ ├── PckClassWriteOperator.h │ ├── PckClassZlib.cpp │ ├── PckClassZlib.h │ ├── PckDefines.h │ ├── PckHeader.h │ ├── PckIndexCache.cpp │ ├── PckIndexCache.h │ ├── PckModelStrip.cpp │ ├── PckModelStrip.h │ ├── PckModelStripDefines.h │ ├── PckStructs.h │ ├── PckThreadRunner.cpp │ ├── PckThreadRunner.h │ ├── PckThreadRunnerData.cpp │ ├── PckThreadRunnerMemory.cpp │ └── PckThreadRunnerQueue.cpp ├── PckControlCenter │ ├── PckControlCenter.cpp │ ├── PckControlCenter.h │ ├── PckControlCenterAttribute.cpp │ ├── PckControlCenterInterface.cpp │ ├── PckControlCenterOperation.cpp │ └── PckControlCenterParams.cpp ├── WinPCK_dll.vcxproj ├── WinPCK_dll.vcxproj.filters ├── ZupClass │ ├── ZupClass.cpp │ ├── ZupClass.h │ ├── ZupClassExtract.cpp │ ├── ZupClassFunction.cpp │ └── ZupHeader.h ├── icons │ ├── Thumbs.db │ ├── chinaz1.png │ ├── chinaz1x.ico │ ├── filefind.ico │ ├── logerror.png │ ├── loginfo.png │ └── logwarning.png ├── include │ ├── compiler.h │ ├── compiler_gcc.h │ ├── compiler_msc.h │ ├── gccException.h │ ├── msvc_conf.h │ ├── pck_default_vars.h │ ├── pck_dependencies.h │ └── pck_handle.h ├── pch.cpp ├── pch.h ├── pckdll.rc ├── resource.h └── src │ └── pck_handle.cpp ├── README.md ├── WinPCK.sln ├── WinPCK ├── MenuButtonFuncs.cpp ├── ShowLogOnDlgListView.cpp ├── ShowLogOnDlgListView.h ├── WinPCK.rc ├── WinPCK.vcxproj ├── WinPCK.vcxproj.filters ├── X86-64.manifest ├── globals.h ├── guipch.cpp ├── guipch.h ├── guirelated.cpp ├── helpfunc.cpp ├── icons │ ├── DROP.cur │ ├── Thumbs.db │ ├── chinaz1.ico │ ├── chinaz1.png │ ├── chinaz1x.ico │ ├── dir.ico │ ├── edit.ico │ ├── edit_add.ico │ ├── exit.ico │ ├── file.ico │ ├── fileclose.ico │ ├── filenew.ico │ ├── fileopen.ico │ ├── filesave.ico │ ├── icon2.ico │ ├── info.ico │ ├── lin_agt_wrench.ico │ ├── logdebug.ico │ ├── logerror.ico │ ├── logerror.png │ ├── loginfo.ico │ ├── loginfo.png │ ├── logwarning.ico │ ├── logwarning.png │ ├── rebuild.ico │ ├── save_all.ico │ ├── search.ico │ ├── stop.ico │ └── stripsave.ico ├── listViewFunc.cpp ├── loggerGuiSink.h ├── mainControlStatus.cpp ├── mainfunc.cpp ├── resource.h ├── tAttrDlg.cpp ├── tAttrDlg.h ├── tCompressOptDlg.cpp ├── tCompressOptDlg.h ├── tInfoDlg.cpp ├── tInfoDlg.h ├── tLogDlg.cpp ├── tLogDlg.h ├── tPicDlg.cpp ├── tPreviewDlg.cpp ├── tPreviewDlg.h ├── tRebuildOptDlg.cpp ├── tRebuildOptDlg.h ├── tSearchDlg.cpp ├── tSearchDlg.h ├── tStripDlg.cpp ├── tStripDlg.h ├── tViewDlg.cpp ├── threadproc.cpp ├── winmain.cpp └── winmain.h ├── dlltester ├── dlltester.cpp ├── dlltester.vcxproj ├── dlltester.vcxproj.filters ├── pch.cpp └── pch.h ├── logger ├── spdlog │ ├── CMakeLists.txt │ ├── INSTALL │ ├── README.md │ ├── include │ │ └── spdlog │ │ │ ├── async.h │ │ │ ├── async_logger-inl.h │ │ │ ├── async_logger.h │ │ │ ├── cfg │ │ │ ├── argv.h │ │ │ ├── env.h │ │ │ ├── helpers-inl.h │ │ │ └── helpers.h │ │ │ ├── common-inl.h │ │ │ ├── common.h │ │ │ ├── details │ │ │ ├── backtracer-inl.h │ │ │ ├── backtracer.h │ │ │ ├── circular_q.h │ │ │ ├── console_globals.h │ │ │ ├── file_helper-inl.h │ │ │ ├── file_helper.h │ │ │ ├── fmt_helper.h │ │ │ ├── log_msg-inl.h │ │ │ ├── log_msg.h │ │ │ ├── log_msg_buffer-inl.h │ │ │ ├── log_msg_buffer.h │ │ │ ├── mpmc_blocking_q.h │ │ │ ├── null_mutex.h │ │ │ ├── os-inl.h │ │ │ ├── os.h │ │ │ ├── periodic_worker-inl.h │ │ │ ├── periodic_worker.h │ │ │ ├── registry-inl.h │ │ │ ├── registry.h │ │ │ ├── synchronous_factory.h │ │ │ ├── tcp_client-windows.h │ │ │ ├── tcp_client.h │ │ │ ├── thread_pool-inl.h │ │ │ ├── thread_pool.h │ │ │ ├── udp_client-windows.h │ │ │ ├── udp_client.h │ │ │ └── windows_include.h │ │ │ ├── fmt │ │ │ ├── bin_to_hex.h │ │ │ ├── bundled │ │ │ │ ├── args.h │ │ │ │ ├── chrono.h │ │ │ │ ├── color.h │ │ │ │ ├── compile.h │ │ │ │ ├── core.h │ │ │ │ ├── fmt.license.rst │ │ │ │ ├── format-inl.h │ │ │ │ ├── format.h │ │ │ │ ├── locale.h │ │ │ │ ├── os.h │ │ │ │ ├── ostream.h │ │ │ │ ├── printf.h │ │ │ │ ├── ranges.h │ │ │ │ ├── std.h │ │ │ │ └── xchar.h │ │ │ ├── chrono.h │ │ │ ├── compile.h │ │ │ ├── fmt.h │ │ │ ├── ostr.h │ │ │ ├── ranges.h │ │ │ ├── std.h │ │ │ └── xchar.h │ │ │ ├── formatter.h │ │ │ ├── fwd.h │ │ │ ├── logger-inl.h │ │ │ ├── logger.h │ │ │ ├── pattern_formatter-inl.h │ │ │ ├── pattern_formatter.h │ │ │ ├── sinks │ │ │ ├── android_sink.h │ │ │ ├── ansicolor_sink-inl.h │ │ │ ├── ansicolor_sink.h │ │ │ ├── base_sink-inl.h │ │ │ ├── base_sink.h │ │ │ ├── basic_file_sink-inl.h │ │ │ ├── basic_file_sink.h │ │ │ ├── callback_sink.h │ │ │ ├── daily_file_sink.h │ │ │ ├── dist_sink.h │ │ │ ├── dup_filter_sink.h │ │ │ ├── hourly_file_sink.h │ │ │ ├── kafka_sink.h │ │ │ ├── mongo_sink.h │ │ │ ├── msvc_sink.h │ │ │ ├── null_sink.h │ │ │ ├── ostream_sink.h │ │ │ ├── qt_sinks.h │ │ │ ├── ringbuffer_sink.h │ │ │ ├── rotating_file_sink-inl.h │ │ │ ├── rotating_file_sink.h │ │ │ ├── sink-inl.h │ │ │ ├── sink.h │ │ │ ├── stdout_color_sinks-inl.h │ │ │ ├── stdout_color_sinks.h │ │ │ ├── stdout_sinks-inl.h │ │ │ ├── stdout_sinks.h │ │ │ ├── syslog_sink.h │ │ │ ├── systemd_sink.h │ │ │ ├── tcp_sink.h │ │ │ ├── udp_sink.h │ │ │ ├── win_eventlog_sink.h │ │ │ ├── wincolor_sink-inl.h │ │ │ ├── wincolor_sink.h │ │ │ └── winedit_sinks.h │ │ │ ├── spdlog-inl.h │ │ │ ├── spdlog.h │ │ │ ├── stopwatch.h │ │ │ ├── tweakme.h │ │ │ └── version.h │ ├── spdlog.vcxproj │ ├── spdlog.vcxproj.filters │ └── src │ │ ├── async.cpp │ │ ├── bundled_fmtlib_format.cpp │ │ ├── cfg.cpp │ │ ├── color_sinks.cpp │ │ ├── file_sinks.cpp │ │ ├── spdlog.cpp │ │ └── stdout_sinks.cpp └── spdloghelper │ ├── spdloghelper.vcxproj │ ├── spdloghelper.vcxproj.filters │ └── spdloghelper │ ├── DetailLogger.h │ ├── Logger.cpp │ ├── Logger.h │ ├── LoggerInit.h │ ├── helper_functions.cpp │ ├── pch_spdlogh.cpp │ └── pch_spdlogh.h ├── self-dev ├── MapViewFile │ ├── MapViewFile.cpp │ ├── MapViewFile.h │ ├── MapViewFile.vcxproj │ ├── MapViewFile.vcxproj.filters │ ├── MapViewFileMulti.cpp │ ├── MapViewFileMulti.h │ ├── MapViewFileMultiPck.cpp │ ├── MapViewFileMultiPck.h │ ├── MapViewFileMultiPckRead.cpp │ ├── MapViewFileMultiPckWrite.cpp │ ├── MapViewFileMultiRead.cpp │ ├── MapViewFileMultiWrite.cpp │ ├── MapViewFileRead.cpp │ ├── MapViewFileWrite.cpp │ ├── framework.h │ ├── pch.cpp │ └── pch_mvf.h ├── MiscUtil │ ├── AccessCheck.cpp │ ├── AccessCheck.h │ ├── AppEnv.cpp │ ├── AppEnv.h │ ├── BytesConv.cpp │ ├── BytesConv.h │ ├── BytesSpeed.cpp │ ├── BytesSpeed.h │ ├── CharsCodeConv.cpp │ ├── CharsCodeConv.h │ ├── GetDragPath.cpp │ ├── GetDragPath.h │ ├── MemBuffer.h │ ├── MemBufferReader.cpp │ ├── MemBufferReader.h │ ├── MemBufferWriter.cpp │ ├── MemBufferWriter.h │ ├── MemPool.cpp │ ├── MemPool.h │ ├── MiscUtil.vcxproj │ ├── MiscUtil.vcxproj.filters │ ├── Raw2HexString.cpp │ ├── Raw2HexString.h │ ├── StackWalker.cpp │ ├── StackWalker.h │ ├── StackWalkerLiqf.cpp │ ├── StackWalkerLiqf.h │ ├── StdFileFuncs.cpp │ ├── StdFileFuncs.h │ ├── StopWatch.cpp │ ├── StopWatch.h │ ├── TextEncoding.cpp │ ├── TextEncoding.h │ ├── TextLineSpliter.cpp │ ├── TextLineSpliter.h │ ├── TranslateDict.cpp │ ├── TranslateDict.h │ ├── UnknownExceptionFilter.cpp │ ├── UnknownExceptionFilter.h │ ├── driver_funcs.cpp │ ├── driver_funcs.h │ ├── getopt.h │ ├── json.hpp │ └── template_type.h ├── WinCtl │ ├── CommDlg │ │ ├── CEdit.cpp │ │ ├── CEdit.h │ │ ├── CEditNumber.cpp │ │ ├── CEditNumber.h │ │ ├── COpenFileListener.cpp │ │ ├── COpenFileListener.h │ │ ├── CRichEdit.cpp │ │ ├── CRichEdit.h │ │ ├── Colors.h │ │ ├── ComboBox.cpp │ │ ├── ComboBox.h │ │ ├── ListViewCtrl.cpp │ │ ├── ListViewCtrl.h │ │ ├── MyCommDlg.cpp │ │ ├── MyCommDlg.h │ │ ├── TabControl.cpp │ │ ├── TabControl.h │ │ ├── WinControl.cpp │ │ ├── WinControl.h │ │ └── template_type.h │ ├── WinCtl.vcxproj │ └── WinCtl.vcxproj.filters └── base64 │ ├── base64.cpp │ ├── base64.h │ ├── base64.vcxproj │ ├── base64.vcxproj.filters │ ├── base64_decoder.cpp │ └── base64_encoder.cpp └── tlib ├── framework.h ├── pch.cpp ├── tDebug.h ├── tapi32ex.cpp ├── tapi32ex.h ├── tapi32u8.cpp ├── tapi32u8.h ├── tapp.cpp ├── tconf.h ├── tdlg.cpp ├── tini.cpp ├── tini.h ├── tlib.h ├── tlib.vcxproj ├── tlib.vcxproj.filters ├── tlibpch.h ├── tlist.cpp ├── tlist.h ├── tmisc.cpp ├── tregist.cpp ├── tregist.h └── twin.cpp /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /Config/Project_paths.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | true 6 | false 7 | 8 | 9 | 12 | obj 13 | 14 | true 15 | false 16 | 17 | 18 | $(SolutionDir)\bin\$(Configuration)_$(PlatformShortName)\ 19 | $(SolutionDir)\$(IntDirName)\__libs\$(Configuration)_$(PlatformShortName)\ 20 | $(SolutionDir)\$(IntDirName)\$(ProjectName)\$(Configuration)_$(PlatformShortName)\ 21 | $(ProjectName) 22 | 23 | -------------------------------------------------------------------------------- /Documents/chinese.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "简体中文", 3 | "author": "liqf", 4 | "version": "v1.0", 5 | "date": "2024-01-18", 6 | "gui": { 7 | "menu": { 8 | "111": "111" 9 | }, 10 | "maindlg": { 11 | "aaa": "bbb" 12 | } 13 | }, 14 | "dll": { 15 | "aaa": "bbb" 16 | }, 17 | "misc": { 18 | "aaa": "bbb" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Documents/test_script.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Documents/test_script.txt -------------------------------------------------------------------------------- /Documents/test_scriptU.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Documents/test_scriptU.txt -------------------------------------------------------------------------------- /Libraries/ShowImage/DrawPicture.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Libraries/ShowImage/DrawPicture.cpp -------------------------------------------------------------------------------- /Libraries/ShowImage/SavePicture.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Libraries/ShowImage/SavePicture.cpp -------------------------------------------------------------------------------- /Libraries/ShowImage/ShowPicture.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Libraries/ShowImage/ShowPicture.cpp -------------------------------------------------------------------------------- /Libraries/ShowImage/ShowPicture.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Libraries/ShowImage/ShowPicture.h -------------------------------------------------------------------------------- /Libraries/ShowImage/ShowPictureInterface.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "showimgpch.h" 4 | #include "ShowPictureWithZoom.h" 5 | 6 | 7 | std::unique_ptr MakeShowPictureInstance() 8 | { 9 | return std::make_unique(); 10 | } 11 | 12 | std::unique_ptr MakeZoomShowPictureInstance() 13 | { 14 | return std::make_unique(); 15 | } -------------------------------------------------------------------------------- /Libraries/ShowImage/ShowPictureInterface.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Libraries/ShowImage/ShowPictureInterface.h -------------------------------------------------------------------------------- /Libraries/ShowImage/ShowPictureWithZoom.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Libraries/ShowImage/ShowPictureWithZoom.cpp -------------------------------------------------------------------------------- /Libraries/ShowImage/ShowPictureWithZoom.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Libraries/ShowImage/ShowPictureWithZoom.h -------------------------------------------------------------------------------- /Libraries/ShowImage/ShowPictureWithZoomInterface.cpp: -------------------------------------------------------------------------------- 1 | #include "ShowPictureWithZoomInterface.h" 2 | -------------------------------------------------------------------------------- /Libraries/ShowImage/ShowPictureWithZoomInterface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | class IShowPictureWithZoom 3 | { 4 | public: 5 | IShowPictureWithZoom() = default; 6 | virtual ~IShowPictureWithZoom() = default; 7 | 8 | private: 9 | 10 | }; 11 | -------------------------------------------------------------------------------- /Libraries/ShowImage/WndProc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Libraries/ShowImage/WndProc.cpp -------------------------------------------------------------------------------- /Libraries/ShowImage/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define INIT_DDS_MOD 1 4 | 5 | #ifdef NOMINMAX 6 | #undef NOMINMAX 7 | #endif -------------------------------------------------------------------------------- /Libraries/ShowImage/dds/DDSTextureLoader.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: DDSTextureLoader.h 3 | // 4 | // Functions for loading a DDS texture without using D3DX 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | //-------------------------------------------------------------------------------------- 8 | 9 | #include "DDS.h" 10 | 11 | D3DFORMAT GetD3D9Format( const DDS_PIXELFORMAT& ddpf ); 12 | UINT BitsPerPixel( D3DFORMAT fmt ); 13 | -------------------------------------------------------------------------------- /Libraries/ShowImage/dds/DdsTgaDecoder.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Libraries/ShowImage/dds/DdsTgaDecoder.cpp -------------------------------------------------------------------------------- /Libraries/ShowImage/dds/DdsTgaDecoder.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Libraries/ShowImage/dds/DdsTgaDecoder.h -------------------------------------------------------------------------------- /Libraries/ShowImage/dds/DdsTgaDecoderBuildDIB.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Libraries/ShowImage/dds/DdsTgaDecoderBuildDIB.cpp -------------------------------------------------------------------------------- /Libraries/ShowImage/dds/DdsTgaDecoderDefine.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Libraries/ShowImage/dds/DdsTgaDecoderDefine.h -------------------------------------------------------------------------------- /Libraries/ShowImage/dds/DdsTgaDecoderDetectFormat.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Libraries/ShowImage/dds/DdsTgaDecoderDetectFormat.cpp -------------------------------------------------------------------------------- /Libraries/ShowImage/showimgpch.cpp: -------------------------------------------------------------------------------- 1 | #include "showimgpch.h" 2 | 3 | 4 | -------------------------------------------------------------------------------- /Libraries/ShowImage/showimgpch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "config.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | //using namespace Gdiplus; 18 | #include 19 | 20 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.dll 3 | *.exe 4 | *.exp 5 | *.lib 6 | *.o 7 | *.obj 8 | *.so 9 | *.so.* 10 | /.lib-cflags 11 | /.prog-cflags 12 | /programs/config.h 13 | /benchmark 14 | /checksum 15 | /gzip 16 | /gunzip 17 | /run_tests.log 18 | /test_* 19 | tags 20 | cscope* 21 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/COPYING: -------------------------------------------------------------------------------- 1 | Copyright 2016 Eric Biggers 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation files 5 | (the "Software"), to deal in the Software without restriction, 6 | including without limitation the rights to use, copy, modify, merge, 7 | publish, distribute, sublicense, and/or sell copies of the Software, 8 | and to permit persons to whom the Software is furnished to do so, 9 | subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 18 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/Makefile.msc: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for the Microsoft toolchain 3 | # 4 | # Usage: 5 | # nmake /f Makefile.msc 6 | # 7 | 8 | .SUFFIXES: .c .obj .dllobj 9 | 10 | CC = cl 11 | LD = link 12 | AR = lib 13 | CFLAGS = /MD /O2 -I. -Icommon 14 | LDFLAGS = 15 | 16 | STATIC_LIB = libdeflatestatic.lib 17 | SHARED_LIB = libdeflate.dll 18 | IMPORT_LIB = libdeflate.lib 19 | 20 | STATIC_LIB_OBJ = \ 21 | lib/aligned_malloc.obj \ 22 | lib/adler32.obj \ 23 | lib/crc32.obj \ 24 | lib/deflate_compress.obj \ 25 | lib/deflate_decompress.obj \ 26 | lib/gzip_compress.obj \ 27 | lib/gzip_decompress.obj \ 28 | lib/x86/cpu_features.obj \ 29 | lib/zlib_compress.obj \ 30 | lib/zlib_decompress.obj 31 | 32 | SHARED_LIB_OBJ = $(STATIC_LIB_OBJ:.obj=.dllobj) 33 | 34 | PROG_COMMON_OBJ = programs/prog_util.obj \ 35 | programs/tgetopt.obj \ 36 | $(STATIC_LIB) 37 | 38 | PROG_CFLAGS = $(CFLAGS) -Iprograms 39 | 40 | all: $(STATIC_LIB) $(SHARED_LIB) $(IMPORT_LIB) gzip.exe gunzip.exe 41 | 42 | .c.obj: 43 | $(CC) -c /Fo$@ $(CFLAGS) $** 44 | 45 | .c.dllobj: 46 | $(CC) -c /Fo$@ $(CFLAGS) /DLIBDEFLATE_DLL $** 47 | 48 | $(STATIC_LIB): $(STATIC_LIB_OBJ) 49 | $(AR) $(ARFLAGS) -out:$@ $(STATIC_LIB_OBJ) 50 | 51 | $(SHARED_LIB): $(SHARED_LIB_OBJ) 52 | $(LD) $(LDFLAGS) -out:$@ -dll -implib:$(IMPORT_LIB) $(SHARED_LIB_OBJ) 53 | 54 | $(IMPORT_LIB): $(SHARED_LIB) 55 | 56 | gzip.exe:programs/gzip.obj $(PROG_COMMON_OBJ) 57 | $(LD) $(LDFLAGS) -out:$@ $** 58 | 59 | gunzip.exe:gzip.exe 60 | copy $** $@ 61 | 62 | clean: 63 | -del *.dll *.exe *.exp libdeflate.lib libdeflatestatic.lib gzip.lib \ 64 | lib\*.obj lib\*\*.obj lib\*.dllobj lib\*\*.dllobj \ 65 | programs\*.obj 2>nul 66 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/common/msvc_conf.h: -------------------------------------------------------------------------------- 1 | #include 2 | #define COMPILER_SUPPORTS_TARGET_FUNCTION_ATTRIBUTE 1 3 | #define __SSE2__ 1 4 | 5 | #ifdef _M_IX86 6 | #define __i386__ 7 | #elif defined _M_X64 8 | #define __x86_64__ 9 | #endif 10 | 11 | //#define COMPILER_SUPPORTS_AVX_TARGET 1 12 | //#define COMPILER_SUPPORTS_AVX2_TARGET 1 13 | //#define COMPILER_SUPPORTS_TARGET_INTRINSICS 1 14 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/lib/aligned_malloc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * aligned_malloc.c - aligned memory allocation 3 | * 4 | * Originally public domain; changes after 2016-09-07 are copyrighted. 5 | * 6 | * Copyright 2016 Eric Biggers 7 | * 8 | * Permission is hereby granted, free of charge, to any person 9 | * obtaining a copy of this software and associated documentation 10 | * files (the "Software"), to deal in the Software without 11 | * restriction, including without limitation the rights to use, 12 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the 14 | * Software is furnished to do so, subject to the following 15 | * conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | */ 29 | 30 | /* 31 | * This file provides portable aligned memory allocation functions that only 32 | * use malloc() and free(). This avoids portability problems with 33 | * posix_memalign(), aligned_alloc(), etc. 34 | */ 35 | 36 | #include 37 | 38 | #include "aligned_malloc.h" 39 | 40 | void * 41 | aligned_malloc(size_t alignment, size_t size) 42 | { 43 | #if defined(_MSC_VER) || defined(__ICC) 44 | return _aligned_malloc(size, alignment); 45 | #else 46 | void *ptr = malloc(sizeof(void *) + alignment - 1 + size); 47 | if (ptr) { 48 | void *orig_ptr = ptr; 49 | ptr = (void *)ALIGN((uintptr_t)ptr + sizeof(void *), alignment); 50 | ((void **)ptr)[-1] = orig_ptr; 51 | } 52 | return ptr; 53 | #endif 54 | } 55 | 56 | void 57 | aligned_free(void *ptr) 58 | { 59 | if (ptr) 60 | #if defined(_MSC_VER) || defined(__ICC) 61 | _aligned_free(ptr); 62 | #else 63 | free(((void **)ptr)[-1]); 64 | #endif 65 | } 66 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/lib/aligned_malloc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * aligned_malloc.c - aligned memory allocation 3 | */ 4 | 5 | #ifndef LIB_ALIGNED_MALLOC_H 6 | #define LIB_ALIGNED_MALLOC_H 7 | 8 | #include "lib_common.h" 9 | 10 | extern void *aligned_malloc(size_t alignment, size_t size); 11 | extern void aligned_free(void *ptr); 12 | 13 | #endif /* LIB_ALIGNED_MALLOC_H */ 14 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/lib/crc32_vec_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * crc32_vec_template.h - template for vectorized CRC-32 implementations 3 | * 4 | * Copyright 2016 Eric Biggers 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, 10 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the 12 | * Software is furnished to do so, subject to the following 13 | * conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be 16 | * included in all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | * OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | #define CRC32_SLICE1 1 29 | static u32 crc32_slice1(u32, const u8 *, size_t); 30 | 31 | /* 32 | * Template for vectorized CRC-32 implementations. 33 | * 34 | * Note: on unaligned ends of the buffer, we fall back to crc32_slice1() instead 35 | * of crc32_slice8() because only a few bytes need to be processed, so a smaller 36 | * table is preferable. 37 | */ 38 | static u32 ATTRIBUTES 39 | FUNCNAME(u32 remainder, const u8 *p, size_t size) 40 | { 41 | if ((uintptr_t)p % IMPL_ALIGNMENT) { 42 | size_t n = MIN(size, -(uintptr_t)p % IMPL_ALIGNMENT); 43 | 44 | remainder = crc32_slice1(remainder, p, n); 45 | p += n; 46 | size -= n; 47 | } 48 | if (size >= IMPL_SEGMENT_SIZE) { 49 | remainder = FUNCNAME_ALIGNED(remainder, (const void *)p, 50 | size / IMPL_SEGMENT_SIZE); 51 | p += size - (size % IMPL_SEGMENT_SIZE); 52 | size %= IMPL_SEGMENT_SIZE; 53 | } 54 | return crc32_slice1(remainder, p, size); 55 | } 56 | 57 | #undef FUNCNAME 58 | #undef FUNCNAME_ALIGNED 59 | #undef ATTRIBUTES 60 | #undef IMPL_ALIGNMENT 61 | #undef IMPL_SEGMENT_SIZE 62 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/lib/deflate_compress.h: -------------------------------------------------------------------------------- 1 | #ifndef LIB_DEFLATE_COMPRESS_H 2 | #define LIB_DEFLATE_COMPRESS_H 3 | 4 | #include "lib_common.h" 5 | 6 | /* DEFLATE compression is private to deflate_compress.c, but we do need to be 7 | * able to query the compression level for zlib and gzip header generation. */ 8 | 9 | struct libdeflate_compressor; 10 | 11 | extern unsigned int 12 | deflate_get_compression_level(struct libdeflate_compressor *c); 13 | 14 | #endif /* LIB_DEFLATE_COMPRESS_H */ 15 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/lib/gzip_constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gzip_constants.h - constants for the gzip wrapper format 3 | */ 4 | 5 | #ifndef LIB_GZIP_CONSTANTS_H 6 | #define LIB_GZIP_CONSTANTS_H 7 | 8 | #define GZIP_MIN_HEADER_SIZE 10 9 | #define GZIP_FOOTER_SIZE 8 10 | #define GZIP_MIN_OVERHEAD (GZIP_MIN_HEADER_SIZE + GZIP_FOOTER_SIZE) 11 | 12 | #define GZIP_ID1 0x1F 13 | #define GZIP_ID2 0x8B 14 | 15 | #define GZIP_CM_DEFLATE 8 16 | 17 | #define GZIP_FTEXT 0x01 18 | #define GZIP_FHCRC 0x02 19 | #define GZIP_FEXTRA 0x04 20 | #define GZIP_FNAME 0x08 21 | #define GZIP_FCOMMENT 0x10 22 | #define GZIP_FRESERVED 0xE0 23 | 24 | #define GZIP_MTIME_UNAVAILABLE 0 25 | 26 | #define GZIP_XFL_SLOWEST_COMRESSION 0x02 27 | #define GZIP_XFL_FASTEST_COMRESSION 0x04 28 | 29 | #define GZIP_OS_FAT 0 30 | #define GZIP_OS_AMIGA 1 31 | #define GZIP_OS_VMS 2 32 | #define GZIP_OS_UNIX 3 33 | #define GZIP_OS_VM_CMS 4 34 | #define GZIP_OS_ATARI_TOS 5 35 | #define GZIP_OS_HPFS 6 36 | #define GZIP_OS_MACINTOSH 7 37 | #define GZIP_OS_Z_SYSTEM 8 38 | #define GZIP_OS_CP_M 9 39 | #define GZIP_OS_TOPS_20 10 40 | #define GZIP_OS_NTFS 11 41 | #define GZIP_OS_QDOS 12 42 | #define GZIP_OS_RISCOS 13 43 | #define GZIP_OS_UNKNOWN 255 44 | 45 | #endif /* LIB_GZIP_CONSTANTS_H */ 46 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/lib/lib_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * lib_common.h - internal header included by all library code 3 | */ 4 | 5 | #ifndef LIB_LIB_COMMON_H 6 | #define LIB_LIB_COMMON_H 7 | 8 | #ifdef LIBDEFLATE_H 9 | # error "lib_common.h must always be included before libdeflate.h" 10 | /* because BUILDING_LIBDEFLATE must be set first */ 11 | #endif 12 | 13 | #define BUILDING_LIBDEFLATE 14 | 15 | #include "common_defs.h" 16 | 17 | /* 18 | * Prefix with "_libdeflate_" all global symbols which are not part of the API. 19 | * This avoids exposing overly generic names when libdeflate is built as a 20 | * static library. 21 | * 22 | * Note that the chosen prefix is not really important and can be changed 23 | * without breaking library users. It was just chosen so that the resulting 24 | * symbol names are unlikely to conflict with those from any other software. 25 | * Also note that this fixup has no useful effect when libdeflate is built as a 26 | * shared library, since these symbols are not exported. 27 | */ 28 | #define SYM_FIXUP(sym) _libdeflate_##sym 29 | #define aligned_malloc SYM_FIXUP(aligned_malloc) 30 | #define aligned_free SYM_FIXUP(aligned_free) 31 | #define deflate_get_compression_level SYM_FIXUP(deflate_get_compression_level) 32 | #define _cpu_features SYM_FIXUP(_cpu_features) 33 | #define setup_cpu_features SYM_FIXUP(setup_cpu_features) 34 | 35 | #endif /* LIB_LIB_COMMON_H */ 36 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/lib/zlib_constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * zlib_constants.h - constants for the zlib wrapper format 3 | */ 4 | 5 | #ifndef LIB_ZLIB_CONSTANTS_H 6 | #define LIB_ZLIB_CONSTANTS_H 7 | 8 | #define ZLIB_MIN_HEADER_SIZE 2 9 | #define ZLIB_FOOTER_SIZE 4 10 | #define ZLIB_MIN_OVERHEAD (ZLIB_MIN_HEADER_SIZE + ZLIB_FOOTER_SIZE) 11 | 12 | #define ZLIB_CM_DEFLATE 8 13 | 14 | #define ZLIB_CINFO_32K_WINDOW 7 15 | 16 | #define ZLIB_FASTEST_COMPRESSION 0 17 | #define ZLIB_FAST_COMPRESSION 1 18 | #define ZLIB_DEFAULT_COMPRESSION 2 19 | #define ZLIB_SLOWEST_COMPRESSION 3 20 | 21 | #endif /* LIB_ZLIB_CONSTANTS_H */ 22 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/libdeflate.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.757 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdeflate", "libdeflate.vcxproj", "{2A3F22C4-D534-497B-82FC-F92A634FB20F}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {2A3F22C4-D534-497B-82FC-F92A634FB20F}.Debug|x64.ActiveCfg = Debug|x64 17 | {2A3F22C4-D534-497B-82FC-F92A634FB20F}.Debug|x64.Build.0 = Debug|x64 18 | {2A3F22C4-D534-497B-82FC-F92A634FB20F}.Debug|x86.ActiveCfg = Debug|Win32 19 | {2A3F22C4-D534-497B-82FC-F92A634FB20F}.Debug|x86.Build.0 = Debug|Win32 20 | {2A3F22C4-D534-497B-82FC-F92A634FB20F}.Release|x64.ActiveCfg = Release|x64 21 | {2A3F22C4-D534-497B-82FC-F92A634FB20F}.Release|x64.Build.0 = Release|x64 22 | {2A3F22C4-D534-497B-82FC-F92A634FB20F}.Release|x86.ActiveCfg = Release|Win32 23 | {2A3F22C4-D534-497B-82FC-F92A634FB20F}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {E8D67C60-5110-4391-B1C6-6E508D3DB8F1} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/programs/detect.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -z "$CC" ]; then 4 | CC=cc 5 | fi 6 | 7 | echo "/* THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. */" 8 | echo "#ifndef CONFIG_H" 9 | echo "#define CONFIG_H" 10 | 11 | tmpfile="$(mktemp -t libdeflate_config.XXXXXXXX)" 12 | trap "rm -f \"$tmpfile\"" EXIT 13 | 14 | program_compiles() { 15 | echo "$1" > "$tmpfile" 16 | $CC $CFLAGS -x c "$tmpfile" -o /dev/null > /dev/null 2>&1 17 | } 18 | 19 | check_function() { 20 | funcname="$1" 21 | macro="HAVE_$(echo $funcname | tr a-z A-Z)" 22 | echo 23 | echo "/* Is the $funcname() function available? */" 24 | if program_compiles "int main() { $funcname(); }"; then 25 | echo "#define $macro 1" 26 | else 27 | echo "/* $macro is not set */" 28 | fi 29 | } 30 | 31 | have_stat_field() { 32 | program_compiles "#include 33 | #include 34 | int main() { struct stat st; st.$1; }" 35 | } 36 | 37 | check_stat_nanosecond_precision() { 38 | echo 39 | echo "/* Does stat() provide nanosecond-precision timestamps? */" 40 | if have_stat_field st_atim; then 41 | echo "#define HAVE_STAT_NANOSECOND_PRECISION 1" 42 | elif have_stat_field st_atimespec; then 43 | # Nonstandard field names used by OS X and older BSDs 44 | echo "#define HAVE_STAT_NANOSECOND_PRECISION 1" 45 | echo "#define st_atim st_atimespec" 46 | echo "#define st_mtim st_mtimespec" 47 | echo "#define st_ctim st_ctimespec" 48 | else 49 | echo "/* HAVE_STAT_NANOSECOND_PRECISION is not set */" 50 | fi 51 | } 52 | 53 | check_function clock_gettime 54 | check_function futimens 55 | check_function futimes 56 | check_function posix_fadvise 57 | check_function posix_madvise 58 | 59 | check_stat_nanosecond_precision 60 | 61 | echo 62 | echo "#endif /* CONFIG_H */" 63 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/tools/afl-fuzz/Makefile: -------------------------------------------------------------------------------- 1 | SRC := $(wildcard */*.c) 2 | EXE := $(SRC:.c=) 3 | 4 | CFLAGS := -O2 -s 5 | LDLIBS := -ldeflate 6 | LDFLAGS := -L../.. 7 | CPPFLAGS := -I../.. 8 | 9 | all:$(EXE) 10 | 11 | clean: 12 | rm -f $(EXE) 13 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/tools/afl-fuzz/deflate_compress/fuzz.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | int main(int argc, char **argv) 9 | { 10 | struct libdeflate_decompressor *d; 11 | struct libdeflate_compressor *c; 12 | int ret; 13 | int fd = open(argv[1], O_RDONLY); 14 | struct stat stbuf; 15 | assert(fd >= 0); 16 | ret = fstat(fd, &stbuf); 17 | assert(!ret); 18 | 19 | char in[stbuf.st_size]; 20 | ret = read(fd, in, sizeof in); 21 | assert(ret == sizeof in); 22 | 23 | c = libdeflate_alloc_compressor(6); 24 | d = libdeflate_alloc_decompressor(); 25 | 26 | char out[sizeof(in)]; 27 | char checkarray[sizeof(in)]; 28 | 29 | size_t csize = libdeflate_deflate_compress(c, in,sizeof in, out, sizeof out); 30 | if (csize) { 31 | enum libdeflate_result res; 32 | res = libdeflate_deflate_decompress(d, out, csize, checkarray, sizeof in, NULL); 33 | assert(!res); 34 | assert(!memcmp(in, checkarray, sizeof in)); 35 | } 36 | 37 | libdeflate_free_compressor(c); 38 | libdeflate_free_decompressor(d); 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/tools/afl-fuzz/deflate_compress/inputs/0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Libraries/thirdparty/libdeflate/tools/afl-fuzz/deflate_compress/inputs/0 -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/tools/afl-fuzz/deflate_decompress/fuzz.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main(int argc, char **argv) 8 | { 9 | struct libdeflate_decompressor *d; 10 | int ret; 11 | int fd = open(argv[1], O_RDONLY); 12 | struct stat stbuf; 13 | assert(fd >= 0); 14 | ret = fstat(fd, &stbuf); 15 | assert(!ret); 16 | 17 | char in[stbuf.st_size]; 18 | ret = read(fd, in, sizeof in); 19 | assert(ret == sizeof in); 20 | 21 | char out[sizeof(in) * 3]; 22 | 23 | d = libdeflate_alloc_decompressor(); 24 | 25 | libdeflate_deflate_decompress(d, in, sizeof in, out, sizeof out, NULL); 26 | libdeflate_free_decompressor(d); 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/tools/afl-fuzz/deflate_decompress/inputs/0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Libraries/thirdparty/libdeflate/tools/afl-fuzz/deflate_decompress/inputs/0 -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/tools/afl-fuzz/gzip_decompress/fuzz.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main(int argc, char **argv) 8 | { 9 | struct libdeflate_decompressor *d; 10 | int ret; 11 | int fd = open(argv[1], O_RDONLY); 12 | struct stat stbuf; 13 | assert(fd >= 0); 14 | ret = fstat(fd, &stbuf); 15 | assert(!ret); 16 | 17 | char in[stbuf.st_size]; 18 | ret = read(fd, in, sizeof in); 19 | assert(ret == sizeof in); 20 | 21 | char out[sizeof(in) * 3]; 22 | 23 | d = libdeflate_alloc_decompressor(); 24 | 25 | libdeflate_gzip_decompress(d, in, sizeof in, out, sizeof out, NULL); 26 | libdeflate_free_decompressor(d); 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/tools/afl-fuzz/gzip_decompress/inputs/0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Libraries/thirdparty/libdeflate/tools/afl-fuzz/gzip_decompress/inputs/0 -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/tools/afl-fuzz/prepare_for_fuzz.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | make -C ../../ clean 6 | make clean 7 | AFL_HARDEN=1 make CC=afl-gcc -C ../../ 8 | AFL_HARDEN=1 make CC=afl-gcc 9 | 10 | for dir in $(find . -mindepth 1 -maxdepth 1 -type d); do 11 | rm -rf /tmp/$dir 12 | cp -va $dir /tmp/$dir 13 | mkdir -p /tmp/$dir/outputs 14 | done 15 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/tools/afl-fuzz/zlib_decompress/fuzz.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main(int argc, char **argv) 8 | { 9 | struct libdeflate_decompressor *d; 10 | int ret; 11 | int fd = open(argv[1], O_RDONLY); 12 | struct stat stbuf; 13 | assert(fd >= 0); 14 | ret = fstat(fd, &stbuf); 15 | assert(!ret); 16 | 17 | char in[stbuf.st_size]; 18 | ret = read(fd, in, sizeof in); 19 | assert(ret == sizeof in); 20 | 21 | char out[sizeof(in) * 3]; 22 | 23 | d = libdeflate_alloc_decompressor(); 24 | 25 | libdeflate_zlib_decompress(d, in, sizeof in, out, sizeof out, NULL); 26 | libdeflate_free_decompressor(d); 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/tools/afl-fuzz/zlib_decompress/inputs/0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Libraries/thirdparty/libdeflate/tools/afl-fuzz/zlib_decompress/inputs/0 -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/tools/exec_tests.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Helper script used by run_tests.sh, not intended to be run directly 3 | # 4 | 5 | set -eu 6 | 7 | run_cmd() { 8 | echo "$WRAPPER $@" 9 | $WRAPPER "$@" > /dev/null 10 | } 11 | 12 | for prog in ./test_*; do 13 | run_cmd $prog 14 | done 15 | 16 | for format in '' '-g' '-z'; do 17 | for ref_impl in '' '-Y' '-Z'; do 18 | run_cmd ./benchmark $format $ref_impl $SMOKEDATA 19 | done 20 | done 21 | for level in 1 3 7 9; do 22 | for ref_impl in '' '-Y'; do 23 | run_cmd ./benchmark -$level $ref_impl $SMOKEDATA 24 | done 25 | done 26 | for level in 1 3 7 9 12; do 27 | for ref_impl in '' '-Z'; do 28 | run_cmd ./benchmark -$level $ref_impl $SMOKEDATA 29 | done 30 | done 31 | 32 | echo "exec_tests finished successfully" # Needed for 'adb shell' 33 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/tools/make-windows-releases: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | 5 | for arch in 'i686' 'x86_64'; do 6 | make clean 7 | make -j CC=${arch}-w64-mingw32-gcc CFLAGS="-Werror" all \ 8 | benchmark.exe checksum.exe 9 | dir=libdeflate-$(git describe --tags | tr -d v)-windows-${arch}-bin 10 | rm -rf $dir ${dir}.zip 11 | mkdir $dir 12 | cp libdeflate.dll libdeflate.lib libdeflatestatic.lib \ 13 | libdeflate.h *.exe $dir 14 | ${arch}-w64-mingw32-strip ${dir}/libdeflate.dll ${dir}/*.exe 15 | for file in COPYING NEWS; do 16 | sed < $file > ${dir}/${file}.txt -e 's/$/\r/g' 17 | done 18 | for file in README.md; do 19 | sed < $file > ${dir}/${file} -e 's/$/\r/g' 20 | done 21 | (cd ${dir} && zip -r ../${dir}.zip .) 22 | done 23 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/tools/mips_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | 5 | TOOLCHAIN_DIR=$HOME/src/ddwrt-toolchains/toolchain-mips_34kc_gcc-5.1.0_musl-1.1.9 6 | 7 | make -j$(grep -c processor /proc/cpuinfo) all test_programs \ 8 | CC="$TOOLCHAIN_DIR/bin/mips-openwrt-linux-musl-gcc" \ 9 | CFLAGS="-DNEED_PRINTF -Werror" 10 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/tools/msc_test.bat: -------------------------------------------------------------------------------- 1 | nmake /f Makefile.msc clean 2 | nmake /f Makefile.msc 3 | copy /y *.exe j:\exe\ 4 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/tools/pgo_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Try gcc profile-guided optimizations 4 | 5 | set -eu 6 | 7 | MAKE="make -j$(grep -c processor /proc/cpuinfo)" 8 | DATAFILE="$HOME/data/silesia" 9 | 10 | $MAKE benchmark > /dev/null 11 | echo "=====================" 12 | echo "Original performance:" 13 | echo "---------------------" 14 | ./benchmark "$@" "$DATAFILE" 15 | 16 | $MAKE CFLAGS=-fprofile-generate LDFLAGS=-fprofile-generate benchmark > /dev/null 17 | ./benchmark "$@" "$DATAFILE" > /dev/null 18 | $MAKE CFLAGS=-fprofile-use benchmark > /dev/null 19 | rm -f {lib,programs}/*.gcda 20 | echo "==========================" 21 | echo "PGO-optimized performance:" 22 | echo "--------------------------" 23 | ./benchmark "$@" "$DATAFILE" 24 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/tools/produce_gzip_benchmark_table.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | do_benchmark() { 6 | usize=$(stat -c %s "$file") 7 | "$HOME/proj/libdeflate/benchmark" -g -s $usize "$@" "$file" \ 8 | | grep Compressed | cut -f 4 -d ' ' 9 | } 10 | 11 | echo "File | zlib -6 | zlib -9 | libdeflate -6 | libdeflate -9 | libdeflate -12" 12 | echo "-----|---------|---------|---------------|---------------|---------------" 13 | 14 | for file in "$@"; do 15 | echo -n "$(basename "$file")" 16 | results=() 17 | results+=($(do_benchmark -Y -6)) 18 | results+=($(do_benchmark -Y -9)) 19 | results+=($(do_benchmark -6)) 20 | results+=($(do_benchmark -9)) 21 | results+=($(do_benchmark -12)) 22 | best=2000000000 23 | for result in "${results[@]}"; do 24 | if (( result < best)); then 25 | best=$result 26 | fi 27 | done 28 | for result in "${results[@]}"; do 29 | if (( result == best )); then 30 | em="**" 31 | else 32 | em="" 33 | fi 34 | echo -n " | ${em}${result}${em}" 35 | done 36 | echo 37 | done 38 | -------------------------------------------------------------------------------- /Libraries/thirdparty/libdeflate/tools/windows_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | 5 | make -j CC=i686-w64-mingw32-gcc all test_programs 6 | cp -vf *.exe /j/exe/ 7 | make -j CC=x86_64-w64-mingw32-gcc all test_programs 8 | cp -vf *.exe /j/exe64/ 9 | 10 | sudo $HOME/bin/sudo/restart-smbd 11 | -------------------------------------------------------------------------------- /Libraries/thirdparty/zlib/contrib/README.contrib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/Libraries/thirdparty/zlib/contrib/README.contrib -------------------------------------------------------------------------------- /Libraries/thirdparty/zlib/contrib/asm686/README.686: -------------------------------------------------------------------------------- 1 | This is a patched version of zlib, modified to use 2 | Pentium-Pro-optimized assembly code in the deflation algorithm. The 3 | files changed/added by this patch are: 4 | 5 | README.686 6 | match.S 7 | 8 | The speedup that this patch provides varies, depending on whether the 9 | compiler used to build the original version of zlib falls afoul of the 10 | PPro's speed traps. My own tests show a speedup of around 10-20% at 11 | the default compression level, and 20-30% using -9, against a version 12 | compiled using gcc 2.7.2.3. Your mileage may vary. 13 | 14 | Note that this code has been tailored for the PPro/PII in particular, 15 | and will not perform particuarly well on a Pentium. 16 | 17 | If you are using an assembler other than GNU as, you will have to 18 | translate match.S to use your assembler's syntax. (Have fun.) 19 | 20 | Brian Raiter 21 | breadbox@muppetlabs.com 22 | April, 1998 23 | 24 | 25 | Added for zlib 1.1.3: 26 | 27 | The patches come from 28 | http://www.muppetlabs.com/~breadbox/software/assembly.html 29 | 30 | To compile zlib with this asm file, copy match.S to the zlib directory 31 | then do: 32 | 33 | CFLAGS="-O3 -DASMV" ./configure 34 | make OBJA=match.o 35 | 36 | 37 | Update: 38 | 39 | I've been ignoring these assembly routines for years, believing that 40 | gcc's generated code had caught up with it sometime around gcc 2.95 41 | and the major rearchitecting of the Pentium 4. However, I recently 42 | learned that, despite what I believed, this code still has some life 43 | in it. On the Pentium 4 and AMD64 chips, it continues to run about 8% 44 | faster than the code produced by gcc 4.1. 45 | 46 | In acknowledgement of its continuing usefulness, I've altered the 47 | license to match that of the rest of zlib. Share and Enjoy! 48 | 49 | Brian Raiter 50 | breadbox@muppetlabs.com 51 | April, 2007 52 | -------------------------------------------------------------------------------- /Libraries/thirdparty/zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /Libraries/thirdparty/zlib/uncompr.c: -------------------------------------------------------------------------------- 1 | /* uncompr.c -- decompress a memory buffer 2 | * Copyright (C) 1995-2003, 2010 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Decompresses the source buffer into the destination buffer. sourceLen is 13 | the byte length of the source buffer. Upon entry, destLen is the total 14 | size of the destination buffer, which must be large enough to hold the 15 | entire uncompressed data. (The size of the uncompressed data must have 16 | been saved previously by the compressor and transmitted to the decompressor 17 | by some mechanism outside the scope of this compression library.) 18 | Upon exit, destLen is the actual size of the compressed buffer. 19 | 20 | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not 21 | enough memory, Z_BUF_ERROR if there was not enough room in the output 22 | buffer, or Z_DATA_ERROR if the input data was corrupted. 23 | */ 24 | int ZEXPORT uncompress (dest, destLen, source, sourceLen) 25 | Bytef *dest; 26 | uLongf *destLen; 27 | const Bytef *source; 28 | uLong sourceLen; 29 | { 30 | z_stream stream; 31 | int err; 32 | 33 | stream.next_in = (z_const Bytef *)source; 34 | stream.avail_in = (uInt)sourceLen; 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | 45 | err = inflateInit(&stream); 46 | if (err != Z_OK) return err; 47 | 48 | err = inflate(&stream, Z_FINISH); 49 | if (err != Z_STREAM_END) { 50 | inflateEnd(&stream); 51 | if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) 52 | return Z_DATA_ERROR; 53 | return err; 54 | } 55 | *destLen = stream.total_out; 56 | 57 | err = inflateEnd(&stream); 58 | return err; 59 | } 60 | -------------------------------------------------------------------------------- /Libraries/thread-pool/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /Libraries/thread-pool/CITATION.bib: -------------------------------------------------------------------------------- 1 | @article{Shoshany2021_ThreadPool, 2 | archiveprefix = {arXiv}, 3 | author = {Barak Shoshany}, 4 | doi = {10.5281/zenodo.4742687}, 5 | eid = {arXiv:2105.00613}, 6 | eprint = {2105.00613}, 7 | journal = {arXiv e-prints}, 8 | keywords = {Computer Science - Distributed, Parallel, and Cluster Computing, D.1.3, D.1.5}, 9 | month = {May}, 10 | primaryclass = {cs.DC}, 11 | title = {{A C++17 Thread Pool for High-Performance Scientific Computing}}, 12 | year = {2021} 13 | } 14 | -------------------------------------------------------------------------------- /Libraries/thread-pool/CITATION.cff: -------------------------------------------------------------------------------- 1 | --- 2 | authors: 3 | - family-names: "Shoshany" 4 | given-names: "Barak" 5 | orcid: "https://orcid.org/0000-0003-2222-127X" 6 | cff-version: "1.2.0" 7 | date-released: "2021-05-03" 8 | doi: "10.5281/zenodo.4742687" 9 | license: "MIT" 10 | message: "If you use this package in published research, please cite it as follows." 11 | repository-code: "https://github.com/bshoshany/thread-pool" 12 | title: "A C++17 Thread Pool for High-Performance Scientific Computing" 13 | preferred-citation: 14 | type: "article" 15 | authors: 16 | - family-names: "Shoshany" 17 | given-names: "Barak" 18 | orcid: "https://orcid.org/0000-0003-2222-127X" 19 | doi: "10.5281/zenodo.4742687" 20 | journal: "arXiv" 21 | month: 5 22 | title: "A C++17 Thread Pool for High-Performance Scientific Computing" 23 | url: "https://arxiv.org/abs/2105.00613" 24 | year: 2021 25 | -------------------------------------------------------------------------------- /Libraries/thread-pool/LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Barak Shoshany 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /PckDll/DictHash/DictHash.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/DictHash/DictHash.cpp -------------------------------------------------------------------------------- /PckDll/DictHash/DictHash.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/DictHash/DictHash.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckAlgorithmId.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckAlgorithmId.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckAlgorithmId.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckAlgorithmId.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckClass.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClass.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckClass.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClass.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassAppendFiles.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassAppendFiles.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassBaseFeatures.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassBaseFeatures.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassBaseFeatures.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassBaseFeatures.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassCodepage.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassCodepage.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassCodepage.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassCodepage.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassExtract.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassExtract.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassFileDisk.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassFileDisk.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassFileDisk.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassFileDisk.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassHeadTail.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "PckClassHeadTail.h" 3 | 4 | CPckClassHeadTail::CPckClassHeadTail() 5 | {} 6 | 7 | CPckClassHeadTail::~CPckClassHeadTail() 8 | { 9 | Logger->trace(std::source_location::current().function_name()); 10 | } 11 | 12 | 13 | const char * CPckClassHeadTail::GetAdditionalInfo() 14 | { 15 | return m_PckAllInfo.szAdditionalInfo; 16 | } 17 | 18 | BOOL CPckClassHeadTail::SetAdditionalInfo(const char* lpszAdditionalInfo) 19 | { 20 | memcpy(m_PckAllInfo.szAdditionalInfo, lpszAdditionalInfo, PCK_ADDITIONAL_INFO_SIZE); 21 | 22 | if(0 == *m_PckAllInfo.szFilename) 23 | return FALSE; 24 | 25 | CMapViewFileMultiPckWrite cWritefile(m_PckAllInfo.lpSaveAsPckVerFunc->cPckXorKeys.dwMaxSinglePckSize); 26 | 27 | if(NULL == strstr(m_PckAllInfo.szAdditionalInfo, PCK_ADDITIONAL_KEY)) { 28 | strcpy(m_PckAllInfo.szAdditionalInfo, PCK_ADDITIONAL_INFO); 29 | } 30 | 31 | if(!cWritefile.OpenPck(m_PckAllInfo.szFilename, OPEN_EXISTING)) { 32 | Logger_el(UCSTEXT(TEXT_OPENWRITENAME_FAIL), m_PckAllInfo.szFilename); 33 | return FALSE; 34 | } 35 | 36 | cWritefile.SetFilePointer(-((QWORD)(m_PckAllInfo.lpSaveAsPckVerFunc->dwTailSize)), FILE_END); 37 | 38 | if(!cWritefile.Write( 39 | m_PckAllInfo.lpSaveAsPckVerFunc->FillTailData(&m_PckAllInfo), 40 | m_PckAllInfo.lpSaveAsPckVerFunc->dwTailSize)) { 41 | 42 | Logger_el(TEXT_WRITEFILE_FAIL); 43 | return FALSE; 44 | } 45 | 46 | return TRUE; 47 | } 48 | -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassHeadTail.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassHeadTail.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassHeadTailWriter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassHeadTailWriter.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassHeadTailWriter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "PckClassHeadTail.h" 3 | 4 | class CPckClassHeadTailWriter : 5 | public virtual CPckClassHeadTail 6 | { 7 | public: 8 | CPckClassHeadTailWriter(); 9 | ~CPckClassHeadTailWriter(); 10 | 11 | protected: 12 | 13 | BOOL WriteHeadAndTail(CMapViewFileMultiPckWrite *lpWrite, LPPCK_ALL_INFOS PckAllInfo, QWORD &dwAddress, BOOL isRenewAddtional = TRUE); 14 | 15 | 16 | }; 17 | -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassIndex.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassIndex.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassIndex.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassIndex.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassIndexRead.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassIndexRead.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassIndexWriter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassIndexWriter.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassIndexWriter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "PckClassNode.h" 3 | 4 | class CPckClassIndexWriter : 5 | public virtual CPckClassNode 6 | { 7 | public: 8 | CPckClassIndexWriter(); 9 | ~CPckClassIndexWriter(); 10 | 11 | protected: 12 | BOOL WriteAllIndex(CMapViewFileMultiPckWrite *lpWrite, LPPCK_ALL_INFOS lpPckAllInfo, QWORD &dwAddress); 13 | 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassLog.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassLog.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassLog.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassLog.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassMount.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassMount.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassNode.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassNode.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassNode.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassNode.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassRebuild.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassRebuild.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassRebuildFilter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassRebuildFilter.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassRebuildFilter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassRebuildFilter.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassRenamer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassRenamer.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassVersionDetect.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassVersionDetect.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassVersionDetect.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassVersionDetect.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassVersionFillDataTemplate.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassVersionFillDataTemplate.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassWriteOperator.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassWriteOperator.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassZlib.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassZlib.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckClassZlib.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckClassZlib.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckDefines.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckDefines.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckHeader.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckHeader.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckIndexCache.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "PckIndexCache.h" 3 | #include "pck_default_vars.h" 4 | 5 | CPckMemoryCache::CPckMemoryCache() : 6 | usedsize(0), 7 | poolsize(0), 8 | buffer(NULL) 9 | { 10 | } 11 | 12 | CPckMemoryCache::~CPckMemoryCache() 13 | { 14 | if (NULL != buffer) 15 | free(buffer); 16 | } 17 | 18 | BOOL CPckMemoryCache::expand(size_t addsize) 19 | { 20 | size_t newsize = (usedsize + addsize) < (poolsize + _INIT_SIZE_) ? (poolsize + _INIT_SIZE_) : (usedsize + addsize + _INIT_SIZE_); 21 | 22 | char* newbuffer = (char*)realloc(buffer, newsize); 23 | 24 | if (NULL != newbuffer) { 25 | poolsize = newsize; 26 | buffer = newbuffer; 27 | } 28 | else { 29 | 30 | if (NULL != (newbuffer = (char*)malloc(newsize))) { 31 | 32 | memcpy(newbuffer, buffer, poolsize); 33 | free(buffer); 34 | poolsize = newsize; 35 | buffer = newbuffer; 36 | } 37 | else { 38 | throw std::bad_alloc(); 39 | } 40 | } 41 | return TRUE; 42 | } 43 | 44 | BOOL CPckMemoryCache::add(const void* buf, size_t size) 45 | { 46 | if (0 != size) { 47 | 48 | if (poolsize < (usedsize + size)) { 49 | expand(size); 50 | } 51 | memcpy(buffer + usedsize, buf, size); 52 | usedsize += size; 53 | } 54 | 55 | return TRUE; 56 | } 57 | 58 | size_t CPckMemoryCache::size() 59 | { 60 | return usedsize; 61 | } 62 | 63 | const void* CPckMemoryCache::c_buffer() 64 | { 65 | return buffer; 66 | } -------------------------------------------------------------------------------- /PckDll/PckClass/PckIndexCache.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pck_default_vars.h" 3 | 4 | #define _INIT_SIZE_ (10 * 1024 * 1024) 5 | 6 | class CPckMemoryCache 7 | { 8 | public: 9 | CPckMemoryCache(); 10 | ~CPckMemoryCache(); 11 | 12 | BOOL add(const void* buf, size_t size); 13 | size_t size(); 14 | const void* c_buffer(); 15 | 16 | private: 17 | 18 | char *buffer; 19 | size_t usedsize, poolsize; 20 | 21 | BOOL expand(size_t addsize); 22 | 23 | }; 24 | 25 | -------------------------------------------------------------------------------- /PckDll/PckClass/PckModelStrip.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckModelStrip.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckModelStrip.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define _STRIP_ECM_ 0 4 | 5 | #include "PckStructs.h" 6 | #include "PckModelStripDefines.h" 7 | 8 | class CPckModelStrip 9 | { 10 | public: 11 | CPckModelStrip(); 12 | ~CPckModelStrip(); 13 | 14 | BOOL StripContent(BYTE* buffer, LPPCKFILEINDEX lpFileIndex, int flag); 15 | 16 | private: 17 | 18 | int GetFileTypeByName(const wchar_t* lpszFilename); 19 | BOOL StripAtt(BYTE* buffer, LPPCKFILEINDEX lpFileIndex); 20 | BOOL StripGfx(BYTE* buffer, LPPCKFILEINDEX lpFileIndex); 21 | #if _STRIP_ECM_ 22 | BOOL StripEcm(BYTE* buffer, LPPCKFILEINDEX lpFileIndex); 23 | #endif 24 | }; 25 | 26 | -------------------------------------------------------------------------------- /PckDll/PckClass/PckModelStripDefines.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckModelStripDefines.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckStructs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckStructs.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckThreadRunner.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckThreadRunner.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckThreadRunner.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckThreadRunner.h -------------------------------------------------------------------------------- /PckDll/PckClass/PckThreadRunnerData.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckThreadRunnerData.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckThreadRunnerMemory.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckThreadRunnerMemory.cpp -------------------------------------------------------------------------------- /PckDll/PckClass/PckThreadRunnerQueue.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckClass/PckThreadRunnerQueue.cpp -------------------------------------------------------------------------------- /PckDll/PckControlCenter/PckControlCenter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckControlCenter/PckControlCenter.cpp -------------------------------------------------------------------------------- /PckDll/PckControlCenter/PckControlCenter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckControlCenter/PckControlCenter.h -------------------------------------------------------------------------------- /PckDll/PckControlCenter/PckControlCenterAttribute.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckControlCenter/PckControlCenterAttribute.cpp -------------------------------------------------------------------------------- /PckDll/PckControlCenter/PckControlCenterInterface.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckControlCenter/PckControlCenterInterface.cpp -------------------------------------------------------------------------------- /PckDll/PckControlCenter/PckControlCenterOperation.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckControlCenter/PckControlCenterOperation.cpp -------------------------------------------------------------------------------- /PckDll/PckControlCenter/PckControlCenterParams.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/PckControlCenter/PckControlCenterParams.cpp -------------------------------------------------------------------------------- /PckDll/ZupClass/ZupClass.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/ZupClass/ZupClass.cpp -------------------------------------------------------------------------------- /PckDll/ZupClass/ZupClass.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/ZupClass/ZupClass.h -------------------------------------------------------------------------------- /PckDll/ZupClass/ZupClassExtract.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/ZupClass/ZupClassExtract.cpp -------------------------------------------------------------------------------- /PckDll/ZupClass/ZupClassFunction.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/ZupClass/ZupClassFunction.cpp -------------------------------------------------------------------------------- /PckDll/ZupClass/ZupHeader.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/ZupClass/ZupHeader.h -------------------------------------------------------------------------------- /PckDll/icons/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/icons/Thumbs.db -------------------------------------------------------------------------------- /PckDll/icons/chinaz1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/icons/chinaz1.png -------------------------------------------------------------------------------- /PckDll/icons/chinaz1x.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/icons/chinaz1x.ico -------------------------------------------------------------------------------- /PckDll/icons/filefind.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/icons/filefind.ico -------------------------------------------------------------------------------- /PckDll/icons/logerror.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/icons/logerror.png -------------------------------------------------------------------------------- /PckDll/icons/loginfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/icons/loginfo.png -------------------------------------------------------------------------------- /PckDll/icons/logwarning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/icons/logwarning.png -------------------------------------------------------------------------------- /PckDll/include/compiler.h: -------------------------------------------------------------------------------- 1 | #ifndef _COMPILER_H_ 2 | #define _COMPILER_H_ 3 | 4 | #ifdef __GNUC__ 5 | # include "compiler_gcc.h" 6 | #elif defined(_MSC_VER) 7 | # include "compiler_msc.h" 8 | #else 9 | # pragma message("Unrecognized compiler. Please add a header file for your compiler. Compilation will proceed, but performance may suffer!") 10 | #endif 11 | 12 | #include /* size_t */ 13 | 14 | #ifndef __bool_true_false_are_defined 15 | # include /* bool */ 16 | #endif 17 | 18 | /* Fixed-width integer types */ 19 | #ifndef PRIu32 20 | # include 21 | #endif 22 | 23 | //#include 24 | #include 25 | 26 | #ifdef _WIN32 27 | #include 28 | #define PATH_SEPERATOR "\\" 29 | #define MAX_PATH_LEN MAX_PATH 30 | #else 31 | //#include 32 | #define PATH_SEPERATOR "/" 33 | #define MAX_PATH_LEN PATH_MAX 34 | #endif 35 | 36 | 37 | //typedef unsigned __int64 QWORD, *LPQWORD; 38 | typedef unsigned long ulong_t; 39 | typedef int BOOL; 40 | //typedef unsigned char BYTE; 41 | //typedef unsigned short WORD; 42 | 43 | typedef const wchar_t * LPCWSTR; 44 | typedef wchar_t * LPWSTR; 45 | typedef const char * LPCSTR; 46 | typedef char * LPSTR; 47 | 48 | #ifndef TRUE 49 | #define TRUE 1 50 | #define FALSE 0 51 | #endif 52 | 53 | 54 | #if defined(_MSC_VER) 55 | #pragma warning(disable:4996) 56 | #pragma warning ( disable : 4005 ) 57 | #pragma warning ( disable : 4995 ) 58 | 59 | #else 60 | 61 | #define strcmpi strcasecmp 62 | #define stricmp strcasecmp 63 | #define strcpy_s strcpy 64 | #define strcat_s strcat 65 | //#if 0 66 | //#define sprintf_s(x,args...) snprintf((x), sizeof((x)),##args) 67 | //extern "C" char * strlwr(char *s); 68 | //#endif 69 | #endif 70 | 71 | 72 | #endif //_COMPILER_H_ -------------------------------------------------------------------------------- /PckDll/include/compiler_msc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * compiler_msc.h - definitions for the Microsoft C Compiler 3 | */ 4 | 5 | #define LIBEXPORT __declspec(dllexport) 6 | 7 | /* 8 | * Old versions (e.g. VS2010) of MSC don't have the C99 header stdbool.h. 9 | * Beware: the below replacement isn't fully standard, since normally any value 10 | * != 0 should be implicitly cast to a bool with value 1... but that doesn't 11 | * happen if bool is really just an 'int'. 12 | */ 13 | //typedef int bool; 14 | //#define true 1 15 | //#define false 0 16 | //#define __bool_true_false_are_defined 1 17 | 18 | /* Define ssize_t */ 19 | #ifdef _WIN64 20 | typedef long long ssize_t; 21 | #else 22 | typedef int ssize_t; 23 | #endif 24 | 25 | /* 26 | * Old versions (e.g. VS2010) of MSC have stdint.h but not the C99 header 27 | * inttypes.h. Work around this by defining the PRI* macros ourselves. 28 | */ 29 | //#include 30 | #include 31 | 32 | //add by stsm 33 | //#include "msvc_conf.h" 34 | //#include "fix_clang_emmintrin.h" 35 | 36 | #define PRIu8 "hhu" 37 | #define PRIu16 "hu" 38 | #define PRIu32 "u" 39 | #define PRIu64 "llu" 40 | #define PRIi8 "hhi" 41 | #define PRIi16 "hi" 42 | #define PRIi32 "i" 43 | #define PRIi64 "lli" 44 | #define PRIx8 "hhx" 45 | #define PRIx16 "hx" 46 | #define PRIx32 "x" 47 | #define PRIx64 "llx" 48 | 49 | /* Assume a little endian architecture with fast unaligned access */ 50 | #define CPU_IS_LITTLE_ENDIAN() 1 51 | #define UNALIGNED_ACCESS_IS_FAST 1 52 | 53 | /* __restrict has nonstandard behavior; don't use it */ 54 | #define restrict 55 | 56 | /* ... but we can use __inline and __forceinline */ 57 | #define inline __inline 58 | #define forceinline __forceinline 59 | 60 | /* Byte swap functions */ 61 | #define bswap16 _byteswap_ushort 62 | #define bswap32 _byteswap_ulong 63 | #define bswap64 _byteswap_uint64 64 | -------------------------------------------------------------------------------- /PckDll/include/gccException.h: -------------------------------------------------------------------------------- 1 | #ifndef _GCC_EXCEPTION_H 2 | #define _GCC_EXCEPTION_H 3 | 4 | #if defined(_MSC_VER) 5 | #include 6 | typedef std::exception MyException; 7 | 8 | #else 9 | #include 10 | class MyException : public std::exception 11 | { 12 | public: 13 | MyException() noexcept {} 14 | explicit MyException(const std::string& data) noexcept { buf = data; }; 15 | virtual ~MyException() noexcept {}; 16 | virtual char const* what() const { return buf.c_str(); }; 17 | private: 18 | std::string buf; 19 | }; 20 | #endif 21 | 22 | #define __ExceptionWithLine(msg, file, func, line) MyException( ##msg " at: "##file ", function: " func ", line: "#line) 23 | #define _ExceptionWithLine(msg, file, func, line) __ExceptionWithLine(msg, file, func, line) 24 | #define MyExceptionEx(msg) _ExceptionWithLine(msg, __FILE__, __FUNCTION__, __LINE__) 25 | 26 | class detectversion_error : public std::exception { // base of all generic_error exceptions 27 | public: 28 | explicit detectversion_error(const char* prefix, const std::string& _Message) { buf.assign(prefix); buf.append(_Message); } 29 | explicit detectversion_error(const char* prefix, const char* _Message) { buf.assign(prefix); buf.append(_Message); } 30 | explicit detectversion_error(const std::string& _Message) { buf = _Message; } 31 | explicit detectversion_error(const char* _Message) { buf.assign(_Message); } 32 | 33 | virtual char const* what() const override { return buf.c_str(); }; 34 | 35 | protected: 36 | std::string buf; 37 | }; 38 | 39 | 40 | #endif //_GCC_EXCEPTION_H 41 | -------------------------------------------------------------------------------- /PckDll/include/msvc_conf.h: -------------------------------------------------------------------------------- 1 | #include 2 | #define COMPILER_SUPPORTS_TARGET_FUNCTION_ATTRIBUTE 1 3 | #define __SSE2__ 1 4 | #define _aligned_attribute 5 | 6 | //#define COMPILER_SUPPORTS_AVX_TARGET 1 7 | //#define COMPILER_SUPPORTS_AVX2_TARGET 1 8 | //#define COMPILER_SUPPORTS_TARGET_INTRINSICS 1 9 | 10 | 11 | -------------------------------------------------------------------------------- /PckDll/include/pck_default_vars.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/include/pck_default_vars.h -------------------------------------------------------------------------------- /PckDll/include/pck_dependencies.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/include/pck_dependencies.h -------------------------------------------------------------------------------- /PckDll/include/pck_handle.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/include/pck_handle.h -------------------------------------------------------------------------------- /PckDll/pch.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | CLogger& Logger = CLogger::GetInstance(CLogger::LOGGER_TYPE::CONSOLE_ONLY); 5 | -------------------------------------------------------------------------------- /PckDll/pch.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/pch.h -------------------------------------------------------------------------------- /PckDll/pckdll.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/pckdll.rc -------------------------------------------------------------------------------- /PckDll/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/resource.h -------------------------------------------------------------------------------- /PckDll/src/pck_handle.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/PckDll/src/pck_handle.cpp -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WinPCK 2 | 完美世界公司游戏的pck文件压缩包查看器 3 | 4 | 目前支持的游戏版本有:诛仙、完美世界、圣斗士、笑傲江湖、神魔、热舞派对、口袋西游、梦想新大陆 5 | -------------------------------------------------------------------------------- /WinPCK/MenuButtonFuncs.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/MenuButtonFuncs.cpp -------------------------------------------------------------------------------- /WinPCK/ShowLogOnDlgListView.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/ShowLogOnDlgListView.cpp -------------------------------------------------------------------------------- /WinPCK/ShowLogOnDlgListView.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/ShowLogOnDlgListView.h -------------------------------------------------------------------------------- /WinPCK/WinPCK.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/WinPCK.rc -------------------------------------------------------------------------------- /WinPCK/X86-64.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | WinPCK archiver 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | true 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /WinPCK/globals.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/globals.h -------------------------------------------------------------------------------- /WinPCK/guipch.cpp: -------------------------------------------------------------------------------- 1 | #include "guipch.h" 2 | 3 | #pragma comment(lib,"comctl32.lib") 4 | -------------------------------------------------------------------------------- /WinPCK/guipch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | //#include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | namespace fs = std::filesystem; 23 | 24 | #include 25 | 26 | //#include 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #include "globals.h" 36 | #include "resource.h" 37 | 38 | #include "pck_handle.h" 39 | 40 | #include "tlib.h" 41 | 42 | #include 43 | #include 44 | 45 | #include 46 | #include 47 | 48 | 49 | -------------------------------------------------------------------------------- /WinPCK/guirelated.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/guirelated.cpp -------------------------------------------------------------------------------- /WinPCK/helpfunc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/helpfunc.cpp -------------------------------------------------------------------------------- /WinPCK/icons/DROP.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/DROP.cur -------------------------------------------------------------------------------- /WinPCK/icons/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/Thumbs.db -------------------------------------------------------------------------------- /WinPCK/icons/chinaz1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/chinaz1.ico -------------------------------------------------------------------------------- /WinPCK/icons/chinaz1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/chinaz1.png -------------------------------------------------------------------------------- /WinPCK/icons/chinaz1x.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/chinaz1x.ico -------------------------------------------------------------------------------- /WinPCK/icons/dir.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/dir.ico -------------------------------------------------------------------------------- /WinPCK/icons/edit.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/edit.ico -------------------------------------------------------------------------------- /WinPCK/icons/edit_add.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/edit_add.ico -------------------------------------------------------------------------------- /WinPCK/icons/exit.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/exit.ico -------------------------------------------------------------------------------- /WinPCK/icons/file.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/file.ico -------------------------------------------------------------------------------- /WinPCK/icons/fileclose.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/fileclose.ico -------------------------------------------------------------------------------- /WinPCK/icons/filenew.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/filenew.ico -------------------------------------------------------------------------------- /WinPCK/icons/fileopen.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/fileopen.ico -------------------------------------------------------------------------------- /WinPCK/icons/filesave.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/filesave.ico -------------------------------------------------------------------------------- /WinPCK/icons/icon2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/icon2.ico -------------------------------------------------------------------------------- /WinPCK/icons/info.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/info.ico -------------------------------------------------------------------------------- /WinPCK/icons/lin_agt_wrench.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/lin_agt_wrench.ico -------------------------------------------------------------------------------- /WinPCK/icons/logdebug.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/logdebug.ico -------------------------------------------------------------------------------- /WinPCK/icons/logerror.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/logerror.ico -------------------------------------------------------------------------------- /WinPCK/icons/logerror.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/logerror.png -------------------------------------------------------------------------------- /WinPCK/icons/loginfo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/loginfo.ico -------------------------------------------------------------------------------- /WinPCK/icons/loginfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/loginfo.png -------------------------------------------------------------------------------- /WinPCK/icons/logwarning.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/logwarning.ico -------------------------------------------------------------------------------- /WinPCK/icons/logwarning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/logwarning.png -------------------------------------------------------------------------------- /WinPCK/icons/rebuild.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/rebuild.ico -------------------------------------------------------------------------------- /WinPCK/icons/save_all.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/save_all.ico -------------------------------------------------------------------------------- /WinPCK/icons/search.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/search.ico -------------------------------------------------------------------------------- /WinPCK/icons/stop.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/stop.ico -------------------------------------------------------------------------------- /WinPCK/icons/stripsave.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/icons/stripsave.ico -------------------------------------------------------------------------------- /WinPCK/listViewFunc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/listViewFunc.cpp -------------------------------------------------------------------------------- /WinPCK/loggerGuiSink.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "spdlog/sinks/base_sink.h" 3 | 4 | template 5 | class my_sink : public spdlog::sinks::base_sink 6 | { 7 | ... 8 | protected: 9 | void sink_it_(const spdlog::details::log_msg& msg) override 10 | { 11 | 12 | // log_msg is a struct containing the log entry info like level, timestamp, thread id etc. 13 | // msg.raw contains pre formatted log 14 | 15 | // If needed (very likely but not mandatory), the sink formats the message before sending it to its final destination: 16 | spdlog::memory_buf_t formatted; 17 | spdlog::sinks::base_sink::formatter_->format(msg, formatted); 18 | std::cout << fmt::to_string(formatted); 19 | } 20 | 21 | void flush_() override 22 | { 23 | std::cout << std::flush; 24 | } 25 | }; 26 | 27 | #include "spdlog/details/null_mutex.h" 28 | #include 29 | using my_sink_mt = my_sink; 30 | using my_sink_st = my_sink; 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /WinPCK/mainControlStatus.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/mainControlStatus.cpp -------------------------------------------------------------------------------- /WinPCK/mainfunc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/mainfunc.cpp -------------------------------------------------------------------------------- /WinPCK/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/resource.h -------------------------------------------------------------------------------- /WinPCK/tAttrDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/tAttrDlg.cpp -------------------------------------------------------------------------------- /WinPCK/tAttrDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TAttrDlg : public TDlg 4 | { 5 | protected: 6 | const PCK_UNIFIED_FILE_ENTRY* lpPckInfo; 7 | 8 | wchar_t* lpszPath; 9 | 10 | public: 11 | TAttrDlg(const PCK_UNIFIED_FILE_ENTRY* _lpPckInfo, wchar_t* _lpszPath, TWin* _win); 12 | //~TAttrDlg(); 13 | 14 | virtual BOOL EvCommand(WORD wNotifyCode, WORD wID, LPARAM hwndCtl) override; 15 | virtual BOOL EvCreate(LPARAM lParam) override; 16 | }; 17 | 18 | -------------------------------------------------------------------------------- /WinPCK/tCompressOptDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/tCompressOptDlg.cpp -------------------------------------------------------------------------------- /WinPCK/tCompressOptDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TCompressOptDlg : public TDlg 4 | { 5 | public: 6 | TCompressOptDlg(TWin* _win) : TDlg(IDD_DIALOG_COMPRESS, _win) { } 7 | 8 | virtual BOOL EvCommand(WORD wNotifyCode, WORD wID, LPARAM hwndCtl) override; 9 | virtual BOOL EvCreate(LPARAM lParam) override; 10 | virtual BOOL EventScroll(UINT uMsg, int nCode, int nPos, HWND scrollBar) override; 11 | }; 12 | -------------------------------------------------------------------------------- /WinPCK/tInfoDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/tInfoDlg.cpp -------------------------------------------------------------------------------- /WinPCK/tInfoDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TInfoDlg : public TDlg 4 | { 5 | public: 6 | TInfoDlg(TWin* _win) : TDlg(IDD_DIALOG_INFO, _win) {} 7 | virtual BOOL EvCommand(WORD wNotifyCode, WORD wID, LPARAM hwndCtl) override; 8 | virtual BOOL EvCreate(LPARAM lParam) override; 9 | 10 | private: 11 | void set_additional_info(); 12 | }; -------------------------------------------------------------------------------- /WinPCK/tLogDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/tLogDlg.cpp -------------------------------------------------------------------------------- /WinPCK/tLogDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "resource.h" 3 | 4 | class TLogDlg : public TDlg 5 | { 6 | private: 7 | 8 | #if 0 9 | HWND hWndList; 10 | wchar_t szExePath[MAX_PATH]; 11 | 12 | int m_LogListCount = 0; 13 | 14 | wchar_t* pszLogFileName(); 15 | wchar_t* pszTargetListLog(int iItem); 16 | 17 | int m_iCurrentHotItem; 18 | const char m_szLogPrefix[6] = { 'N', 'I', 'W', 'E', 'D', ' ' }; 19 | 20 | int log_level_char_to_int(const char level); 21 | void _InsertLogIntoList(const char, const wchar_t *); 22 | #endif 23 | 24 | public: 25 | TLogDlg(TWin *_win) : TDlg(IDD_DIALOG_LOG, _win) { } 26 | 27 | virtual BOOL EvCommand(WORD wNotifyCode, WORD wID, LPARAM hwndCtl); 28 | virtual BOOL EvCreate(LPARAM lParam); 29 | virtual BOOL EvSize(UINT fwSizeType, WORD nWidth, WORD nHeight); 30 | virtual BOOL EvClose(); 31 | //virtual BOOL EvNotify(UINT ctlID, NMHDR *pNmHdr); 32 | #if 0 33 | void InsertLogToList(const char, const wchar_t *); 34 | #endif 35 | }; 36 | -------------------------------------------------------------------------------- /WinPCK/tPicDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/tPicDlg.cpp -------------------------------------------------------------------------------- /WinPCK/tPreviewDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/tPreviewDlg.cpp -------------------------------------------------------------------------------- /WinPCK/tPreviewDlg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/tPreviewDlg.h -------------------------------------------------------------------------------- /WinPCK/tRebuildOptDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/tRebuildOptDlg.cpp -------------------------------------------------------------------------------- /WinPCK/tRebuildOptDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TRebuildOptDlg : public TDlg 4 | { 5 | private: 6 | 7 | std::wstring szScriptFile = std::wstring(MAX_PATH, '\x0'); 8 | BOOL* lpNeedRecompress; 9 | TCHAR* lpszScriptFile; 10 | public: 11 | TRebuildOptDlg(TCHAR* _lpszScriptFile, BOOL* _lpNeedRecompress, TWin* _win) : 12 | TDlg(IDD_DIALOG_REBUILD_OPT, _win), 13 | lpNeedRecompress(_lpNeedRecompress), 14 | isScriptParseSuccess(FALSE), 15 | lpszScriptFile(_lpszScriptFile) 16 | { 17 | } 18 | 19 | 20 | virtual BOOL EvCommand(WORD wNotifyCode, WORD wID, LPARAM hwndCtl) override; 21 | virtual BOOL EvCreate(LPARAM lParam) override; 22 | virtual BOOL EventScroll(UINT uMsg, int nCode, int nPos, HWND scrollBar) override; 23 | virtual BOOL EvDropFiles(HDROP hDrop) override; 24 | 25 | private: 26 | 27 | void OnOK(); 28 | BOOL OnOpenClick(); 29 | BOOL isScriptParseSuccess; 30 | BOOL ParseScript(); 31 | }; 32 | -------------------------------------------------------------------------------- /WinPCK/tSearchDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/tSearchDlg.cpp -------------------------------------------------------------------------------- /WinPCK/tSearchDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TSearchDlg : public TDlg 4 | { 5 | protected: 6 | wchar_t* dirBuf; 7 | 8 | public: 9 | TSearchDlg(wchar_t* _dirBuf, TWin* _win) : TDlg(IDD_DIALOG_SEARCH, _win) { dirBuf = _dirBuf; } 10 | virtual BOOL EvCommand(WORD wNotifyCode, WORD wID, LPARAM hwndCtl) override; 11 | virtual BOOL EvCreate(LPARAM lParam) override; 12 | }; 13 | -------------------------------------------------------------------------------- /WinPCK/tStripDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/tStripDlg.cpp -------------------------------------------------------------------------------- /WinPCK/tStripDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //#include "resource.h" 4 | 5 | class TStripDlg : public TDlg 6 | { 7 | private: 8 | 9 | int *pStripFlag; 10 | 11 | public: 12 | TStripDlg(int *_pStripFlag, TWin *_win) : 13 | TDlg(IDD_DIALOG_STRIP, _win), 14 | pStripFlag(_pStripFlag) 15 | {} 16 | 17 | virtual BOOL EvCommand(WORD wNotifyCode, WORD wID, LPARAM hwndCtl) override; 18 | virtual BOOL EvCreate(LPARAM lParam) override; 19 | 20 | private: 21 | void OnOK(); 22 | }; 23 | 24 | -------------------------------------------------------------------------------- /WinPCK/tViewDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/tViewDlg.cpp -------------------------------------------------------------------------------- /WinPCK/threadproc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/threadproc.cpp -------------------------------------------------------------------------------- /WinPCK/winmain.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/winmain.cpp -------------------------------------------------------------------------------- /WinPCK/winmain.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/WinPCK/winmain.h -------------------------------------------------------------------------------- /dlltester/dlltester.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/dlltester/dlltester.cpp -------------------------------------------------------------------------------- /dlltester/dlltester.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 头文件 20 | 21 | 22 | 头文件 23 | 24 | 25 | 26 | 27 | 源文件 28 | 29 | 30 | 源文件 31 | 32 | 33 | -------------------------------------------------------------------------------- /dlltester/pch.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/dlltester/pch.cpp -------------------------------------------------------------------------------- /dlltester/pch.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/dlltester/pch.h -------------------------------------------------------------------------------- /logger/spdlog/INSTALL: -------------------------------------------------------------------------------- 1 | Header only version: 2 | ================================================================== 3 | Just copy the files to your build tree and use a C++11 compiler. 4 | Or use CMake: 5 | add_executable(example_header_only example.cpp) 6 | target_link_libraries(example_header_only spdlog::spdlog_header_only) 7 | 8 | 9 | Compiled library version: 10 | ================================================================== 11 | CMake: 12 | add_executable(example example.cpp) 13 | target_link_libraries(example spdlog::spdlog) 14 | 15 | Or copy files src/*.cpp to your build tree and pass the -DSPDLOG_COMPILED_LIB to the compiler. 16 | 17 | Tested on: 18 | gcc 4.8.1 and above 19 | clang 3.5 20 | Visual Studio 2013 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/cfg/argv.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | #include 6 | #include 7 | 8 | // 9 | // Init log levels using each argv entry that starts with "SPDLOG_LEVEL=" 10 | // 11 | // set all loggers to debug level: 12 | // example.exe "SPDLOG_LEVEL=debug" 13 | 14 | // set logger1 to trace level 15 | // example.exe "SPDLOG_LEVEL=logger1=trace" 16 | 17 | // turn off all logging except for logger1 and logger2: 18 | // example.exe "SPDLOG_LEVEL=off,logger1=debug,logger2=info" 19 | 20 | namespace spdlog { 21 | namespace cfg { 22 | 23 | // search for SPDLOG_LEVEL= in the args and use it to init the levels 24 | inline void load_argv_levels(int argc, const char **argv) 25 | { 26 | const std::string spdlog_level_prefix = "SPDLOG_LEVEL="; 27 | for (int i = 1; i < argc; i++) 28 | { 29 | std::string arg = argv[i]; 30 | if (arg.find(spdlog_level_prefix) == 0) 31 | { 32 | auto levels_string = arg.substr(spdlog_level_prefix.size()); 33 | helpers::load_levels(levels_string); 34 | } 35 | } 36 | } 37 | 38 | inline void load_argv_levels(int argc, char **argv) 39 | { 40 | load_argv_levels(argc, const_cast(argv)); 41 | } 42 | 43 | } // namespace cfg 44 | } // namespace spdlog 45 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/cfg/env.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | #include 6 | #include 7 | #include 8 | 9 | // 10 | // Init levels and patterns from env variables SPDLOG_LEVEL 11 | // Inspired from Rust's "env_logger" crate (https://crates.io/crates/env_logger). 12 | // Note - fallback to "info" level on unrecognized levels 13 | // 14 | // Examples: 15 | // 16 | // set global level to debug: 17 | // export SPDLOG_LEVEL=debug 18 | // 19 | // turn off all logging except for logger1: 20 | // export SPDLOG_LEVEL="*=off,logger1=debug" 21 | // 22 | 23 | // turn off all logging except for logger1 and logger2: 24 | // export SPDLOG_LEVEL="off,logger1=debug,logger2=info" 25 | 26 | namespace spdlog { 27 | namespace cfg { 28 | inline void load_env_levels() 29 | { 30 | auto env_val = details::os::getenv("SPDLOG_LEVEL"); 31 | if (!env_val.empty()) 32 | { 33 | helpers::load_levels(env_val); 34 | } 35 | } 36 | 37 | } // namespace cfg 38 | } // namespace spdlog 39 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/cfg/helpers.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | namespace cfg { 11 | namespace helpers { 12 | // 13 | // Init levels from given string 14 | // 15 | // Examples: 16 | // 17 | // set global level to debug: "debug" 18 | // turn off all logging except for logger1: "off,logger1=debug" 19 | // turn off all logging except for logger1 and logger2: "off,logger1=debug,logger2=info" 20 | // 21 | SPDLOG_API void load_levels(const std::string &txt); 22 | } // namespace helpers 23 | 24 | } // namespace cfg 25 | } // namespace spdlog 26 | 27 | #ifdef SPDLOG_HEADER_ONLY 28 | # include "helpers-inl.h" 29 | #endif // SPDLOG_HEADER_ONLY 30 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/common-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | # include 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | namespace spdlog { 14 | namespace level { 15 | 16 | #if __cplusplus >= 201703L 17 | constexpr 18 | #endif 19 | static string_view_t level_string_views[] SPDLOG_LEVEL_NAMES; 20 | 21 | static const char *short_level_names[] SPDLOG_SHORT_LEVEL_NAMES; 22 | 23 | SPDLOG_INLINE const string_view_t &to_string_view(spdlog::level::level_enum l) SPDLOG_NOEXCEPT 24 | { 25 | return level_string_views[l]; 26 | } 27 | 28 | SPDLOG_INLINE const char *to_short_c_str(spdlog::level::level_enum l) SPDLOG_NOEXCEPT 29 | { 30 | return short_level_names[l]; 31 | } 32 | 33 | SPDLOG_INLINE spdlog::level::level_enum from_str(const std::string &name) SPDLOG_NOEXCEPT 34 | { 35 | auto it = std::find(std::begin(level_string_views), std::end(level_string_views), name); 36 | if (it != std::end(level_string_views)) 37 | return static_cast(std::distance(std::begin(level_string_views), it)); 38 | 39 | // check also for "warn" and "err" before giving up.. 40 | if (name == "warn") 41 | { 42 | return level::warn; 43 | } 44 | if (name == "err") 45 | { 46 | return level::err; 47 | } 48 | return level::off; 49 | } 50 | } // namespace level 51 | 52 | SPDLOG_INLINE spdlog_ex::spdlog_ex(std::string msg) 53 | : msg_(std::move(msg)) 54 | {} 55 | 56 | SPDLOG_INLINE spdlog_ex::spdlog_ex(const std::string &msg, int last_errno) 57 | { 58 | #ifdef SPDLOG_USE_STD_FORMAT 59 | msg_ = std::system_error(std::error_code(last_errno, std::generic_category()), msg).what(); 60 | #else 61 | memory_buf_t outbuf; 62 | fmt::format_system_error(outbuf, last_errno, msg.c_str()); 63 | msg_ = fmt::to_string(outbuf); 64 | #endif 65 | } 66 | 67 | SPDLOG_INLINE const char *spdlog_ex::what() const SPDLOG_NOEXCEPT 68 | { 69 | return msg_.c_str(); 70 | } 71 | 72 | SPDLOG_INLINE void throw_spdlog_ex(const std::string &msg, int last_errno) 73 | { 74 | SPDLOG_THROW(spdlog_ex(msg, last_errno)); 75 | } 76 | 77 | SPDLOG_INLINE void throw_spdlog_ex(std::string msg) 78 | { 79 | SPDLOG_THROW(spdlog_ex(std::move(msg))); 80 | } 81 | 82 | } // namespace spdlog 83 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/details/backtracer-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | # include 8 | #endif 9 | namespace spdlog { 10 | namespace details { 11 | SPDLOG_INLINE backtracer::backtracer(const backtracer &other) 12 | { 13 | std::lock_guard lock(other.mutex_); 14 | enabled_ = other.enabled(); 15 | messages_ = other.messages_; 16 | } 17 | 18 | SPDLOG_INLINE backtracer::backtracer(backtracer &&other) SPDLOG_NOEXCEPT 19 | { 20 | std::lock_guard lock(other.mutex_); 21 | enabled_ = other.enabled(); 22 | messages_ = std::move(other.messages_); 23 | } 24 | 25 | SPDLOG_INLINE backtracer &backtracer::operator=(backtracer other) 26 | { 27 | std::lock_guard lock(mutex_); 28 | enabled_ = other.enabled(); 29 | messages_ = std::move(other.messages_); 30 | return *this; 31 | } 32 | 33 | SPDLOG_INLINE void backtracer::enable(size_t size) 34 | { 35 | std::lock_guard lock{mutex_}; 36 | enabled_.store(true, std::memory_order_relaxed); 37 | messages_ = circular_q{size}; 38 | } 39 | 40 | SPDLOG_INLINE void backtracer::disable() 41 | { 42 | std::lock_guard lock{mutex_}; 43 | enabled_.store(false, std::memory_order_relaxed); 44 | } 45 | 46 | SPDLOG_INLINE bool backtracer::enabled() const 47 | { 48 | return enabled_.load(std::memory_order_relaxed); 49 | } 50 | 51 | SPDLOG_INLINE void backtracer::push_back(const log_msg &msg) 52 | { 53 | std::lock_guard lock{mutex_}; 54 | messages_.push_back(log_msg_buffer{msg}); 55 | } 56 | 57 | SPDLOG_INLINE bool backtracer::empty() const 58 | { 59 | std::lock_guard lock{mutex_}; 60 | return messages_.empty(); 61 | } 62 | 63 | // pop all items in the q and apply the given fun on each of them. 64 | SPDLOG_INLINE void backtracer::foreach_pop(std::function fun) 65 | { 66 | std::lock_guard lock{mutex_}; 67 | while (!messages_.empty()) 68 | { 69 | auto &front_msg = messages_.front(); 70 | fun(front_msg); 71 | messages_.pop_front(); 72 | } 73 | } 74 | } // namespace details 75 | } // namespace spdlog 76 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/details/backtracer.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | // Store log messages in circular buffer. 14 | // Useful for storing debug data in case of error/warning happens. 15 | 16 | namespace spdlog { 17 | namespace details { 18 | class SPDLOG_API backtracer 19 | { 20 | mutable std::mutex mutex_; 21 | std::atomic enabled_{false}; 22 | circular_q messages_; 23 | 24 | public: 25 | backtracer() = default; 26 | backtracer(const backtracer &other); 27 | 28 | backtracer(backtracer &&other) SPDLOG_NOEXCEPT; 29 | backtracer &operator=(backtracer other); 30 | 31 | void enable(size_t size); 32 | void disable(); 33 | bool enabled() const; 34 | void push_back(const log_msg &msg); 35 | bool empty() const; 36 | 37 | // pop all items in the q and apply the given fun on each of them. 38 | void foreach_pop(std::function fun); 39 | }; 40 | 41 | } // namespace details 42 | } // namespace spdlog 43 | 44 | #ifdef SPDLOG_HEADER_ONLY 45 | # include "backtracer-inl.h" 46 | #endif 47 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/details/console_globals.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | namespace details { 11 | 12 | struct console_mutex 13 | { 14 | using mutex_t = std::mutex; 15 | static mutex_t &mutex() 16 | { 17 | static mutex_t s_mutex; 18 | return s_mutex; 19 | } 20 | }; 21 | 22 | struct console_nullmutex 23 | { 24 | using mutex_t = null_mutex; 25 | static mutex_t &mutex() 26 | { 27 | static mutex_t s_mutex; 28 | return s_mutex; 29 | } 30 | }; 31 | } // namespace details 32 | } // namespace spdlog 33 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/details/file_helper.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | namespace details { 11 | 12 | // Helper class for file sinks. 13 | // When failing to open a file, retry several times(5) with a delay interval(10 ms). 14 | // Throw spdlog_ex exception on errors. 15 | 16 | class SPDLOG_API file_helper 17 | { 18 | public: 19 | file_helper() = default; 20 | explicit file_helper(const file_event_handlers &event_handlers); 21 | 22 | file_helper(const file_helper &) = delete; 23 | file_helper &operator=(const file_helper &) = delete; 24 | ~file_helper(); 25 | 26 | void open(const filename_t &fname, bool truncate = false); 27 | void reopen(bool truncate); 28 | void flush(); 29 | void sync(); 30 | void close(); 31 | void write(const memory_buf_t &buf); 32 | size_t size() const; 33 | const filename_t &filename() const; 34 | 35 | // 36 | // return file path and its extension: 37 | // 38 | // "mylog.txt" => ("mylog", ".txt") 39 | // "mylog" => ("mylog", "") 40 | // "mylog." => ("mylog.", "") 41 | // "/dir1/dir2/mylog.txt" => ("/dir1/dir2/mylog", ".txt") 42 | // 43 | // the starting dot in filenames is ignored (hidden files): 44 | // 45 | // ".mylog" => (".mylog". "") 46 | // "my_folder/.mylog" => ("my_folder/.mylog", "") 47 | // "my_folder/.mylog.txt" => ("my_folder/.mylog", ".txt") 48 | static std::tuple split_by_extension(const filename_t &fname); 49 | 50 | private: 51 | const int open_tries_ = 5; 52 | const unsigned int open_interval_ = 10; 53 | std::FILE *fd_{nullptr}; 54 | filename_t filename_; 55 | file_event_handlers event_handlers_; 56 | }; 57 | } // namespace details 58 | } // namespace spdlog 59 | 60 | #ifdef SPDLOG_HEADER_ONLY 61 | # include "file_helper-inl.h" 62 | #endif 63 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/details/log_msg-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | # include 8 | #endif 9 | 10 | #include 11 | 12 | namespace spdlog { 13 | namespace details { 14 | 15 | SPDLOG_INLINE log_msg::log_msg(spdlog::log_clock::time_point log_time, spdlog::source_loc loc, string_view_t a_logger_name, 16 | spdlog::level::level_enum lvl, spdlog::string_view_t msg) 17 | : logger_name(a_logger_name) 18 | , level(lvl) 19 | , time(log_time) 20 | #ifndef SPDLOG_NO_THREAD_ID 21 | , thread_id(os::thread_id()) 22 | #endif 23 | , source(loc) 24 | , payload(msg) 25 | {} 26 | 27 | SPDLOG_INLINE log_msg::log_msg( 28 | spdlog::source_loc loc, string_view_t a_logger_name, spdlog::level::level_enum lvl, spdlog::string_view_t msg) 29 | : log_msg(os::now(), loc, a_logger_name, lvl, msg) 30 | {} 31 | 32 | SPDLOG_INLINE log_msg::log_msg(string_view_t a_logger_name, spdlog::level::level_enum lvl, spdlog::string_view_t msg) 33 | : log_msg(os::now(), source_loc{}, a_logger_name, lvl, msg) 34 | {} 35 | 36 | } // namespace details 37 | } // namespace spdlog 38 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/details/log_msg.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | namespace details { 11 | struct SPDLOG_API log_msg 12 | { 13 | log_msg() = default; 14 | log_msg(log_clock::time_point log_time, source_loc loc, string_view_t logger_name, level::level_enum lvl, string_view_t msg); 15 | log_msg(source_loc loc, string_view_t logger_name, level::level_enum lvl, string_view_t msg); 16 | log_msg(string_view_t logger_name, level::level_enum lvl, string_view_t msg); 17 | log_msg(const log_msg &other) = default; 18 | log_msg &operator=(const log_msg &other) = default; 19 | 20 | string_view_t logger_name; 21 | level::level_enum level{level::off}; 22 | log_clock::time_point time; 23 | size_t thread_id{0}; 24 | 25 | // wrapping the formatted text with color (updated by pattern_formatter). 26 | mutable size_t color_range_start{0}; 27 | mutable size_t color_range_end{0}; 28 | 29 | source_loc source; 30 | string_view_t payload; 31 | }; 32 | } // namespace details 33 | } // namespace spdlog 34 | 35 | #ifdef SPDLOG_HEADER_ONLY 36 | # include "log_msg-inl.h" 37 | #endif 38 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/details/log_msg_buffer-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | # include 8 | #endif 9 | 10 | namespace spdlog { 11 | namespace details { 12 | 13 | SPDLOG_INLINE log_msg_buffer::log_msg_buffer(const log_msg &orig_msg) 14 | : log_msg{orig_msg} 15 | { 16 | buffer.append(logger_name.begin(), logger_name.end()); 17 | buffer.append(payload.begin(), payload.end()); 18 | update_string_views(); 19 | } 20 | 21 | SPDLOG_INLINE log_msg_buffer::log_msg_buffer(const log_msg_buffer &other) 22 | : log_msg{other} 23 | { 24 | buffer.append(logger_name.begin(), logger_name.end()); 25 | buffer.append(payload.begin(), payload.end()); 26 | update_string_views(); 27 | } 28 | 29 | SPDLOG_INLINE log_msg_buffer::log_msg_buffer(log_msg_buffer &&other) SPDLOG_NOEXCEPT : log_msg{other}, buffer{std::move(other.buffer)} 30 | { 31 | update_string_views(); 32 | } 33 | 34 | SPDLOG_INLINE log_msg_buffer &log_msg_buffer::operator=(const log_msg_buffer &other) 35 | { 36 | log_msg::operator=(other); 37 | buffer.clear(); 38 | buffer.append(other.buffer.data(), other.buffer.data() + other.buffer.size()); 39 | update_string_views(); 40 | return *this; 41 | } 42 | 43 | SPDLOG_INLINE log_msg_buffer &log_msg_buffer::operator=(log_msg_buffer &&other) SPDLOG_NOEXCEPT 44 | { 45 | log_msg::operator=(other); 46 | buffer = std::move(other.buffer); 47 | update_string_views(); 48 | return *this; 49 | } 50 | 51 | SPDLOG_INLINE void log_msg_buffer::update_string_views() 52 | { 53 | logger_name = string_view_t{buffer.data(), logger_name.size()}; 54 | payload = string_view_t{buffer.data() + logger_name.size(), payload.size()}; 55 | } 56 | 57 | } // namespace details 58 | } // namespace spdlog 59 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/details/log_msg_buffer.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | namespace spdlog { 9 | namespace details { 10 | 11 | // Extend log_msg with internal buffer to store its payload. 12 | // This is needed since log_msg holds string_views that points to stack data. 13 | 14 | class SPDLOG_API log_msg_buffer : public log_msg 15 | { 16 | memory_buf_t buffer; 17 | void update_string_views(); 18 | 19 | public: 20 | log_msg_buffer() = default; 21 | explicit log_msg_buffer(const log_msg &orig_msg); 22 | log_msg_buffer(const log_msg_buffer &other); 23 | log_msg_buffer(log_msg_buffer &&other) SPDLOG_NOEXCEPT; 24 | log_msg_buffer &operator=(const log_msg_buffer &other); 25 | log_msg_buffer &operator=(log_msg_buffer &&other) SPDLOG_NOEXCEPT; 26 | }; 27 | 28 | } // namespace details 29 | } // namespace spdlog 30 | 31 | #ifdef SPDLOG_HEADER_ONLY 32 | # include "log_msg_buffer-inl.h" 33 | #endif 34 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/details/null_mutex.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | // null, no cost dummy "mutex" and dummy "atomic" int 9 | 10 | namespace spdlog { 11 | namespace details { 12 | struct null_mutex 13 | { 14 | void lock() const {} 15 | void unlock() const {} 16 | }; 17 | 18 | struct null_atomic_int 19 | { 20 | int value; 21 | null_atomic_int() = default; 22 | 23 | explicit null_atomic_int(int new_value) 24 | : value(new_value) 25 | {} 26 | 27 | int load(std::memory_order = std::memory_order_relaxed) const 28 | { 29 | return value; 30 | } 31 | 32 | void store(int new_value, std::memory_order = std::memory_order_relaxed) 33 | { 34 | value = new_value; 35 | } 36 | 37 | int exchange(int new_value, std::memory_order = std::memory_order_relaxed) 38 | { 39 | std::swap(new_value, value); 40 | return new_value; // return value before the call 41 | } 42 | }; 43 | 44 | } // namespace details 45 | } // namespace spdlog 46 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/details/periodic_worker-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | # include 8 | #endif 9 | 10 | namespace spdlog { 11 | namespace details { 12 | 13 | // stop the worker thread and join it 14 | SPDLOG_INLINE periodic_worker::~periodic_worker() 15 | { 16 | if (worker_thread_.joinable()) 17 | { 18 | { 19 | std::lock_guard lock(mutex_); 20 | active_ = false; 21 | } 22 | cv_.notify_one(); 23 | worker_thread_.join(); 24 | } 25 | } 26 | 27 | } // namespace details 28 | } // namespace spdlog 29 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/details/periodic_worker.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | // periodic worker thread - periodically executes the given callback function. 7 | // 8 | // RAII over the owned thread: 9 | // creates the thread on construction. 10 | // stops and joins the thread on destruction (if the thread is executing a callback, wait for it to finish first). 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | namespace spdlog { 18 | namespace details { 19 | 20 | class SPDLOG_API periodic_worker 21 | { 22 | public: 23 | template 24 | periodic_worker(const std::function &callback_fun, std::chrono::duration interval) 25 | { 26 | active_ = (interval > std::chrono::duration::zero()); 27 | if (!active_) 28 | { 29 | return; 30 | } 31 | 32 | worker_thread_ = std::thread([this, callback_fun, interval]() { 33 | for (;;) 34 | { 35 | std::unique_lock lock(this->mutex_); 36 | if (this->cv_.wait_for(lock, interval, [this] { return !this->active_; })) 37 | { 38 | return; // active_ == false, so exit this thread 39 | } 40 | callback_fun(); 41 | } 42 | }); 43 | } 44 | periodic_worker(const periodic_worker &) = delete; 45 | periodic_worker &operator=(const periodic_worker &) = delete; 46 | // stop the worker thread and join it 47 | ~periodic_worker(); 48 | 49 | private: 50 | bool active_; 51 | std::thread worker_thread_; 52 | std::mutex mutex_; 53 | std::condition_variable cv_; 54 | }; 55 | } // namespace details 56 | } // namespace spdlog 57 | 58 | #ifdef SPDLOG_HEADER_ONLY 59 | # include "periodic_worker-inl.h" 60 | #endif 61 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/details/synchronous_factory.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include "registry.h" 7 | 8 | namespace spdlog { 9 | 10 | // Default logger factory- creates synchronous loggers 11 | class logger; 12 | 13 | struct synchronous_factory 14 | { 15 | template 16 | static std::shared_ptr create(std::string logger_name, SinkArgs &&...args) 17 | { 18 | auto sink = std::make_shared(std::forward(args)...); 19 | auto new_logger = std::make_shared(std::move(logger_name), std::move(sink)); 20 | details::registry::instance().initialize_logger(new_logger); 21 | return new_logger; 22 | } 23 | }; 24 | } // namespace spdlog 25 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/details/windows_include.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef NOMINMAX 4 | # define NOMINMAX // prevent windows redefining min/max 5 | #endif 6 | 7 | #ifndef WIN32_LEAN_AND_MEAN 8 | # define WIN32_LEAN_AND_MEAN 9 | #endif 10 | 11 | #include 12 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/fmt/bundled/fmt.license.rst: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - present, Victor Zverovich 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | --- Optional exception to the license --- 23 | 24 | As an exception, if, as a result of your compiling your source code, portions 25 | of this Software are embedded into a machine-executable object form of such 26 | source code, you may redistribute such embedded portions in such object form 27 | without including the above copyright and permission notices. 28 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/fmt/bundled/locale.h: -------------------------------------------------------------------------------- 1 | #include "xchar.h" 2 | #warning fmt/locale.h is deprecated, include fmt/format.h or fmt/xchar.h instead 3 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/fmt/chrono.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's chrono support 9 | // 10 | 11 | #if !defined(SPDLOG_USE_STD_FORMAT) 12 | # if !defined(SPDLOG_FMT_EXTERNAL) 13 | # ifdef SPDLOG_HEADER_ONLY 14 | # ifndef FMT_HEADER_ONLY 15 | # define FMT_HEADER_ONLY 16 | # endif 17 | # endif 18 | # include 19 | # else 20 | # include 21 | # endif 22 | #endif 23 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/fmt/compile.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's compile-time support 9 | // 10 | 11 | #if !defined(SPDLOG_USE_STD_FORMAT) 12 | # if !defined(SPDLOG_FMT_EXTERNAL) 13 | # ifdef SPDLOG_HEADER_ONLY 14 | # ifndef FMT_HEADER_ONLY 15 | # define FMT_HEADER_ONLY 16 | # endif 17 | # endif 18 | # include 19 | # else 20 | # include 21 | # endif 22 | #endif 23 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/fmt/fmt.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016-2018 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | // 9 | // Include a bundled header-only copy of fmtlib or an external one. 10 | // By default spdlog include its own copy. 11 | // 12 | 13 | #if defined(SPDLOG_USE_STD_FORMAT) // SPDLOG_USE_STD_FORMAT is defined - use std::format 14 | # include 15 | #elif !defined(SPDLOG_FMT_EXTERNAL) 16 | # if !defined(SPDLOG_COMPILED_LIB) && !defined(FMT_HEADER_ONLY) 17 | # define FMT_HEADER_ONLY 18 | # endif 19 | # ifndef FMT_USE_WINDOWS_H 20 | # define FMT_USE_WINDOWS_H 0 21 | # endif 22 | // enable the 'n' flag in for backward compatibility with fmt 6.x 23 | # define FMT_DEPRECATED_N_SPECIFIER 24 | // enable ostream formatting for backward compatibility with fmt 8.x 25 | # define FMT_DEPRECATED_OSTREAM 26 | 27 | # include 28 | # include 29 | 30 | #else // SPDLOG_FMT_EXTERNAL is defined - use external fmtlib 31 | # include 32 | # include 33 | #endif 34 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/fmt/ostr.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's ostream support 9 | // 10 | 11 | #if !defined(SPDLOG_USE_STD_FORMAT) 12 | # if !defined(SPDLOG_FMT_EXTERNAL) 13 | # ifdef SPDLOG_HEADER_ONLY 14 | # ifndef FMT_HEADER_ONLY 15 | # define FMT_HEADER_ONLY 16 | # endif 17 | # endif 18 | # include 19 | # else 20 | # include 21 | # endif 22 | #endif 23 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/fmt/ranges.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's ranges support 9 | // 10 | 11 | #if !defined(SPDLOG_USE_STD_FORMAT) 12 | # if !defined(SPDLOG_FMT_EXTERNAL) 13 | # ifdef SPDLOG_HEADER_ONLY 14 | # ifndef FMT_HEADER_ONLY 15 | # define FMT_HEADER_ONLY 16 | # endif 17 | # endif 18 | # include 19 | # else 20 | # include 21 | # endif 22 | #endif 23 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/fmt/std.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's std support (for formatting e.g. std::filesystem::path, std::thread::id, std::monostate, 9 | // std::variant, ...) 10 | // 11 | 12 | #if !defined(SPDLOG_USE_STD_FORMAT) 13 | # if !defined(SPDLOG_FMT_EXTERNAL) 14 | # ifdef SPDLOG_HEADER_ONLY 15 | # ifndef FMT_HEADER_ONLY 16 | # define FMT_HEADER_ONLY 17 | # endif 18 | # endif 19 | # include 20 | # else 21 | # include 22 | # endif 23 | #endif 24 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/fmt/xchar.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's xchar support 9 | // 10 | 11 | #if !defined(SPDLOG_USE_STD_FORMAT) 12 | # if !defined(SPDLOG_FMT_EXTERNAL) 13 | # ifdef SPDLOG_HEADER_ONLY 14 | # ifndef FMT_HEADER_ONLY 15 | # define FMT_HEADER_ONLY 16 | # endif 17 | # endif 18 | # include 19 | # else 20 | # include 21 | # endif 22 | #endif 23 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/formatter.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | 11 | class formatter 12 | { 13 | public: 14 | virtual ~formatter() = default; 15 | virtual void format(const details::log_msg &msg, memory_buf_t &dest) = 0; 16 | virtual std::unique_ptr clone() const = 0; 17 | }; 18 | } // namespace spdlog 19 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/fwd.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | namespace spdlog { 7 | class logger; 8 | class formatter; 9 | 10 | namespace sinks { 11 | class sink; 12 | } 13 | 14 | namespace level { 15 | enum level_enum : int; 16 | } 17 | 18 | } // namespace spdlog 19 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/sinks/base_sink-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | # include 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | template 16 | SPDLOG_INLINE spdlog::sinks::base_sink::base_sink() 17 | : formatter_{details::make_unique()} 18 | {} 19 | 20 | template 21 | SPDLOG_INLINE spdlog::sinks::base_sink::base_sink(std::unique_ptr formatter) 22 | : formatter_{std::move(formatter)} 23 | {} 24 | 25 | template 26 | void SPDLOG_INLINE spdlog::sinks::base_sink::log(const details::log_msg &msg) 27 | { 28 | std::lock_guard lock(mutex_); 29 | sink_it_(msg); 30 | } 31 | 32 | template 33 | void SPDLOG_INLINE spdlog::sinks::base_sink::flush() 34 | { 35 | std::lock_guard lock(mutex_); 36 | flush_(); 37 | } 38 | 39 | template 40 | void SPDLOG_INLINE spdlog::sinks::base_sink::set_pattern(const std::string &pattern) 41 | { 42 | std::lock_guard lock(mutex_); 43 | set_pattern_(pattern); 44 | } 45 | 46 | template 47 | void SPDLOG_INLINE spdlog::sinks::base_sink::set_formatter(std::unique_ptr sink_formatter) 48 | { 49 | std::lock_guard lock(mutex_); 50 | set_formatter_(std::move(sink_formatter)); 51 | } 52 | 53 | template 54 | void SPDLOG_INLINE spdlog::sinks::base_sink::set_pattern_(const std::string &pattern) 55 | { 56 | set_formatter_(details::make_unique(pattern)); 57 | } 58 | 59 | template 60 | void SPDLOG_INLINE spdlog::sinks::base_sink::set_formatter_(std::unique_ptr sink_formatter) 61 | { 62 | formatter_ = std::move(sink_formatter); 63 | } 64 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/sinks/base_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | // 6 | // base sink templated over a mutex (either dummy or real) 7 | // concrete implementation should override the sink_it_() and flush_() methods. 8 | // locking is taken care of in this class - no locking needed by the 9 | // implementers.. 10 | // 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | namespace spdlog { 17 | namespace sinks { 18 | template 19 | class SPDLOG_API base_sink : public sink 20 | { 21 | public: 22 | base_sink(); 23 | explicit base_sink(std::unique_ptr formatter); 24 | ~base_sink() override = default; 25 | 26 | base_sink(const base_sink &) = delete; 27 | base_sink(base_sink &&) = delete; 28 | 29 | base_sink &operator=(const base_sink &) = delete; 30 | base_sink &operator=(base_sink &&) = delete; 31 | 32 | void log(const details::log_msg &msg) final; 33 | void flush() final; 34 | void set_pattern(const std::string &pattern) final; 35 | void set_formatter(std::unique_ptr sink_formatter) final; 36 | 37 | protected: 38 | // sink formatter 39 | std::unique_ptr formatter_; 40 | Mutex mutex_; 41 | 42 | virtual void sink_it_(const details::log_msg &msg) = 0; 43 | virtual void flush_() = 0; 44 | virtual void set_pattern_(const std::string &pattern); 45 | virtual void set_formatter_(std::unique_ptr sink_formatter); 46 | }; 47 | } // namespace sinks 48 | } // namespace spdlog 49 | 50 | #ifdef SPDLOG_HEADER_ONLY 51 | # include "base_sink-inl.h" 52 | #endif 53 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/sinks/basic_file_sink-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | # include 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | namespace spdlog { 14 | namespace sinks { 15 | 16 | template 17 | SPDLOG_INLINE basic_file_sink::basic_file_sink(const filename_t &filename, bool truncate, const file_event_handlers &event_handlers) 18 | : file_helper_{event_handlers} 19 | { 20 | file_helper_.open(filename, truncate); 21 | } 22 | 23 | template 24 | SPDLOG_INLINE const filename_t &basic_file_sink::filename() const 25 | { 26 | return file_helper_.filename(); 27 | } 28 | 29 | template 30 | SPDLOG_INLINE void basic_file_sink::sink_it_(const details::log_msg &msg) 31 | { 32 | memory_buf_t formatted; 33 | base_sink::formatter_->format(msg, formatted); 34 | file_helper_.write(formatted); 35 | } 36 | 37 | template 38 | SPDLOG_INLINE void basic_file_sink::flush_() 39 | { 40 | file_helper_.flush(); 41 | } 42 | 43 | } // namespace sinks 44 | } // namespace spdlog 45 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/sinks/basic_file_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | 14 | namespace spdlog { 15 | namespace sinks { 16 | /* 17 | * Trivial file sink with single file as target 18 | */ 19 | template 20 | class basic_file_sink final : public base_sink 21 | { 22 | public: 23 | explicit basic_file_sink(const filename_t &filename, bool truncate = false, const file_event_handlers &event_handlers = {}); 24 | const filename_t &filename() const; 25 | 26 | protected: 27 | void sink_it_(const details::log_msg &msg) override; 28 | void flush_() override; 29 | 30 | private: 31 | details::file_helper file_helper_; 32 | }; 33 | 34 | using basic_file_sink_mt = basic_file_sink; 35 | using basic_file_sink_st = basic_file_sink; 36 | 37 | } // namespace sinks 38 | 39 | // 40 | // factory functions 41 | // 42 | template 43 | inline std::shared_ptr basic_logger_mt( 44 | const std::string &logger_name, const filename_t &filename, bool truncate = false, const file_event_handlers &event_handlers = {}) 45 | { 46 | return Factory::template create(logger_name, filename, truncate, event_handlers); 47 | } 48 | 49 | template 50 | inline std::shared_ptr basic_logger_st( 51 | const std::string &logger_name, const filename_t &filename, bool truncate = false, const file_event_handlers &event_handlers = {}) 52 | { 53 | return Factory::template create(logger_name, filename, truncate, event_handlers); 54 | } 55 | 56 | } // namespace spdlog 57 | 58 | #ifdef SPDLOG_HEADER_ONLY 59 | # include "basic_file_sink-inl.h" 60 | #endif 61 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/sinks/callback_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | namespace spdlog { 14 | 15 | // callbacks type 16 | typedef std::function custom_log_callback; 17 | 18 | namespace sinks { 19 | /* 20 | * Trivial callback sink, gets a callback function and calls it on each log 21 | */ 22 | template 23 | class callback_sink final : public base_sink 24 | { 25 | public: 26 | explicit callback_sink(const custom_log_callback &callback) 27 | : callback_{callback} 28 | {} 29 | 30 | protected: 31 | void sink_it_(const details::log_msg &msg) override 32 | { 33 | callback_(msg); 34 | } 35 | void flush_() override{}; 36 | 37 | private: 38 | custom_log_callback callback_; 39 | }; 40 | 41 | using callback_sink_mt = callback_sink; 42 | using callback_sink_st = callback_sink; 43 | 44 | } // namespace sinks 45 | 46 | // 47 | // factory functions 48 | // 49 | template 50 | inline std::shared_ptr callback_logger_mt(const std::string &logger_name, const custom_log_callback &callback) 51 | { 52 | return Factory::template create(logger_name, callback); 53 | } 54 | 55 | template 56 | inline std::shared_ptr callback_logger_st(const std::string &logger_name, const custom_log_callback &callback) 57 | { 58 | return Factory::template create(logger_name, callback); 59 | } 60 | 61 | } // namespace spdlog 62 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/sinks/msvc_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2016 Alexander Dalshov & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #if defined(_WIN32) 7 | 8 | # include 9 | # if defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) 10 | # include 11 | # endif 12 | # include 13 | 14 | # include 15 | # include 16 | 17 | // Avoid including windows.h (https://stackoverflow.com/a/30741042) 18 | # if defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) 19 | extern "C" __declspec(dllimport) void __stdcall OutputDebugStringW(const wchar_t *lpOutputString); 20 | # else 21 | extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char *lpOutputString); 22 | # endif 23 | extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent(); 24 | 25 | namespace spdlog { 26 | namespace sinks { 27 | /* 28 | * MSVC sink (logging using OutputDebugStringA) 29 | */ 30 | template 31 | class msvc_sink : public base_sink 32 | { 33 | public: 34 | msvc_sink() = default; 35 | msvc_sink(bool check_debugger_present) 36 | : check_debugger_present_{check_debugger_present} {}; 37 | 38 | protected: 39 | void sink_it_(const details::log_msg &msg) override 40 | { 41 | if (check_debugger_present_ && !IsDebuggerPresent()) 42 | { 43 | return; 44 | } 45 | memory_buf_t formatted; 46 | base_sink::formatter_->format(msg, formatted); 47 | formatted.push_back('\0'); // add a null terminator for OutputDebugString 48 | # if defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) 49 | wmemory_buf_t wformatted; 50 | details::os::utf8_to_wstrbuf(string_view_t(formatted.data(), formatted.size()), wformatted); 51 | OutputDebugStringW(wformatted.data()); 52 | # else 53 | OutputDebugStringA(formatted.data()); 54 | # endif 55 | } 56 | 57 | void flush_() override {} 58 | 59 | bool check_debugger_present_ = true; 60 | }; 61 | 62 | using msvc_sink_mt = msvc_sink; 63 | using msvc_sink_st = msvc_sink; 64 | 65 | using windebug_sink_mt = msvc_sink_mt; 66 | using windebug_sink_st = msvc_sink_st; 67 | 68 | } // namespace sinks 69 | } // namespace spdlog 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/sinks/null_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | namespace spdlog { 13 | namespace sinks { 14 | 15 | template 16 | class null_sink : public base_sink 17 | { 18 | protected: 19 | void sink_it_(const details::log_msg &) override {} 20 | void flush_() override {} 21 | }; 22 | 23 | using null_sink_mt = null_sink; 24 | using null_sink_st = null_sink; 25 | 26 | } // namespace sinks 27 | 28 | template 29 | inline std::shared_ptr null_logger_mt(const std::string &logger_name) 30 | { 31 | auto null_logger = Factory::template create(logger_name); 32 | null_logger->set_level(level::off); 33 | return null_logger; 34 | } 35 | 36 | template 37 | inline std::shared_ptr null_logger_st(const std::string &logger_name) 38 | { 39 | auto null_logger = Factory::template create(logger_name); 40 | null_logger->set_level(level::off); 41 | return null_logger; 42 | } 43 | 44 | } // namespace spdlog 45 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/sinks/ostream_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | namespace spdlog { 13 | namespace sinks { 14 | template 15 | class ostream_sink final : public base_sink 16 | { 17 | public: 18 | explicit ostream_sink(std::ostream &os, bool force_flush = false) 19 | : ostream_(os) 20 | , force_flush_(force_flush) 21 | {} 22 | ostream_sink(const ostream_sink &) = delete; 23 | ostream_sink &operator=(const ostream_sink &) = delete; 24 | 25 | protected: 26 | void sink_it_(const details::log_msg &msg) override 27 | { 28 | memory_buf_t formatted; 29 | base_sink::formatter_->format(msg, formatted); 30 | ostream_.write(formatted.data(), static_cast(formatted.size())); 31 | if (force_flush_) 32 | { 33 | ostream_.flush(); 34 | } 35 | } 36 | 37 | void flush_() override 38 | { 39 | ostream_.flush(); 40 | } 41 | 42 | std::ostream &ostream_; 43 | bool force_flush_; 44 | }; 45 | 46 | using ostream_sink_mt = ostream_sink; 47 | using ostream_sink_st = ostream_sink; 48 | 49 | } // namespace sinks 50 | } // namespace spdlog 51 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/sinks/sink-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | # include 8 | #endif 9 | 10 | #include 11 | 12 | SPDLOG_INLINE bool spdlog::sinks::sink::should_log(spdlog::level::level_enum msg_level) const 13 | { 14 | return msg_level >= level_.load(std::memory_order_relaxed); 15 | } 16 | 17 | SPDLOG_INLINE void spdlog::sinks::sink::set_level(level::level_enum log_level) 18 | { 19 | level_.store(log_level, std::memory_order_relaxed); 20 | } 21 | 22 | SPDLOG_INLINE spdlog::level::level_enum spdlog::sinks::sink::level() const 23 | { 24 | return static_cast(level_.load(std::memory_order_relaxed)); 25 | } 26 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/sinks/sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | 11 | namespace sinks { 12 | class SPDLOG_API sink 13 | { 14 | public: 15 | virtual ~sink() = default; 16 | virtual void log(const details::log_msg &msg) = 0; 17 | virtual void flush() = 0; 18 | virtual void set_pattern(const std::string &pattern) = 0; 19 | virtual void set_formatter(std::unique_ptr sink_formatter) = 0; 20 | 21 | void set_level(level::level_enum log_level); 22 | level::level_enum level() const; 23 | bool should_log(level::level_enum msg_level) const; 24 | 25 | protected: 26 | // sink log level - default is all 27 | level_t level_{level::trace}; 28 | }; 29 | 30 | } // namespace sinks 31 | } // namespace spdlog 32 | 33 | #ifdef SPDLOG_HEADER_ONLY 34 | # include "sink-inl.h" 35 | #endif 36 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/sinks/stdout_color_sinks-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | # include 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | namespace spdlog { 14 | 15 | template 16 | SPDLOG_INLINE std::shared_ptr stdout_color_mt(const std::string &logger_name, color_mode mode) 17 | { 18 | return Factory::template create(logger_name, mode); 19 | } 20 | 21 | template 22 | SPDLOG_INLINE std::shared_ptr stdout_color_st(const std::string &logger_name, color_mode mode) 23 | { 24 | return Factory::template create(logger_name, mode); 25 | } 26 | 27 | template 28 | SPDLOG_INLINE std::shared_ptr stderr_color_mt(const std::string &logger_name, color_mode mode) 29 | { 30 | return Factory::template create(logger_name, mode); 31 | } 32 | 33 | template 34 | SPDLOG_INLINE std::shared_ptr stderr_color_st(const std::string &logger_name, color_mode mode) 35 | { 36 | return Factory::template create(logger_name, mode); 37 | } 38 | } // namespace spdlog 39 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/sinks/stdout_color_sinks.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifdef _WIN32 7 | # include 8 | #else 9 | # include 10 | #endif 11 | 12 | #include 13 | 14 | namespace spdlog { 15 | namespace sinks { 16 | #ifdef _WIN32 17 | using stdout_color_sink_mt = wincolor_stdout_sink_mt; 18 | using stdout_color_sink_st = wincolor_stdout_sink_st; 19 | using stderr_color_sink_mt = wincolor_stderr_sink_mt; 20 | using stderr_color_sink_st = wincolor_stderr_sink_st; 21 | #else 22 | using stdout_color_sink_mt = ansicolor_stdout_sink_mt; 23 | using stdout_color_sink_st = ansicolor_stdout_sink_st; 24 | using stderr_color_sink_mt = ansicolor_stderr_sink_mt; 25 | using stderr_color_sink_st = ansicolor_stderr_sink_st; 26 | #endif 27 | } // namespace sinks 28 | 29 | template 30 | std::shared_ptr stdout_color_mt(const std::string &logger_name, color_mode mode = color_mode::automatic); 31 | 32 | template 33 | std::shared_ptr stdout_color_st(const std::string &logger_name, color_mode mode = color_mode::automatic); 34 | 35 | template 36 | std::shared_ptr stderr_color_mt(const std::string &logger_name, color_mode mode = color_mode::automatic); 37 | 38 | template 39 | std::shared_ptr stderr_color_st(const std::string &logger_name, color_mode mode = color_mode::automatic); 40 | 41 | } // namespace spdlog 42 | 43 | #ifdef SPDLOG_HEADER_ONLY 44 | # include "stdout_color_sinks-inl.h" 45 | #endif 46 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/sinks/udp_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #ifdef _WIN32 10 | # include 11 | #else 12 | # include 13 | #endif 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | // Simple udp client sink 21 | // Sends formatted log via udp 22 | 23 | namespace spdlog { 24 | namespace sinks { 25 | 26 | struct udp_sink_config 27 | { 28 | std::string server_host; 29 | uint16_t server_port; 30 | 31 | udp_sink_config(std::string host, uint16_t port) 32 | : server_host{std::move(host)} 33 | , server_port{port} 34 | {} 35 | }; 36 | 37 | template 38 | class udp_sink : public spdlog::sinks::base_sink 39 | { 40 | public: 41 | // host can be hostname or ip address 42 | explicit udp_sink(udp_sink_config sink_config) 43 | : client_{sink_config.server_host, sink_config.server_port} 44 | {} 45 | 46 | ~udp_sink() override = default; 47 | 48 | protected: 49 | void sink_it_(const spdlog::details::log_msg &msg) override 50 | { 51 | spdlog::memory_buf_t formatted; 52 | spdlog::sinks::base_sink::formatter_->format(msg, formatted); 53 | client_.send(formatted.data(), formatted.size()); 54 | } 55 | 56 | void flush_() override {} 57 | details::udp_client client_; 58 | }; 59 | 60 | using udp_sink_mt = udp_sink; 61 | using udp_sink_st = udp_sink; 62 | 63 | } // namespace sinks 64 | 65 | // 66 | // factory functions 67 | // 68 | template 69 | inline std::shared_ptr udp_logger_mt(const std::string &logger_name, sinks::udp_sink_config skin_config) 70 | { 71 | return Factory::template create(logger_name, skin_config); 72 | } 73 | 74 | } // namespace spdlog 75 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/sinks/winedit_sinks.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/logger/spdlog/include/spdlog/sinks/winedit_sinks.h -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/stopwatch.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | // Stopwatch support for spdlog (using std::chrono::steady_clock). 10 | // Displays elapsed seconds since construction as double. 11 | // 12 | // Usage: 13 | // 14 | // spdlog::stopwatch sw; 15 | // ... 16 | // spdlog::debug("Elapsed: {} seconds", sw); => "Elapsed 0.005116733 seconds" 17 | // spdlog::info("Elapsed: {:.6} seconds", sw); => "Elapsed 0.005163 seconds" 18 | // 19 | // 20 | // If other units are needed (e.g. millis instead of double), include "fmt/chrono.h" and use "duration_cast<..>(sw.elapsed())": 21 | // 22 | // #include 23 | //.. 24 | // using std::chrono::duration_cast; 25 | // using std::chrono::milliseconds; 26 | // spdlog::info("Elapsed {}", duration_cast(sw.elapsed())); => "Elapsed 5ms" 27 | 28 | namespace spdlog { 29 | class stopwatch 30 | { 31 | using clock = std::chrono::steady_clock; 32 | std::chrono::time_point start_tp_; 33 | 34 | public: 35 | stopwatch() 36 | : start_tp_{clock::now()} 37 | {} 38 | 39 | std::chrono::duration elapsed() const 40 | { 41 | return std::chrono::duration(clock::now() - start_tp_); 42 | } 43 | 44 | void reset() 45 | { 46 | start_tp_ = clock::now(); 47 | } 48 | }; 49 | } // namespace spdlog 50 | 51 | // Support for fmt formatting (e.g. "{:012.9}" or just "{}") 52 | namespace 53 | #ifdef SPDLOG_USE_STD_FORMAT 54 | std 55 | #else 56 | fmt 57 | #endif 58 | { 59 | 60 | template<> 61 | struct formatter : formatter 62 | { 63 | template 64 | auto format(const spdlog::stopwatch &sw, FormatContext &ctx) const -> decltype(ctx.out()) 65 | { 66 | return formatter::format(sw.elapsed().count(), ctx); 67 | } 68 | }; 69 | } // namespace std 70 | -------------------------------------------------------------------------------- /logger/spdlog/include/spdlog/version.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #define SPDLOG_VER_MAJOR 1 7 | #define SPDLOG_VER_MINOR 12 8 | #define SPDLOG_VER_PATCH 0 9 | 10 | #define SPDLOG_VERSION (SPDLOG_VER_MAJOR * 10000 + SPDLOG_VER_MINOR * 100 + SPDLOG_VER_PATCH) 11 | -------------------------------------------------------------------------------- /logger/spdlog/src/async.cpp: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #ifndef SPDLOG_COMPILED_LIB 5 | # error Please define SPDLOG_COMPILED_LIB to compile this file. 6 | #endif 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | -------------------------------------------------------------------------------- /logger/spdlog/src/bundled_fmtlib_format.cpp: -------------------------------------------------------------------------------- 1 | // Slightly modified version of fmt lib's format.cc (version 1.9.1) source file. 2 | // Copyright (c) 2012 - 2016, Victor Zverovich 3 | // All rights reserved. 4 | 5 | #ifndef SPDLOG_COMPILED_LIB 6 | # error Please define SPDLOG_COMPILED_LIB to compile this file. 7 | #endif 8 | 9 | #if !defined(SPDLOG_FMT_EXTERNAL) && !defined(SPDLOG_USE_STD_FORMAT) 10 | 11 | #include 12 | 13 | FMT_BEGIN_NAMESPACE 14 | namespace detail { 15 | 16 | template FMT_API auto dragonbox::to_decimal(float x) noexcept 17 | -> dragonbox::decimal_fp; 18 | template FMT_API auto dragonbox::to_decimal(double x) noexcept 19 | -> dragonbox::decimal_fp; 20 | 21 | #ifndef FMT_STATIC_THOUSANDS_SEPARATOR 22 | template FMT_API locale_ref::locale_ref(const std::locale& loc); 23 | template FMT_API auto locale_ref::get() const -> std::locale; 24 | #endif 25 | 26 | // Explicit instantiations for char. 27 | 28 | template FMT_API auto thousands_sep_impl(locale_ref) 29 | -> thousands_sep_result; 30 | template FMT_API auto decimal_point_impl(locale_ref) -> char; 31 | 32 | template FMT_API void buffer::append(const char*, const char*); 33 | 34 | // DEPRECATED! 35 | // There is no correspondent extern template in format.h because of 36 | // incompatibility between clang and gcc (#2377). 37 | template FMT_API void vformat_to(buffer&, string_view, 38 | basic_format_args, 39 | locale_ref); 40 | 41 | // Explicit instantiations for wchar_t. 42 | 43 | template FMT_API auto thousands_sep_impl(locale_ref) 44 | -> thousands_sep_result; 45 | template FMT_API auto decimal_point_impl(locale_ref) -> wchar_t; 46 | 47 | template FMT_API void buffer::append(const wchar_t*, const wchar_t*); 48 | 49 | } // namespace detail 50 | FMT_END_NAMESPACE 51 | 52 | #endif // !SPDLOG_FMT_EXTERNAL 53 | -------------------------------------------------------------------------------- /logger/spdlog/src/cfg.cpp: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #ifndef SPDLOG_COMPILED_LIB 5 | # error Please define SPDLOG_COMPILED_LIB to compile this file. 6 | #endif 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /logger/spdlog/src/file_sinks.cpp: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #ifndef SPDLOG_COMPILED_LIB 5 | # error Please define SPDLOG_COMPILED_LIB to compile this file. 6 | #endif 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | template class SPDLOG_API spdlog::sinks::basic_file_sink; 16 | template class SPDLOG_API spdlog::sinks::basic_file_sink; 17 | 18 | #include 19 | template class SPDLOG_API spdlog::sinks::rotating_file_sink; 20 | template class SPDLOG_API spdlog::sinks::rotating_file_sink; 21 | -------------------------------------------------------------------------------- /logger/spdlog/src/spdlog.cpp: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #ifndef SPDLOG_COMPILED_LIB 5 | # error Please define SPDLOG_COMPILED_LIB to compile this file. 6 | #endif 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #include 22 | 23 | // template instantiate logger constructor with sinks init list 24 | template SPDLOG_API spdlog::logger::logger(std::string name, sinks_init_list::iterator begin, sinks_init_list::iterator end); 25 | template class SPDLOG_API spdlog::sinks::base_sink; 26 | template class SPDLOG_API spdlog::sinks::base_sink; 27 | -------------------------------------------------------------------------------- /logger/spdlog/src/stdout_sinks.cpp: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #ifndef SPDLOG_COMPILED_LIB 5 | # error Please define SPDLOG_COMPILED_LIB to compile this file. 6 | #endif 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | template class SPDLOG_API spdlog::sinks::stdout_sink_base; 15 | template class SPDLOG_API spdlog::sinks::stdout_sink_base; 16 | template class SPDLOG_API spdlog::sinks::stdout_sink; 17 | template class SPDLOG_API spdlog::sinks::stdout_sink; 18 | template class SPDLOG_API spdlog::sinks::stderr_sink; 19 | template class SPDLOG_API spdlog::sinks::stderr_sink; 20 | 21 | template SPDLOG_API std::shared_ptr spdlog::stdout_logger_mt(const std::string &logger_name); 22 | template SPDLOG_API std::shared_ptr spdlog::stdout_logger_st(const std::string &logger_name); 23 | template SPDLOG_API std::shared_ptr spdlog::stderr_logger_mt(const std::string &logger_name); 24 | template SPDLOG_API std::shared_ptr spdlog::stderr_logger_st(const std::string &logger_name); 25 | 26 | template SPDLOG_API std::shared_ptr spdlog::stdout_logger_mt(const std::string &logger_name); 27 | template SPDLOG_API std::shared_ptr spdlog::stdout_logger_st(const std::string &logger_name); 28 | template SPDLOG_API std::shared_ptr spdlog::stderr_logger_mt(const std::string &logger_name); 29 | template SPDLOG_API std::shared_ptr spdlog::stderr_logger_st(const std::string &logger_name); 30 | -------------------------------------------------------------------------------- /logger/spdloghelper/spdloghelper.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 头文件 20 | 21 | 22 | 头文件 23 | 24 | 25 | 头文件 26 | 27 | 28 | 头文件 29 | 30 | 31 | 32 | 33 | 源文件 34 | 35 | 36 | 源文件 37 | 38 | 39 | 源文件 40 | 41 | 42 | -------------------------------------------------------------------------------- /logger/spdloghelper/spdloghelper/Logger.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/logger/spdloghelper/spdloghelper/Logger.cpp -------------------------------------------------------------------------------- /logger/spdloghelper/spdloghelper/LoggerInit.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Logger.h" 4 | 5 | #ifndef _COMPILE_AS_LIB 6 | #ifdef _MAKE_DLL //.dll 7 | #define LOG_EXTERN_DEF _declspec(dllexport) 8 | #elif defined(_MAKE_EXE) //.exe 9 | #define LOG_EXTERN_DEF _declspec(dllimport) 10 | #else //other 11 | #define LOG_EXTERN_DEF 12 | #endif 13 | #else 14 | #define LOG_EXTERN_DEF 15 | #endif 16 | 17 | LOG_EXTERN_DEF extern CLogger& Logger; 18 | 19 | #define ENABLE_DETAILLOG 1 20 | 21 | #include "DetailLogger.h" 22 | 23 | -------------------------------------------------------------------------------- /logger/spdloghelper/spdloghelper/helper_functions.cpp: -------------------------------------------------------------------------------- 1 | #include "pch_spdlogh.h" 2 | 3 | std::string get_date() 4 | { 5 | //std::chrono::zoned_time zt{ "Asia/Shanghai", std::chrono::system_clock::now() }; 6 | std::chrono::zoned_seconds zt{ "Asia/Shanghai", std::chrono::time_point_cast(std::chrono::system_clock::now()) }; 7 | return std::format("{:%F}", zt); 8 | } 9 | 10 | std::string get_datetime() 11 | { 12 | //std::chrono::zoned_time zt{ "Asia/Shanghai", std::chrono::system_clock::now() }; 13 | std::chrono::zoned_seconds zt{ "Asia/Shanghai", std::chrono::time_point_cast(std::chrono::system_clock::now()) }; 14 | return std::format("{:%F %H:%M:%S}", zt); 15 | } 16 | 17 | std::string get_datetime2() 18 | { 19 | std::chrono::zoned_seconds zt{ "Asia/Shanghai", std::chrono::time_point_cast(std::chrono::system_clock::now()) }; 20 | //std::chrono::zoned_time zt{ "Asia/Shanghai", std::chrono::system_clock::now() }; 21 | return std::format("{:%Y%m%d_%H%M%S}", zt); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /logger/spdloghelper/spdloghelper/pch_spdlogh.cpp: -------------------------------------------------------------------------------- 1 | // pch.cpp: 与预编译标头对应的源文件 2 | 3 | #include "pch_spdlogh.h" 4 | 5 | // 当使用预编译的头时,需要使用此源文件,编译才能成功。 6 | 7 | //#ifndef _IS_CONSOLE_EXE_ 8 | //#error "please define _IS_CONSOLE_EXE_" 9 | //#else 10 | //#if _IS_CONSOLE_EXE_ 11 | //CLogger& Logger = CLogger::GetInstance(std::bind(&init_logger_console, std::placeholders::_1)); 12 | //#else 13 | //CLogger& Logger = CLogger::GetInstance(std::bind(&init_logger_memfile, std::placeholders::_1)); 14 | //#endif 15 | //#endif -------------------------------------------------------------------------------- /logger/spdloghelper/spdloghelper/pch_spdlogh.h: -------------------------------------------------------------------------------- 1 | // pch.h: 这是预编译标头文件。 2 | // 下方列出的文件仅编译一次,提高了将来生成的生成性能。 3 | // 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。 4 | // 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。 5 | // 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。 6 | 7 | #ifndef PCH_H 8 | #define PCH_H 9 | 10 | // 添加要在此处预编译的标头 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | namespace fs = std::filesystem; 17 | 18 | #include "Logger.h" 19 | #include "LoggerInit.h" 20 | 21 | #endif //PCH_H 22 | -------------------------------------------------------------------------------- /self-dev/MapViewFile/MapViewFile.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MapViewFile/MapViewFile.cpp -------------------------------------------------------------------------------- /self-dev/MapViewFile/MapViewFile.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MapViewFile/MapViewFile.h -------------------------------------------------------------------------------- /self-dev/MapViewFile/MapViewFileMulti.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MapViewFile/MapViewFileMulti.cpp -------------------------------------------------------------------------------- /self-dev/MapViewFile/MapViewFileMulti.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MapViewFile/MapViewFileMulti.h -------------------------------------------------------------------------------- /self-dev/MapViewFile/MapViewFileMultiPck.cpp: -------------------------------------------------------------------------------- 1 | #include "pch_mvf.h" 2 | #include "MapViewFileMultiPck.h" 3 | 4 | 5 | CMapViewFileMultiPck::CMapViewFileMultiPck() 6 | { 7 | this->SetPackageCountAndSuffix({ ".pck", ".pkx", ".pkg" }); 8 | } 9 | 10 | void CMapViewFileMultiPck::SetPackageCountAndSuffix(const std::vector& name) 11 | { 12 | this->m_package_count = name.size(); 13 | this->m_fileSuffix = name; 14 | this->m_szPckFileName.resize(name.size()); 15 | this->m_uqwPckSize.resize(name.size()); 16 | } 17 | 18 | void CMapViewFileMultiPck::initialization_filenames(const fs::path& lpszFilename) 19 | { 20 | for (auto& file : this->m_szPckFileName) { 21 | file = lpszFilename; 22 | } 23 | 24 | for (int i = 1; i < this->m_szPckFileName.size(); i++) 25 | { 26 | this->m_szPckFileName[i].replace_extension(this->m_fileSuffix[i]); 27 | } 28 | } -------------------------------------------------------------------------------- /self-dev/MapViewFile/MapViewFileMultiPck.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MapViewFile/MapViewFileMultiPck.h -------------------------------------------------------------------------------- /self-dev/MapViewFile/MapViewFileMultiPckRead.cpp: -------------------------------------------------------------------------------- 1 | #include "pch_mvf.h" 2 | #include "MapViewFileMultiPck.h" 3 | 4 | BOOL CMapViewFileMultiPckRead::OpenPck(const fs::path& lpszFilename) 5 | { 6 | BOOL rtn = FALSE; 7 | 8 | this->initialization_filenames(lpszFilename); 9 | 10 | for(int i = 0;i < this->m_szPckFileName.size();i++) { 11 | if (!this->AddFile(this->m_szPckFileName[i])) { 12 | if (0 < i) 13 | SetLastError(NOERROR); 14 | break; 15 | } 16 | 17 | rtn = TRUE; 18 | } 19 | this->m_uqwPckStructSize.qwValue = CMapViewFileMulti::GetFileSize(); 20 | return rtn; 21 | } 22 | 23 | BOOL CMapViewFileMultiPckRead::OpenPckAndMappingRead(const fs::path& lpFileName) 24 | { 25 | if(!(this->OpenPck(lpFileName))) 26 | return FALSE; 27 | 28 | if(!(this->Mapping())) 29 | return FALSE; 30 | 31 | return TRUE; 32 | } 33 | 34 | QWORD CMapViewFileMultiPckRead::GetFileSize() const 35 | { 36 | return this->m_uqwPckStructSize.qwValue; 37 | } -------------------------------------------------------------------------------- /self-dev/MapViewFile/MapViewFileMultiPckWrite.cpp: -------------------------------------------------------------------------------- 1 | #include "pch_mvf.h" 2 | #include "MapViewFileMultiPck.h" 3 | 4 | 5 | #if _TEST_MAX_PCK_CELL 6 | CMapViewFileMultiPckWrite::CMapViewFileMultiPckWrite(QWORD qwMaxPckSize): 7 | m_Max_PckFile_Size(100 * 1024 * 1024) 8 | {} 9 | #else 10 | CMapViewFileMultiPckWrite::CMapViewFileMultiPckWrite(QWORD qwMaxPckSize) : 11 | m_Max_PckFile_Size(qwMaxPckSize) 12 | {} 13 | #endif 14 | 15 | //OPEN_ALWAYS, CREATE_ALWAYES, OPEN_EXISTING 16 | BOOL CMapViewFileMultiPckWrite::OpenPck(const fs::path& lpszFilename, DWORD dwCreationDisposition, BOOL isNTFSSparseFile) 17 | { 18 | BOOL rtn = FALSE; 19 | 20 | this->initialization_filenames(lpszFilename); 21 | 22 | for(int i = 0;i < this->m_szPckFileName.size();i++) { 23 | if(!this->AddFile(this->m_szPckFileName[i], dwCreationDisposition, this->m_Max_PckFile_Size, isNTFSSparseFile)) 24 | break; 25 | 26 | rtn = TRUE; 27 | } 28 | this->m_uqwPckStructSize.qwValue = CMapViewFileMulti::GetFileSize(); 29 | return rtn; 30 | } 31 | 32 | BOOL CMapViewFileMultiPckWrite::OpenPckAndMappingWrite(const fs::path& lpFileName, DWORD dwCreationDisposition, QWORD qdwSizeToMap, BOOL isNTFSSparseFile) 33 | { 34 | if(!this->OpenPck(lpFileName, dwCreationDisposition, isNTFSSparseFile)) 35 | return FALSE; 36 | 37 | if(!this->Mapping(qdwSizeToMap)) 38 | return FALSE; 39 | 40 | return TRUE; 41 | } 42 | -------------------------------------------------------------------------------- /self-dev/MapViewFile/MapViewFileMultiRead.cpp: -------------------------------------------------------------------------------- 1 | #include "pch_mvf.h" 2 | #include "MapViewFileMulti.h" 3 | 4 | CMapViewFileMultiRead::CMapViewFileMultiRead() 5 | {} 6 | 7 | CMapViewFileMultiRead::~CMapViewFileMultiRead() noexcept 8 | {} 9 | 10 | BOOL CMapViewFileMultiRead::AddFile(CMapViewFileRead *lpRead, const fs::path& lpszFilename) 11 | { 12 | FILE_CELL cFileCell = {0}; 13 | 14 | //wcscpy_s(cFileCell.szFilename, lpszFilename); 15 | cFileCell.szFilename = lpszFilename; 16 | cFileCell.lpMapView = lpRead; 17 | cFileCell.qwCellSize = lpRead->GetFileSize(); 18 | cFileCell.qwCellAddressBegin = this->m_uqwFullSize.qwValue; 19 | cFileCell.qwCellAddressEnd = this->m_uqwFullSize.qwValue + cFileCell.qwCellSize; 20 | cFileCell.qwMaxCellSize = cFileCell.qwCellSize; 21 | 22 | this->m_file_cell.push_back(cFileCell); 23 | 24 | this->m_uqwFullSize.qwValue += cFileCell.qwCellSize; 25 | this->m_uqwMaxSize.qwValue += cFileCell.qwCellSize; 26 | 27 | return TRUE; 28 | } 29 | 30 | BOOL CMapViewFileMultiRead::AddFile(const fs::path& lpszFilename) 31 | { 32 | CMapViewFileRead *lpRead = new CMapViewFileRead(); 33 | 34 | if(!lpRead->Open(lpszFilename)) { 35 | 36 | delete lpRead; 37 | return FALSE; 38 | } 39 | 40 | return this->AddFile(lpRead, lpszFilename); 41 | } 42 | 43 | BOOL CMapViewFileMultiRead::Mapping() 44 | { 45 | size_t nCellCount = this->m_file_cell.size(); 46 | 47 | for(int i = 0;i < nCellCount;i++) { 48 | 49 | CMapViewFileRead *lpRead = (CMapViewFileRead*)this->m_file_cell[i].lpMapView; 50 | 51 | if(!lpRead->Mapping()) { 52 | return FALSE; 53 | } 54 | } 55 | return TRUE; 56 | } 57 | 58 | LPBYTE CMapViewFileMultiRead::View(QWORD dwAddress, DWORD dwSize) 59 | { 60 | return CMapViewFileMulti::View(dwAddress, dwSize, TRUE); 61 | } -------------------------------------------------------------------------------- /self-dev/MapViewFile/MapViewFileMultiWrite.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MapViewFile/MapViewFileMultiWrite.cpp -------------------------------------------------------------------------------- /self-dev/MapViewFile/MapViewFileRead.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MapViewFile/MapViewFileRead.cpp -------------------------------------------------------------------------------- /self-dev/MapViewFile/MapViewFileWrite.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MapViewFile/MapViewFileWrite.cpp -------------------------------------------------------------------------------- /self-dev/MapViewFile/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容 4 | -------------------------------------------------------------------------------- /self-dev/MapViewFile/pch.cpp: -------------------------------------------------------------------------------- 1 | // pch.cpp: 与预编译标头对应的源文件 2 | 3 | #include "pch_mvf.h" 4 | 5 | // 当使用预编译的头时,需要使用此源文件,编译才能成功。 6 | -------------------------------------------------------------------------------- /self-dev/MapViewFile/pch_mvf.h: -------------------------------------------------------------------------------- 1 | // pch.h: 这是预编译标头文件。 2 | // 下方列出的文件仅编译一次,提高了将来生成的生成性能。 3 | // 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。 4 | // 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。 5 | // 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。 6 | 7 | #ifndef PCH_H 8 | #define PCH_H 9 | 10 | // 添加要在此处预编译的标头 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | namespace fs = std::filesystem; 19 | 20 | 21 | 22 | #include "framework.h" 23 | 24 | #endif //PCH_H 25 | -------------------------------------------------------------------------------- /self-dev/MiscUtil/AccessCheck.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/AccessCheck.cpp -------------------------------------------------------------------------------- /self-dev/MiscUtil/AccessCheck.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/AccessCheck.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/AppEnv.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/AppEnv.cpp -------------------------------------------------------------------------------- /self-dev/MiscUtil/AppEnv.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/AppEnv.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/BytesConv.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/BytesConv.cpp -------------------------------------------------------------------------------- /self-dev/MiscUtil/BytesConv.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/BytesConv.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/BytesSpeed.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/BytesSpeed.cpp -------------------------------------------------------------------------------- /self-dev/MiscUtil/BytesSpeed.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/BytesSpeed.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/CharsCodeConv.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/CharsCodeConv.cpp -------------------------------------------------------------------------------- /self-dev/MiscUtil/CharsCodeConv.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/CharsCodeConv.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/GetDragPath.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/GetDragPath.cpp -------------------------------------------------------------------------------- /self-dev/MiscUtil/GetDragPath.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | BOOL GetWndPath(HWND hWnd, wchar_t * szPath); -------------------------------------------------------------------------------- /self-dev/MiscUtil/MemBuffer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/MemBuffer.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/MemBufferReader.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/MemBufferReader.cpp -------------------------------------------------------------------------------- /self-dev/MiscUtil/MemBufferReader.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/MemBufferReader.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/MemBufferWriter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/MemBufferWriter.cpp -------------------------------------------------------------------------------- /self-dev/MiscUtil/MemBufferWriter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/MemBufferWriter.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/MemPool.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/MemPool.cpp -------------------------------------------------------------------------------- /self-dev/MiscUtil/MemPool.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/MemPool.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/Raw2HexString.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/Raw2HexString.cpp -------------------------------------------------------------------------------- /self-dev/MiscUtil/Raw2HexString.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/Raw2HexString.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/StackWalker.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/StackWalker.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/StackWalkerLiqf.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/StackWalkerLiqf.cpp -------------------------------------------------------------------------------- /self-dev/MiscUtil/StackWalkerLiqf.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/StackWalkerLiqf.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/StdFileFuncs.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/StdFileFuncs.cpp -------------------------------------------------------------------------------- /self-dev/MiscUtil/StdFileFuncs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/StdFileFuncs.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/StopWatch.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/StopWatch.cpp -------------------------------------------------------------------------------- /self-dev/MiscUtil/StopWatch.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/StopWatch.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/TextEncoding.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/TextEncoding.cpp -------------------------------------------------------------------------------- /self-dev/MiscUtil/TextEncoding.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/TextEncoding.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/TextLineSpliter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/TextLineSpliter.cpp -------------------------------------------------------------------------------- /self-dev/MiscUtil/TextLineSpliter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/TextLineSpliter.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/TranslateDict.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/TranslateDict.cpp -------------------------------------------------------------------------------- /self-dev/MiscUtil/TranslateDict.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/TranslateDict.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/UnknownExceptionFilter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/UnknownExceptionFilter.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/driver_funcs.cpp: -------------------------------------------------------------------------------- 1 | #include "driver_funcs.h" 2 | #include 3 | #include 4 | 5 | std::vector get_cdrom_logic_drivers() 6 | { 7 | std::vector list; 8 | auto all_disk = ::GetLogicalDrives(); 9 | char disk_off = 'A'; 10 | 11 | while (all_disk) 12 | 13 | { 14 | 15 | if ((all_disk & 0x1) == 1) 16 | 17 | { 18 | //sprintf_s(device_path, "\\\\.\\%s", disk_path); 19 | auto device_path = std::format(R"({}:)", disk_off); 20 | auto x = ::GetDriveTypeA(device_path.c_str()); 21 | if (::GetDriveTypeA(device_path.c_str()) == DRIVE_CDROM) 22 | { 23 | list.push_back(device_path); 24 | } 25 | } 26 | 27 | all_disk >>= 1; 28 | disk_off++; 29 | } 30 | 31 | return list; 32 | } -------------------------------------------------------------------------------- /self-dev/MiscUtil/driver_funcs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/MiscUtil/driver_funcs.h -------------------------------------------------------------------------------- /self-dev/MiscUtil/template_type.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | template 3 | struct char_enable_if {}; // no member "type" when !_Test 4 | 5 | template 6 | struct char_enable_if { 7 | using type = _Tchar; 8 | }; 9 | 10 | template 11 | struct char_enable_if { 12 | using type = _Twchar; 13 | }; 14 | 15 | template 16 | using char_enable_if_t = typename char_enable_if<_Test, _Tchar, _Twchar>::type; 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /self-dev/WinCtl/CommDlg/CEdit.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/WinCtl/CommDlg/CEdit.cpp -------------------------------------------------------------------------------- /self-dev/WinCtl/CommDlg/CEdit.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/WinCtl/CommDlg/CEdit.h -------------------------------------------------------------------------------- /self-dev/WinCtl/CommDlg/CEditNumber.cpp: -------------------------------------------------------------------------------- 1 | #include "CEditNumber.h" 2 | 3 | //#include 4 | BOOL CEditNumber::EventKey(UINT uMsg, int nVirtKey, LONG lKeyData) 5 | { 6 | #if 0 7 | switch (uMsg) 8 | { 9 | case WM_CHAR: 10 | ::OutputDebugStringA(std::format("WM_CHAR nVirtKey={} {}\r\n", nVirtKey, (char)nVirtKey).c_str()); 11 | if (('0' <= nVirtKey && '9' >= nVirtKey) || ('-' == nVirtKey) || ('.' == nVirtKey) || 8 == nVirtKey) 12 | return FALSE; 13 | else 14 | return TRUE; 15 | break; 16 | case WM_KEYUP: 17 | ::OutputDebugStringA(std::format("WM_KEYUP nVirtKey={} {}\r\n", nVirtKey, (char)nVirtKey).c_str()); 18 | break; 19 | case WM_KEYDOWN: 20 | ::OutputDebugStringA(std::format("WM_KEYDOWN nVirtKey={} {}\r\n", nVirtKey, (char)nVirtKey).c_str()); 21 | break; 22 | } 23 | #endif 24 | if (WM_CHAR == uMsg) 25 | { 26 | switch (this->m_mode) 27 | { 28 | case NumberMode::UNSIGNED_INT: 29 | if (!(('0' <= nVirtKey && '9' >= nVirtKey) || 8 == nVirtKey)) 30 | return TRUE; 31 | break; 32 | 33 | case NumberMode::FLOAT: 34 | if (!(('0' <= nVirtKey && '9' >= nVirtKey) || ('-' == nVirtKey) || ('.' == nVirtKey) || 8 == nVirtKey)) 35 | return TRUE; 36 | break; 37 | 38 | case NumberMode::INTEGER: 39 | if (!(('0' <= nVirtKey && '9' >= nVirtKey) || ('-' == nVirtKey) || 8 == nVirtKey)) 40 | return TRUE; 41 | break; 42 | 43 | } 44 | } 45 | 46 | return FALSE; 47 | } 48 | 49 | std::string CEditNumber::string() 50 | { 51 | std::string buf; 52 | auto size = ::GetWindowTextLengthA(this->m_hWnd); 53 | buf.reserve(size + 1); 54 | buf.resize(size); 55 | ::GetWindowTextA(this->m_hWnd, buf.data(), buf.size() + 1); 56 | return std::move(buf); 57 | } 58 | 59 | 60 | int CEditNumber::integer() 61 | { 62 | auto s = this->string(); 63 | return std::stoi(s); 64 | } 65 | 66 | int64_t CEditNumber::integer64() 67 | { 68 | auto s = this->string(); 69 | return std::stoll(s); 70 | } 71 | 72 | uint32_t CEditNumber::dword() 73 | { 74 | auto s = this->string(); 75 | return std::stoul(s); 76 | } 77 | 78 | uint64_t CEditNumber::qword() 79 | { 80 | auto s = this->string(); 81 | return std::stoull(s); 82 | } 83 | 84 | double CEditNumber::decimal() 85 | { 86 | auto s = this->string(); 87 | return std::stod(s); 88 | } 89 | 90 | -------------------------------------------------------------------------------- /self-dev/WinCtl/CommDlg/CEditNumber.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CEdit.h" 3 | #include 4 | 5 | 6 | class CEditNumber : 7 | public CEdit 8 | { 9 | public: 10 | CEditNumber() = default; 11 | virtual ~CEditNumber() = default; 12 | 13 | enum class NumberMode 14 | { 15 | INTEGER, 16 | FLOAT, 17 | UNSIGNED_INT, 18 | }; 19 | 20 | void SetNumberMode(NumberMode mode) 21 | { 22 | this->m_mode = mode; 23 | } 24 | 25 | std::string string(); 26 | int integer(); 27 | int64_t integer64(); 28 | uint32_t dword(); 29 | uint64_t qword(); 30 | double decimal(); 31 | 32 | template 33 | void set_value(T&& value) 34 | { 35 | ::SetWindowTextA(this->m_hWnd, std::format("{}", std::forward(value)).c_str()); 36 | } 37 | 38 | private: 39 | 40 | virtual BOOL EventKey(UINT uMsg, int nVirtKey, LONG lKeyData); 41 | 42 | NumberMode m_mode = NumberMode::FLOAT; 43 | }; 44 | 45 | -------------------------------------------------------------------------------- /self-dev/WinCtl/CommDlg/COpenFileListener.cpp: -------------------------------------------------------------------------------- 1 | #include "COpenFileListener.h" 2 | 3 | COpenFileListener::COpenFileListener(std::wstring& pFilePath) :m_FilePath(pFilePath) 4 | {} 5 | 6 | COpenFileListener::~COpenFileListener() 7 | {} 8 | 9 | STDMETHODIMP COpenFileListener::OnFileOk(IFileDialog* pfd) 10 | { 11 | IShellItemArray *psiaResults; 12 | HRESULT hr; 13 | IFileOpenDialog *fod; 14 | 15 | hr = pfd->QueryInterface(IID_PPV_ARGS(&fod)); 16 | 17 | if(SUCCEEDED(hr)) { 18 | hr = fod->GetSelectedItems(&psiaResults); 19 | 20 | if (SUCCEEDED(hr)) { 21 | DWORD fileCount; 22 | IShellItem *isi; 23 | LPWSTR pwsz = NULL; 24 | 25 | psiaResults->GetCount(&fileCount); 26 | for(DWORD i=0;iGetItemAt(i,&isi); 28 | hr = isi->GetDisplayName(SIGDN_FILESYSPATH,&pwsz); 29 | 30 | if (SUCCEEDED(hr)) { 31 | 32 | m_FilePath.assign(pwsz); 33 | //#ifdef UNICODE 34 | // wcscpy_s(pFilePath, MAX_PATH, pwsz); 35 | //#else 36 | // WideCharToMultiByte(CP_ACP, 0, pwsz, -1, pFilePath, MAX_PATH, "_", 0); 37 | //#endif 38 | CoTaskMemFree(pwsz); 39 | } 40 | 41 | isi->Release(); 42 | 43 | } 44 | psiaResults->Release(); 45 | } 46 | fod->Release(); 47 | } 48 | 49 | return S_OK; 50 | } 51 | 52 | STDMETHODIMP COpenFileListener::QueryInterface(REFIID riid, LPVOID *ppv) 53 | { 54 | *ppv = NULL; 55 | 56 | if (IsEqualIID(riid, IID_IFileDialogEvents) || IsEqualIID(riid, IID_IUnknown)) 57 | { 58 | *ppv = (IFileDialogEvents *)this; 59 | } 60 | 61 | if (*ppv) 62 | { 63 | AddRef(); 64 | 65 | return NOERROR; 66 | } 67 | 68 | return E_NOINTERFACE; 69 | } 70 | 71 | STDMETHODIMP_(ULONG) COpenFileListener::AddRef() 72 | { 73 | return ++m_cRef; 74 | } 75 | 76 | STDMETHODIMP_(ULONG) COpenFileListener::Release() 77 | { 78 | if (--m_cRef) 79 | return m_cRef; 80 | 81 | delete this; 82 | 83 | return 0L; 84 | } 85 | 86 | -------------------------------------------------------------------------------- /self-dev/WinCtl/CommDlg/COpenFileListener.h: -------------------------------------------------------------------------------- 1 | #ifndef COPENFILELISTENER_H 2 | #define COPENFILELISTENER_H 3 | 4 | #include 5 | #include 6 | 7 | class COpenFileListener : public IFileDialogEvents 8 | { 9 | public: 10 | COpenFileListener(std::wstring& pFilePath); 11 | ~COpenFileListener(); 12 | 13 | STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *); 14 | STDMETHODIMP_(ULONG) AddRef(); 15 | STDMETHODIMP_(ULONG) Release(); 16 | 17 | std::wstring& m_FilePath; 18 | 19 | // IFileDialogEvents 20 | 21 | STDMETHODIMP OnFileOk(IFileDialog* pfd); 22 | STDMETHODIMP OnFolderChanging(IFileDialog* pfd, IShellItem* psiFolder) {return E_NOTIMPL;} 23 | STDMETHODIMP OnFolderChange(IFileDialog* pfd) {return E_NOTIMPL;} 24 | STDMETHODIMP OnSelectionChange(IFileDialog* pfd) {return E_NOTIMPL;} 25 | STDMETHODIMP OnShareViolation(IFileDialog* pfd, IShellItem* psi, 26 | FDE_SHAREVIOLATION_RESPONSE* pResponse) {return E_NOTIMPL;} 27 | STDMETHODIMP OnTypeChange(IFileDialog* pfd) {return E_NOTIMPL;} 28 | STDMETHODIMP OnOverwrite(IFileDialog* pfd, IShellItem* psi, 29 | FDE_OVERWRITE_RESPONSE* pResponse) {return E_NOTIMPL;} 30 | private: 31 | ULONG m_cRef = 0; 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /self-dev/WinCtl/CommDlg/CRichEdit.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/WinCtl/CommDlg/CRichEdit.cpp -------------------------------------------------------------------------------- /self-dev/WinCtl/CommDlg/CRichEdit.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/WinCtl/CommDlg/CRichEdit.h -------------------------------------------------------------------------------- /self-dev/WinCtl/CommDlg/ComboBox.cpp: -------------------------------------------------------------------------------- 1 | #include "ComboBox.h" 2 | 3 | 4 | std::string CComboBox::GetLBText(int index) 5 | { 6 | std::string s; 7 | //char* str = nullptr; 8 | 9 | LRESULT len = GetLBTextLen(index); // length, excluding the terminating null character 10 | if (len == CB_ERR) 11 | return ""; 12 | 13 | //str = new char[len + 1]; 14 | s.resize(len); 15 | 16 | LRESULT len2 = GetLBText(index, s.data()); 17 | 18 | if (len2 == CB_ERR) { 19 | //delete[] str; 20 | return ""; 21 | } 22 | 23 | if (len > len2) 24 | s.resize(len2); 25 | //s.assign(str); 26 | //delete[] str; 27 | return s; 28 | } 29 | 30 | // selection helpers 31 | int CComboBox::FindString(int nStartAfter, LPCSTR lpszString) 32 | { 33 | int count = GetCount(); 34 | if (0 == count) 35 | return CB_ERR; 36 | if (nStartAfter >= count) 37 | return CB_ERR; 38 | 39 | if (0 > nStartAfter) 40 | nStartAfter = 0; 41 | 42 | //std::string str; 43 | 44 | for (int i = nStartAfter; i < count; i++) { 45 | 46 | auto str = GetLBText(i); 47 | if (0 == str.compare(lpszString)) 48 | return i; 49 | } 50 | return CB_ERR; 51 | } 52 | int CComboBox::SelectString(int nStartAfter, LPCSTR lpszString) 53 | { 54 | return SetCurSel(FindString(nStartAfter, lpszString)); 55 | } 56 | 57 | -------------------------------------------------------------------------------- /self-dev/WinCtl/CommDlg/ComboBox.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "WinControl.h" 4 | class CComboBox : 5 | public CWinControl 6 | { 7 | public: 8 | CComboBox() = default; 9 | virtual ~CComboBox() = default; 10 | 11 | LRESULT AddString(LPCSTR s) { return SendMsgA(CB_ADDSTRING, 0, (LPARAM)s); } 12 | LRESULT InsertString(int nIndex, LPCSTR s) { return SendMsgA(CB_ADDSTRING, nIndex, (LPARAM)s); } 13 | int DeleteString(UINT nIndex) { return SendMsgA(CB_DELETESTRING, nIndex, NULL); } 14 | 15 | void clear() { SendMsgA(CB_RESETCONTENT, NULL, NULL); }; 16 | 17 | LRESULT SetCurSel(int index) { return SendMsgA(CB_SETCURSEL, index, 0); } 18 | int GetCurSel() { return (int)SendMsgA(CB_GETCURSEL, 0, 0); } 19 | int GetCount() { return (int)SendMsgA(CB_GETCOUNT, 0, 0); } 20 | 21 | LRESULT GetLBTextLen(int index) { return SendMsgA(CB_GETLBTEXTLEN, index, 0); } 22 | LRESULT GetLBText(int index, LPSTR s) { return SendMsgA(CB_GETLBTEXT, index, (LPARAM)s); } 23 | std::string GetLBText(int index); 24 | std::string GetCurLBText() { return GetLBText((int)SendMsgA(CB_GETCURSEL, 0, 0)); } 25 | 26 | // selection helpers 27 | int FindString(int nStartAfter, LPCSTR lpszString); 28 | int SelectString(int nStartAfter, LPCSTR lpszString); 29 | 30 | }; 31 | -------------------------------------------------------------------------------- /self-dev/WinCtl/CommDlg/ListViewCtrl.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/WinCtl/CommDlg/ListViewCtrl.cpp -------------------------------------------------------------------------------- /self-dev/WinCtl/CommDlg/ListViewCtrl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/WinCtl/CommDlg/ListViewCtrl.h -------------------------------------------------------------------------------- /self-dev/WinCtl/CommDlg/MyCommDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/WinCtl/CommDlg/MyCommDlg.cpp -------------------------------------------------------------------------------- /self-dev/WinCtl/CommDlg/MyCommDlg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/WinCtl/CommDlg/MyCommDlg.h -------------------------------------------------------------------------------- /self-dev/WinCtl/CommDlg/TabControl.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/WinCtl/CommDlg/TabControl.cpp -------------------------------------------------------------------------------- /self-dev/WinCtl/CommDlg/TabControl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "WinControl.h" 3 | 4 | #include 5 | #include 6 | 7 | //#define WM_USER_CLOSE_TAB (WM_USER + 1) 8 | 9 | class CTabControl : 10 | public CWinControl 11 | { 12 | public: 13 | CTabControl() = default; 14 | virtual ~CTabControl() = default; 15 | 16 | //virtual void Attach(int id, HWND hDlg) override; 17 | 18 | public: 19 | void AddTab(HWND hWnd, const std::string& title); 20 | void AddTab(HWND hWnd, const std::wstring& title); 21 | 22 | private: 23 | void SetAddedDlg(HWND hWnd, int index); 24 | 25 | public: 26 | int SetCurSel(int index); 27 | int GetCurSel(); 28 | int GetItemCount(); 29 | 30 | BOOL EvNotify(NMHDR* pNmHdr); 31 | 32 | //protected: 33 | // virtual BOOL EvCommand(WORD wNotifyCode, WORD wID, LPARAM hwndCtl); 34 | public: 35 | //virtual BOOL EvNotify(UINT ctlID, NMHDR* pNmHdr); 36 | protected: 37 | virtual BOOL EventButton(UINT uMsg, int nHitTest, POINTS pos); 38 | //virtual BOOL EventSystem(UINT uMsg, WPARAM wParam, LPARAM lParam); 39 | //virtual BOOL EventUser(UINT uMsg, WPARAM wParam, LPARAM lParam); 40 | 41 | private: 42 | 43 | void ChangeTab(int sel, bool close_to_change = false); 44 | 45 | 46 | HWND m_showing_Wnd = nullptr; 47 | 48 | std::map m_tab_dlgs; 49 | 50 | }; 51 | 52 | -------------------------------------------------------------------------------- /self-dev/WinCtl/CommDlg/WinControl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/WinCtl/CommDlg/WinControl.h -------------------------------------------------------------------------------- /self-dev/WinCtl/CommDlg/template_type.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #pragma region char_enable_if_t 5 | 6 | template 7 | struct char_enable_if {}; // no member "type" when !_Test 8 | 9 | template 10 | struct char_enable_if { 11 | using type = _Tchar; 12 | }; 13 | 14 | template 15 | struct char_enable_if { 16 | using type = _Twchar; 17 | }; 18 | 19 | template 20 | using char_enable_if_t = typename char_enable_if<_Test, _Tchar, _Twchar>::type; 21 | 22 | #pragma endregion 23 | 24 | #pragma region std_string_seletor 25 | template 26 | struct std_string_seletor {}; // no member "type" when !_Test 27 | 28 | template 29 | struct std_string_seletor { 30 | using type = _Tchar; 31 | }; 32 | 33 | template 34 | struct std_string_seletor { 35 | using type = _Twchar; 36 | }; 37 | 38 | template 39 | struct std_string_seletor { 40 | using type = _Tchar; 41 | }; 42 | 43 | template 44 | struct std_string_seletor { 45 | using type = _Twchar; 46 | }; 47 | 48 | 49 | template 50 | using std_string_seletor_t = typename std_string_seletor<_Test, _Tchar, _Twchar>::type; 51 | #pragma endregion -------------------------------------------------------------------------------- /self-dev/base64/base64.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "base64.h" 3 | #include 4 | 5 | BEXTERN uint32_t BEXPORT decodeBound(const char* pdata,const uint32_t data_size) 6 | { 7 | const char* input = pdata; 8 | uint32_t size; 9 | uint32_t dstsize; 10 | 11 | if(0 == data_size){ 12 | size = strlen(input); 13 | }else if(0 == (data_size & 0x3)){ 14 | size = data_size; 15 | }else{ 16 | return 0; 17 | } 18 | 19 | input += size; 20 | input -= 2; 21 | 22 | dstsize = (size >>2) * 3; 23 | 24 | if('=' == *input++) 25 | dstsize -= 2; 26 | else if('=' == *input) 27 | dstsize -= 1; 28 | 29 | return dstsize; 30 | } 31 | 32 | BEXTERN uint32_t BEXPORT encodeBound(const uint32_t data_size) 33 | { 34 | 35 | if(0 == data_size) 36 | return 0; 37 | 38 | return (((data_size + 2) / 3)<<2) + 1; 39 | 40 | } 41 | 42 | // 43 | //#ifdef _WINDLL 44 | // 45 | // #include 46 | // 47 | // #ifdef _MANAGED 48 | // #pragma managed(push, off) 49 | // #endif 50 | // 51 | // BOOL APIENTRY DllMain( HMODULE hModule, 52 | // DWORD ul_reason_for_call, 53 | // LPVOID lpReserved 54 | // ) 55 | // { 56 | // switch (ul_reason_for_call) 57 | // { 58 | // case DLL_PROCESS_ATTACH: 59 | // case DLL_THREAD_ATTACH: 60 | // case DLL_THREAD_DETACH: 61 | // case DLL_PROCESS_DETACH: 62 | // break; 63 | // } 64 | // return TRUE; 65 | // } 66 | // 67 | // #ifdef _MANAGED 68 | // #pragma managed(pop) 69 | // #endif 70 | // 71 | //#endif //_WINDLL 72 | // -------------------------------------------------------------------------------- /self-dev/base64/base64.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _BASE64_H_ 3 | #define _BASE64_H_ 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | //#define BASE64_DLLEXP 11 | //#define BASE64_DLLIMP 12 | #define BASE64_STATIC 13 | 14 | #ifdef BASE64_DLLEXP 15 | # define BEXTERN extern __declspec(dllexport) 16 | # define BEXPORTVA __cdecl 17 | # define BEXPORT __stdcall 18 | #elif defined BASE64_STATIC 19 | # define BEXTERN 20 | # define BEXPORTVA __cdecl 21 | # define BEXPORT __stdcall 22 | #else 23 | # define BEXTERN extern __declspec(dllimport) 24 | # define BEXPORTVA __cdecl 25 | # define BEXPORT __stdcall 26 | #endif 27 | 28 | #define BASE64_ZUP 0 29 | 30 | BEXTERN uint32_t BEXPORT decodeBound(const char* pdata,const uint32_t data_size); 31 | BEXTERN uint32_t BEXPORT encodeBound(const uint32_t data_size); 32 | 33 | BEXTERN void BEXPORT base64_encode(const void* pdata,const uint32_t data_size,void* out_pcode); 34 | BEXTERN int BEXPORT base64_decode(const void* pdata,const uint32_t data_size,void* out_pcode); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif //_BASE64_H_ -------------------------------------------------------------------------------- /self-dev/base64/base64.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 头文件 23 | 24 | 25 | 26 | 27 | 源文件 28 | 29 | 30 | 源文件 31 | 32 | 33 | 源文件 34 | 35 | 36 | -------------------------------------------------------------------------------- /self-dev/base64/base64_decoder.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/base64/base64_decoder.cpp -------------------------------------------------------------------------------- /self-dev/base64/base64_encoder.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/self-dev/base64/base64_encoder.cpp -------------------------------------------------------------------------------- /tlib/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //#define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容 4 | -------------------------------------------------------------------------------- /tlib/pch.cpp: -------------------------------------------------------------------------------- 1 | // pch.cpp: 与预编译标头对应的源文件 2 | 3 | #include "tlibpch.h" 4 | 5 | // 当使用预编译的头时,需要使用此源文件,编译才能成功。 6 | -------------------------------------------------------------------------------- /tlib/tDebug.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEBUG 2 | #define Debug 3 | #define DebugA 4 | #define DebugW 5 | #define DebugU8 6 | #endif 7 | -------------------------------------------------------------------------------- /tlib/tapi32ex.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/tlib/tapi32ex.cpp -------------------------------------------------------------------------------- /tlib/tapi32u8.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/tlib/tapi32u8.cpp -------------------------------------------------------------------------------- /tlib/tconf.h: -------------------------------------------------------------------------------- 1 | #ifndef TCONF_H 2 | #define TCONF_H 3 | 4 | #define _USE_T_CHARCONV_ 0 5 | //#define _USE_T_REG_ 6 | //#define _USE_T_INI_ 7 | //#define _USE_T_LIST_ 8 | //#define _USE_T_U8FUNC_ 9 | //#define _USE_T_CRYPT_ 10 | #define _USE_HEX2BIN_ 0 11 | 12 | #endif -------------------------------------------------------------------------------- /tlib/tdlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/tlib/tdlg.cpp -------------------------------------------------------------------------------- /tlib/tlibpch.h: -------------------------------------------------------------------------------- 1 | // pch.h: 这是预编译标头文件。 2 | // 下方列出的文件仅编译一次,提高了将来生成的生成性能。 3 | // 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。 4 | // 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。 5 | // 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。 6 | 7 | #ifndef PCH_H 8 | #define PCH_H 9 | 10 | // 添加要在此处预编译的标头 11 | #include "framework.h" 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #include 20 | 21 | //#include 22 | 23 | //#include 24 | 25 | #endif //PCH_H 26 | -------------------------------------------------------------------------------- /tlib/tlist.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef TLIST_H 3 | #define TLIST_H 4 | 5 | #ifdef _USE_T_INI_ 6 | #ifndef _USE_T_LIST_ 7 | #define _USE_T_LIST_ 8 | #endif 9 | #endif 10 | 11 | #ifdef _USE_T_LIST_ 12 | 13 | struct TListObj { 14 | TListObj *prior, *next; 15 | }; 16 | 17 | class TList { 18 | protected: 19 | TListObj top; 20 | 21 | public: 22 | TList(void); 23 | void Init(void); 24 | void AddObj(TListObj *obj); 25 | void DelObj(TListObj *obj); 26 | TListObj *TopObj(void); 27 | TListObj *NextObj(TListObj *obj); 28 | BOOL IsEmpty() { return top.next == ⊤ } 29 | void MoveList(TList *from_list); 30 | }; 31 | 32 | #define FREE_LIST 0 33 | #define USED_LIST 1 34 | #define RLIST_MAX 2 35 | class TRecycleList { 36 | protected: 37 | char *data; 38 | TList list[RLIST_MAX]; 39 | 40 | public: 41 | TRecycleList(int init_cnt, int size); 42 | ~TRecycleList(); 43 | TListObj *GetObj(int list_type); 44 | void PutObj(int list_type, TListObj *obj); 45 | }; 46 | 47 | #endif 48 | #endif -------------------------------------------------------------------------------- /tlib/tmisc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/tlib/tmisc.cpp -------------------------------------------------------------------------------- /tlib/tregist.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/tlib/tregist.cpp -------------------------------------------------------------------------------- /tlib/tregist.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef TREGISTRY_H 3 | #define TREGISTRY_H 4 | 5 | #define MAX_KEYARRAY 30 6 | 7 | #ifdef _USE_T_REG_ 8 | 9 | class TRegistry { 10 | protected: 11 | HKEY topKey; 12 | int openCnt; 13 | //StrMode strMode; 14 | HKEY hKey[MAX_KEYARRAY]; 15 | 16 | public: 17 | TRegistry(LPCTSTR company, LPTSTR appName=NULL/*, StrMode mode=BY_UTF8*/); 18 | TRegistry(HKEY top_key/*, StrMode mode=BY_UTF8*/); 19 | ~TRegistry(); 20 | 21 | void ChangeTopKey(HKEY topKey); 22 | 23 | BOOL ChangeApp(LPCTSTR company, LPTSTR appName=NULL); 24 | 25 | BOOL OpenKey(LPCTSTR subKey, BOOL createFlg=FALSE); 26 | 27 | BOOL CreateKey(LPCTSTR subKey) { return OpenKey(subKey, TRUE); } 28 | 29 | BOOL CloseKey(void); 30 | 31 | BOOL GetInt(LPCTSTR key, int *val); 32 | 33 | BOOL SetInt(LPCTSTR key, int val); 34 | 35 | BOOL GetLong(LPCTSTR key, long *val); 36 | 37 | BOOL SetLong(LPCTSTR key, long val); 38 | 39 | BOOL GetStr(LPCTSTR key, LPTSTR str, int size_byte); 40 | 41 | BOOL SetStr(LPCTSTR key, LPCTSTR str); 42 | 43 | BOOL GetByte(LPCTSTR key, BYTE *data, int *size); 44 | 45 | BOOL SetByte(LPCTSTR key, const BYTE *data, int size); 46 | 47 | BOOL DeleteKey(LPCTSTR str); 48 | 49 | BOOL DeleteValue(LPCTSTR str); 50 | 51 | BOOL EnumKey(DWORD cnt, LPTSTR buf, int size); 52 | 53 | BOOL EnumValue(DWORD cnt, LPTSTR buf, int size, DWORD *type=NULL); 54 | 55 | BOOL DeleteChildTree(LPCTSTR subkey=NULL); 56 | 57 | }; 58 | 59 | #endif 60 | 61 | #endif -------------------------------------------------------------------------------- /tlib/twin.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stsm85/WinPCK/fac86a8658eb01d5767021bc9f6424ab1a6dbf93/tlib/twin.cpp --------------------------------------------------------------------------------