cabinet.cpp

来自「这个代码用于生成一个能用的用于压缩和解压缩微软CAB格式文件的库。」· C++ 代码 · 共 37 行

CPP
37
字号

#include "Cabinet.hpp"

using namespace Cabinet;

void main(int argc, char **argv)
{
	CMain i_Main;
	i_Main.RunDemo();
}

void CMain::RunDemo()
{
	// This is an ID which is written (invisible) into the CAB file
	UINT u32_CabID = 12345;

	// Store filetimes as UTC in CAB files while compression
	BOOL b_StoreUtcTime = TRUE;

	// TRUE  -> If a filename has characters > 0x7F, encode it using UTF8
	// FALSE -> Store ANSI filenames unchanged, read documentation!
	BOOL b_EncodeUtf = TRUE;

	// Change this to split the archive into multiple files (200000 --> CAB split size = 200kB)
	// ATTENTION: In this case Parameter 1 of CreateFCIContext MUST contain "%d" or "%03u"...
	UINT u32_SplitSize = 0x7FFFFFFF;

	// FALSE = store in CAB file without compression
	BOOL b_Compress = TRUE;

	// TRUE -> don't write any file to disk, all files are passed in OnAfterCopyFile()
	BOOL b_ExtractToMemory = FALSE;

	// You can specify your own key for CAB encryption here (the longer the more secure, up to 72 characters or bytes)
	// Set empty EncryptionKey ("") to get a CAB file without encryption
	char* s8_EncryptionKey = "";
//	char* s8_EncryptionKey = "AH%KJ/76?K逪謀\狞dghf7(ZTbjsf82iz<sx87qc5ba&m;-@^l#jeL9/)$D2@rTbZ<

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?