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::Base::Collection;
32 using namespace Tizen::Security;
34 namespace Tizen { namespace Security
38 PrivilegeInfo::PrivilegeInfo(void)
44 PrivilegeInfo::~PrivilegeInfo(void)
50 PrivilegeInfo::Construct(const Tizen::Base::String& privilegeId)
54 SysAssertf(__pImpl == null,
55 "Already constructed. Calling Construct() twice or more on a same in stance is not allowed for this class.");
57 __pImpl = new (std::nothrow) _PrivilegeInfoImpl;
58 SysTryReturnResult(NID_SEC, __pImpl != null, E_OUT_OF_MEMORY, "");
60 r = __pImpl->Construct(privilegeId);
61 SysTryCatch(NID_SEC, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
74 PrivilegeInfo::GetId(void) const
76 SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
78 return __pImpl->GetId();
83 PrivilegeInfo::GetDisplayName(void) const
85 SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
87 return __pImpl->GetDisplayName();
91 PrivilegeInfo::GetDescription(void) const
93 SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
95 return __pImpl->GetDescription();