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 FSys_SystemResource.cpp
20 * @brief This is the implementation for the _SystemResource class.
26 #include <FBaseResult.h>
27 #include <FBaseString.h>
29 #include <FBaseSysLog.h>
31 #include "FSys_SystemResource.h"
34 using namespace Tizen::Base;
36 namespace Tizen { namespace System
39 _ResourceDomainId _RESOURCE_DOMAIN_ID_OSP = "osp";
41 _SystemResource* _SystemResource::__pSystemRsrc = null;
43 _SystemResource::_SystemResource(void)
48 _SystemResource::~_SystemResource(void)
53 _SystemResource::InitSystemResource(void)
55 static _SystemResource systemResource;
56 __pSystemRsrc = &systemResource;
60 _SystemResource::GetInstance(void)
62 static pthread_once_t once_block = PTHREAD_ONCE_INIT;
63 if(__pSystemRsrc == null)
65 pthread_once(&once_block, InitSystemResource);
72 _SystemResource::GetString(_ResourceDomainId domainId, _ResourceId resourceId) const
74 return String(dgettext(domainId, resourceId));
80 _SystemResource::GetString(_SystemStringId id) const
82 static const char* const systemStringTable[] =
86 _L(IDS_COM_SK_CANCEL),
87 _L(IDS_COM_POP_SELECT_DEFAULT_APPLICATION),
88 _L(IDS_COM_POP_DEFAULT_APPLICATION),
89 _L(IDS_COM_POP_APPLICATION_TYPE),
92 return GetString(_RESOURCE_DOMAIN_ID_OSP, systemStringTable[id]);