2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FBaseUtil__FileUnzipperImplImpl.h
19 * @brief This is the header file for _FileUnzipperImpl class.
21 * This header file contains the declarations of the _FileUnzipperImpl class.
23 #ifndef _FBASE_UTIL_INTERNAL_FILEUNZIPPER_IMPL_H_
24 #define _FBASE_UTIL_INTERNAL_FILEUNZIPPER_IMPL_H_
27 #include <unique_ptr.h>
29 #include <FBaseString.h>
30 #include <FBaseUtilZipEntry.h>
32 typedef char FilePath[PATH_MAX + 1];
34 namespace Tizen { namespace Base { namespace Utility
37 class _FileUnzipperImpl
38 : public Tizen::Base::Object
41 _FileUnzipperImpl(void);
42 virtual ~_FileUnzipperImpl(void);
43 result Construct(const String& filePath);
45 result UnzipTo(const String& dirPath) const;
46 result UnzipTo(const String& dirPath, const String& zipEntryName) const;
47 int GetEntryCount(void) const;
48 int GetFileCount(void) const;
49 int GetDirectoryCount(void) const;
50 result GetEntry(const String& zipEntryName, ZipEntry& entry) const;
51 result GetEntry(int index, ZipEntry& entry) const;
53 static result CreateDirectories(char* pFilePath);
54 static result IsFileExists(const char* pFilePath);
55 static bool IsFileExistsInZip(const char pArchiveName[], const char* pFilePathForZip);
58 result UnzipCurrentFileTo(void* pUnZipFile, FilePath outPath, int usedBytes) const;
59 result GetCurrentFileInfo(void* pUnZipFile, ZipEntry& entry) const;
62 std::unique_ptr< char[] > __pArchiveName;
63 unsigned long __entryCount;
64 unsigned long __dirCount;
65 unsigned long __fileCount;
67 }; // _FileUnzipperImpl
68 }}} // Tizen::Base::Utility
69 #endif // _FBASE_UTIL_INTERNAL_FILEUNZIPPER_IMPL_H_