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 FIoDirEntry.cpp
19 * @brief This is the implementation file for DirEntry class.
24 #include <FBaseString.h>
25 #include <FBaseDateTime.h>
26 #include <FBaseSysLog.h>
27 #include <FIoDirEntry.h>
29 #include <FBase_NativeError.h>
30 #include <FIo_DirEntryImpl.h>
32 using namespace Tizen::Base;
34 namespace Tizen { namespace Io
37 DirEntry::DirEntry(void)
38 : __pDirEntryImpl(null)
40 __pDirEntryImpl = new (std::nothrow) _DirEntryImpl;
41 SysTryReturnVoidResult(NID_IO, __pDirEntryImpl, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient");
44 DirEntry::~DirEntry(void)
46 delete __pDirEntryImpl;
49 DirEntry::DirEntry(const DirEntry& dirEntry)
51 __pDirEntryImpl = new (std::nothrow) _DirEntryImpl(*dirEntry.__pDirEntryImpl);
52 SysTryReturnVoidResult(NID_IO, __pDirEntryImpl, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient");
56 DirEntry::operator =(const DirEntry& dirEntry)
58 if (&dirEntry != this)
60 *__pDirEntryImpl = *(dirEntry.__pDirEntryImpl);
67 DirEntry::Equals(const Object& object) const
69 const DirEntry* pOther = dynamic_cast< const DirEntry* >(&object);
75 return __pDirEntryImpl->Equals(*pOther->__pDirEntryImpl);
79 DirEntry::GetHashCode(void) const
81 return __pDirEntryImpl->GetHashCode();
84 const Tizen::Base::String
85 DirEntry::GetName(void) const
87 return __pDirEntryImpl->GetName();
91 DirEntry::GetFileSize(void) const
93 return __pDirEntryImpl->GetFileSize();
97 DirEntry::IsDirectory(void) const
99 return __pDirEntryImpl->IsDirectory();
103 DirEntry::IsHidden(void) const
105 return __pDirEntryImpl->IsHidden();
109 DirEntry::IsReadOnly(void) const
111 return __pDirEntryImpl->IsReadOnly();
114 Tizen::Base::DateTime
115 DirEntry::GetDateTime(void) const
117 return __pDirEntryImpl->GetDateTime();