* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef FOUNDATION_APPEXECFWK_STANDARD_TOOLS_ZIP_INTERNAL_H
#define FOUNDATION_APPEXECFWK_STANDARD_TOOLS_ZIP_INTERNAL_H
#include <string>
#include <time.h>
#include "contrib/minizip/unzip.h"
#include "contrib/minizip/zip.h"
#include "zip_utils.h"
namespace OHOS {
namespace AppExecFwk {
namespace LIBZIP {
namespace {
const int kZipMaxPath = 256;
const int kZipBufSize = 8192;
}
void* FdOpenFileFunc(void* opaque, const char* filename, int mode);
int FdCloseFileFunc(void* opaque, void* stream);
void FillFdOpenFileFunc(zlib_filefunc_def* pzlibFilefuncDef, PlatformFile fd);
unzFile OpenFdForUnzipping(PlatformFile zipFD);
unzFile OpenForUnzipping(std::string& fileNameUtf8);
unzFile OpenFdForUnzipping(int zipFD);
unzFile PrepareMemoryForUnzipping(const std::string& data);
zipFile OpenForZipping(const std::string& fileNameUtf8, int appendFlag);
zipFile OpenFdForZipping(PlatformFile zipFd, int appendFlag);
bool ZipOpenNewFileInZip(
zipFile zipFile, const std::string& strPath, const OPTIONS& options, const struct tm* lastModifiedTime);
}
}
}
#endif