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 FBaseUtilZipEntry.cpp
20 * @brief This is the implementation file for ZipEntry class.
24 #include <FBaseUtilZipEntry.h>
26 #include "FBaseUtil_ZipEntryInfo.h"
28 namespace Tizen { namespace Base { namespace Utility
32 ZipEntry::ZipEntry(void)
34 , __compressionLevel(DEFAULT_COMPRESSION)
35 , __pZipEntryImpl(null)
40 ZipEntry::~ZipEntry(void)
44 delete static_cast <_ZipEntryInfo*>(__unzFile);
51 ZipEntry::GetName(void) const
58 ZipEntry::GetCompressionLevel(void) const
60 return __compressionLevel;
65 ZipEntry::IsDirectory(void) const
67 _ZipEntryInfo* pZipEntryInfo = static_cast <_ZipEntryInfo*>(__unzFile);
68 return pZipEntryInfo->__isDirectory;
73 ZipEntry::GetCompressedSize(void) const
75 _ZipEntryInfo* pZipEntryInfo = static_cast <_ZipEntryInfo*>(__unzFile);
76 return pZipEntryInfo->__compressedSize;
81 ZipEntry::GetUncompressedSize(void) const
83 _ZipEntryInfo* pZipEntryInfo = static_cast <_ZipEntryInfo*>(__unzFile);
84 return pZipEntryInfo->__uncompressedSize;
89 ZipEntry::GetArchiveName(void) const
91 _ZipEntryInfo* pZipEntryInfo = static_cast <_ZipEntryInfo*>(__unzFile);
92 return pZipEntryInfo->__archiveName;
97 ZipEntry::Equals(const Tizen::Base::Object& obj) const
99 const ZipEntry* pOther = dynamic_cast <const ZipEntry*>(&obj);
103 if (!GetArchiveName().Equals(pOther->GetArchiveName(), true))
108 if (__compressionLevel != pOther->__compressionLevel)
113 if (__name != pOther->__name)
124 ZipEntry::GetHashCode(void) const
131 ZipEntry::Set(void* unzFile)
133 _ZipEntryInfo* pZipEntryInfo = static_cast <_ZipEntryInfo*>(unzFile);
134 __name = pZipEntryInfo->__name;
135 __unzFile = pZipEntryInfo;
136 __compressionLevel = pZipEntryInfo->__compressionLevel;
140 } } } // Tizen::Base::Utility