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 FIoDirEntry.cpp
20 * @brief This is the implementation file for DirEntry class.
25 #include <FBaseString.h>
26 #include <FBaseDateTime.h>
27 #include <FBaseSysLog.h>
28 #include <FIoDirEntry.h>
30 #include <FBase_NativeError.h>
31 #include <FIo_DirEntryImpl.h>
33 using namespace Tizen::Base;
35 namespace Tizen { namespace Io
38 DirEntry::DirEntry(void)
39 : __pDirEntryImpl(null)
41 __pDirEntryImpl = new (std::nothrow) _DirEntryImpl;
42 SysTryReturnVoidResult(NID_IO, __pDirEntryImpl, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient");
45 DirEntry::~DirEntry(void)
47 delete __pDirEntryImpl;
50 DirEntry::DirEntry(const DirEntry& dirEntry)
52 __pDirEntryImpl = new (std::nothrow) _DirEntryImpl(*dirEntry.__pDirEntryImpl);
53 SysTryReturnVoidResult(NID_IO, __pDirEntryImpl, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient");
57 DirEntry::operator =(const DirEntry& dirEntry)
59 if (&dirEntry != this)
61 *__pDirEntryImpl = *(dirEntry.__pDirEntryImpl);
68 DirEntry::Equals(const Object& object) const
70 const DirEntry* pOther = dynamic_cast< const DirEntry* >(&object);
76 return __pDirEntryImpl->Equals(*pOther->__pDirEntryImpl);
80 DirEntry::GetHashCode(void) const
82 return __pDirEntryImpl->GetHashCode();
85 const Tizen::Base::String
86 DirEntry::GetName(void) const
88 return __pDirEntryImpl->GetName();
92 DirEntry::GetFileSize(void) const
94 return __pDirEntryImpl->GetFileSize();
98 DirEntry::IsDirectory(void) const
100 return __pDirEntryImpl->IsDirectory();
104 DirEntry::IsHidden(void) const
106 return __pDirEntryImpl->IsHidden();
110 DirEntry::IsReadOnly(void) const
112 return __pDirEntryImpl->IsReadOnly();
115 Tizen::Base::DateTime
116 DirEntry::GetDateTime(void) const
118 return __pDirEntryImpl->GetDateTime();