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.
24 #ifndef _FBASE_UTIL_INTERNAL_FILEUNZIPPER_IMPL_H_
25 #define _FBASE_UTIL_INTERNAL_FILEUNZIPPER_IMPL_H_
28 #include <unique_ptr.h>
30 #include <FBaseString.h>
31 #include <FBaseUtilZipEntry.h>
33 typedef char FilePath[PATH_MAX + 1];
35 namespace Tizen { namespace Base { namespace Utility
39 class _FileUnzipperImpl
40 : public Tizen::Base::Object
43 _FileUnzipperImpl(void);
44 virtual ~_FileUnzipperImpl(void);
45 result Construct(const String& filePath);
47 result UnzipTo(const String& dirPath) const;
48 result UnzipTo(const String& dirPath, const String& zipEntryName) const;
49 int GetEntryCount(void) const;
50 int GetFileCount(void) const;
51 int GetDirectoryCount(void) const;
52 result GetEntry(const String& zipEntryName, ZipEntry& entry) const;
53 result GetEntry(int index, ZipEntry& entry) const;
55 static result CreateDirectories(char* pFilePath);
56 static result IsFileExists(const char* pFilePath);
57 static bool IsFileExistsInZip(const char pArchiveName[], const char* pFilePathForZip);
60 result UnzipCurrentFileTo(void* pUnZipFile, FilePath outPath, int usedBytes) const;
61 result GetCurrentFileInfo(void* pUnZipFile, ZipEntry& entry) const;
64 std::unique_ptr< char[] > __pArchiveName;
65 unsigned long __entryCount;
66 unsigned long __dirCount;
67 unsigned long __fileCount;
69 }; // _FileUnzipperImpl
71 }}} // Tizen::Base::Utility
73 #endif // _FBASE_UTIL_INTERNAL_FILEUNZIPPER_IMPL_H_