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 FSecPrivilegeInfo.cpp
19 * @brief This is the implementation for the PrivilegeInfo class.
24 #include <FSecPrivilegeInfo.h>
26 #include <FBaseSysLog.h>
27 #include <FSec_AccessController.h>
28 #include "FSec_PrivilegeInfoImpl.h"
30 using namespace Tizen::Base;
31 using namespace Tizen::Security;
33 namespace Tizen { namespace Security
37 PrivilegeInfo::PrivilegeInfo(void)
43 PrivilegeInfo::~PrivilegeInfo(void)
49 PrivilegeInfo::Construct(const Tizen::Base::String& privilegeId)
53 SysAssertf(__pImpl == null,
54 "Already constructed. Calling Construct() twice or more on a same in stance is not allowed for this class.");
56 __pImpl = new (std::nothrow) _PrivilegeInfoImpl;
57 SysTryReturnResult(NID_SEC, __pImpl != null, E_OUT_OF_MEMORY, "");
59 r = __pImpl->Construct(privilegeId);
60 SysTryCatch(NID_SEC, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
73 PrivilegeInfo::GetId(void) const
75 SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
77 return __pImpl->GetId();
82 PrivilegeInfo::GetDisplayName(void) const
84 SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
86 return __pImpl->GetDisplayName();
90 PrivilegeInfo::GetDescription(void) const
92 SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
94 return __pImpl->GetDescription();