CFx SDK Documentation  2023 SP0
ZipUtils.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2020, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Open Design Alliance software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Open Design Alliance Copyright (C) 2002-2020 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 #ifndef _ZIP_UTILS_H
25 #define _ZIP_UTILS_H
26 
27 #include "OdPlatformSettings.h"
28 #include "StringArray.h"
29 
30 #include <cstdint>
31 
35 namespace ZipUtils
36 {
37 
38 #define FILE_BUFFER_SIZE 1024
39 
45  OdAnsiString OdStringToUtf8(const OdString &sUnicode);
46 
53 
62 
68  bool containsDir(const OdString &dir);
69 
75  bool isDir(const OdString &dir);
76 
83 
89  OdString getFile(const OdString &path);
90 
96  OdString getDir(const OdString &path);
97 
105  int createFile(const OdString &path, const char *data, unsigned int size);
106 
113  int copyFile(const OdString &existingFileName, const OdString &newFileName);
114 
120  int removeFile(const OdString &path);
121 
127  bool dirExists(const OdString &dir);
128 
134  int createDir(const OdString &dir);
135 
141  int removeEmptyDir(const OdString &dir);
142 
150  int removeDir(const OdString &dir);
151 
158 
165 
170  uintmax_t getProcessId();
171 
177 
185  OdResult unzipFile(const OdString &filePath, const OdString &targetDir, bool overwriteTargetDir = true);
186 
194  OdResult zipToFile(const OdString &targetFile, const OdString &filesDir, bool overwriteTargetFile = true);
195 
196 } //namespace ZipUtils
197 
198 #endif // _ZIP_UTILS_H
OdResult
Definition: OdResult.h:29
GLsizeiptr size
Definition: gles2_ext.h:182
GLint GLenum GLsizei GLsizei GLint GLsizei const void * data
Definition: gles2_ext.h:110
bool isDir(const OdString &dir)
OdString getUniqueDirName()
int createDir(const OdString &dir)
OdString getFileExtension(const OdString &path)
OdResult zipToFile(const OdString &targetFile, const OdString &filesDir, bool overwriteTargetFile=true)
OdString formatDir(const OdString &dir)
OdString getDir(const OdString &path)
bool dirExists(const OdString &dir)
OdString getFile(const OdString &path)
int removeEmptyDir(const OdString &dir)
OdString formatPath(const OdString &path)
int createFile(const OdString &path, const char *data, unsigned int size)
int removeFile(const OdString &path)
uintmax_t getProcessId()
bool containsDir(const OdString &dir)
OdResult unzipFile(const OdString &filePath, const OdString &targetDir, bool overwriteTargetDir=true)
int removeDir(const OdString &dir)
OdAnsiString OdStringToUtf8(const OdString &sUnicode)
OdStringArray getDirList(const OdString &dir)
OdStringArray getFileList(const OdString &dir)
int copyFile(const OdString &existingFileName, const OdString &newFileName)