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 FSys_SystemResource.cpp
19 * @brief This is the implementation for the _SystemResource class.
25 #include <FBaseResult.h>
26 #include <FBaseString.h>
28 #include <FBaseSysLog.h>
30 #include "FSys_SystemResource.h"
33 using namespace Tizen::Base;
35 namespace Tizen { namespace System
38 _ResourceDomainId _RESOURCE_DOMAIN_ID_OSP = "osp";
40 _SystemResource* _SystemResource::__pSystemRsrc = null;
42 _SystemResource::_SystemResource(void)
47 _SystemResource::~_SystemResource(void)
52 _SystemResource::InitSystemResource(void)
54 static _SystemResource systemResource;
55 __pSystemRsrc = &systemResource;
59 _SystemResource::GetInstance(void)
61 static pthread_once_t once_block = PTHREAD_ONCE_INIT;
62 if(__pSystemRsrc == null)
64 pthread_once(&once_block, InitSystemResource);
71 _SystemResource::GetString(_ResourceDomainId domainId, _ResourceId resourceId) const
73 return String(dgettext(domainId, resourceId));
79 _SystemResource::GetString(_SystemStringId id) const
81 static const char* const systemStringTable[] =
85 _L(IDS_COM_SK_CANCEL),
86 _L(IDS_COM_POP_SELECT_DEFAULT_APPLICATION),
87 _L(IDS_COM_POP_DEFAULT_APPLICATION),
88 _L(IDS_COM_POP_APPLICATION_TYPE),
91 return GetString(_RESOURCE_DOMAIN_ID_OSP, systemStringTable[id]);