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