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 FSecPrivilegeInfo.cpp
20 * @brief This is the implementation for the PrivilegeInfo class.
25 #include <FSecPrivilegeInfo.h>
27 #include <FBaseSysLog.h>
28 #include <FSec_AccessController.h>
29 #include "FSec_PrivilegeInfoImpl.h"
31 using namespace Tizen::Base;
32 using namespace Tizen::Base::Collection;
33 using namespace Tizen::Security;
35 namespace Tizen { namespace Security
39 PrivilegeInfo::PrivilegeInfo(void)
45 PrivilegeInfo::~PrivilegeInfo(void)
51 PrivilegeInfo::Construct(const Tizen::Base::String& privilegeId)
55 SysAssertf(__pImpl == null,
56 "Already constructed. Calling Construct() twice or more on a same in stance is not allowed for this class.");
58 __pImpl = new (std::nothrow) _PrivilegeInfoImpl;
59 SysTryReturnResult(NID_SEC, __pImpl != null, E_OUT_OF_MEMORY, "");
61 r = __pImpl->Construct(privilegeId);
62 SysTryCatch(NID_SEC, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
75 PrivilegeInfo::GetId(void) const
77 SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
79 return __pImpl->GetId();
84 PrivilegeInfo::GetDisplayName(void) const
86 SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
88 return __pImpl->GetDisplayName();
92 PrivilegeInfo::GetDescription(void) const
94 SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
96 return __pImpl->GetDescription();