client.cpp

来自「zip解压源码.」· C++ 代码 · 共 64 行

CPP
64
字号
#include "stdafx.h"
#include "KAEZipArchive.h"
#include "ClientInit.h"
#include "KAEZipArchiveImport.h"

int PreProcessFileProc(
    int nFullNameInArchiveLen,char szFullNameInArchive[],
    void *pvContext
)
{
    return 0;
}

int ProcessFileProc(
    KAEARCHIVESTATUS nArchiveStatus,
    int nFullNameInArchiveLen, char szFullNameInArchive[],
    int nPathNameInTempLen,char szPathNameInTemp[],
    int nPathFileSize,int nPathFileSizeHigh,
    void *pvContext
)
{
    return 0;
}


int main(int argc, char* argv[])
{
    int Result = false;
    int nRetCode = false;
    char *pszString = NULL;

    char * csTempPath = "c:\\temp";
    int nLen1 = strlen(csTempPath) + 1;

    char * csZipFile = "d:\\work\\abc.zip";
    int nLen2 = strlen(csZipFile) + 1;

    int nRetVal;

    nRetCode = ClientInitialize();
    if (!nRetCode)
        goto Exit0;

    piKAEZipArchive->Init(nLen1,csTempPath);

    piKAEZipArchive->SetCallBackFunc(&PreProcessFileProc, NULL, &ProcessFileProc,NULL);

    piKAEZipArchive->Extract(nLen2,csZipFile,&nRetVal);

    piKAEZipArchive->UnInit();

    nRetCode = ClientUnInitialize();
    if (!nRetCode)
        goto Exit0;

    Result = true;

Exit0:


	return Result;
}

⌨️ 快捷键说明

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