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 FIoFileLock.cpp
19 * @brief This is the implementation file for %FileLock class.
24 #include <unique_ptr.h>
26 #include <FBaseResult.h>
27 #include <FBaseSysLog.h>
28 #include <FIoFileLock.h>
29 #include "FIo_FileImpl.h"
30 #include "FIo_FileLockImpl.h"
32 namespace Tizen { namespace Io
35 FileLock::FileLock(void)
36 : __pFileLockImpl(null)
38 __pFileLockImpl = new (std::nothrow) _FileLockImpl();
39 SysTryReturnVoidResult(NID_IO, __pFileLockImpl != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
42 FileLock::~FileLock(void)
44 delete __pFileLockImpl;
48 FileLock::IsShared(void) const
50 return __pFileLockImpl->IsShared();
54 FileLock::IsExclusive(void) const
56 return __pFileLockImpl->IsExclusive();
60 FileLock::IsValid(void) const
62 return __pFileLockImpl->IsValid();