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 FIoDirEnumerator.cpp
19 * @brief This is the implementation file for DirEnumerator class.
22 #include <FBaseSysLog.h>
23 #include <FIoDirEnumerator.h>
24 #include <FIoDirEntry.h>
26 #include <FBase_NativeError.h>
27 #include <FIo_DirEnumeratorImpl.h>
29 using namespace Tizen::Base;
31 namespace Tizen { namespace Io
34 DirEnumerator::DirEnumerator(const String& dirPath)
35 : __pCurDirEntry(null)
36 , __pDirEnumeratorImpl(null)
38 __pDirEnumeratorImpl = new (std::nothrow) _DirEnumeratorImpl(dirPath);
39 SysTryReturnVoidResult(NID_IO, __pDirEnumeratorImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
42 DirEnumerator::~DirEnumerator(void)
44 delete __pDirEnumeratorImpl;
48 DirEnumerator::GetCurrentDirEntry(void) const
50 return __pDirEnumeratorImpl->GetCurrentDirEntry();
54 DirEnumerator::GetCurrent(void) const
56 return __pDirEnumeratorImpl->GetCurrent();
60 DirEnumerator::MoveNext(void)
62 return __pDirEnumeratorImpl->MoveNext();
66 DirEnumerator::Reset(void)
68 return __pDirEnumeratorImpl->Reset();