Apply locale-dependent logic
[platform/framework/native/appfw.git] / src / io / FIoRegistry.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file        FIoRegistry.cpp
20  * @brief       This is the implementation file for %Registry class.
21  */
22
23 #include <new>
24 #include <limits.h>
25 #include <unique_ptr.h>
26
27 #include <FBaseInteger.h>
28 #include <FBaseDouble.h>
29 #include <FBaseFloat.h>
30 #include <FBaseUuId.h>
31 #include <FBaseString.h>
32 #include <FBaseByteBuffer.h>
33 #include <FBaseUtilStringTokenizer.h>
34 #include <FBaseResult.h>
35 #include <FBaseSysLog.h>
36 #include <FIoRegistry.h>
37
38 #include <FBase_StringConverter.h>
39 #include <FApp_AppInfo.h>
40 #include "FIo_RegistryImpl.h"
41
42 using namespace std;
43 using namespace Tizen::Base;
44 using namespace Tizen::Base::Utility;
45 using namespace Tizen::Base::Collection;
46
47 namespace Tizen { namespace Io
48 {
49
50 Registry::Registry(void)
51         : __pRegistryImpl(null)
52 {
53 }
54
55 Registry::~Registry(void)
56 {
57         delete __pRegistryImpl;
58         __pRegistryImpl = null;
59 }
60
61 // This method will be removed in a future release.
62 result
63 Registry::Construct(const String& regPath, bool createIfNotExist)
64 {
65         SysAssertf(__pRegistryImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
66
67         long openMode = REG_OPEN_READ_WRITE;
68         if (createIfNotExist)
69         {
70                 openMode |= REG_OPEN_CREATE;
71         }
72
73         return Construct(regPath, openMode, null);
74 }
75
76 // This method will be removed in a future release.
77 result
78 Registry::Construct(const String& regPath, long openMode, long option)
79 {
80         SysAssertf(__pRegistryImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
81         SysTryReturnResult(NID_IO, regPath.GetLength() > 0 && regPath.GetLength() <= PATH_MAX, E_INVALID_ARG,
82                         "The length of the specified regPath is zero or exceeds system limitations.");
83
84         unique_ptr<_RegistryImpl> pRegistryImpl(new (std::nothrow) _RegistryImpl());
85         SysTryReturnResult(NID_IO, pRegistryImpl != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
86
87         result r = pRegistryImpl->Construct(regPath, openMode, null);
88         if (IsFailed(r))
89         {
90                 if (r == E_SYSTEM && Tizen::App::_AppInfo::IsOspCompat() == true)
91                 {
92                         r = E_IO;
93                 }
94                 SysPropagate(NID_IO, r);
95                 return r;
96         }
97         __pRegistryImpl = pRegistryImpl.release();
98
99         return E_SUCCESS;
100 }
101
102 result
103 Registry::Construct(const String& regPath, const char* pOpenMode)
104 {
105         SysAssertf(__pRegistryImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
106         SysTryReturnResult(NID_IO, regPath.GetLength() > 0 && regPath.GetLength() <= PATH_MAX, E_INVALID_ARG,
107                         "The length of the specified regPath is zero or exceeds system limitations.");
108
109         unique_ptr<_RegistryImpl> pRegistryImpl(new (std::nothrow) _RegistryImpl());
110         SysTryReturnResult(NID_IO, pRegistryImpl != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
111
112         result r = pRegistryImpl->Construct(regPath, pOpenMode, null);
113         SysTryReturn(NID_IO, !IsFailed(r), r, r, "[%s] Propagated.", GetErrorMessage(r));
114
115         __pRegistryImpl = pRegistryImpl.release();
116
117         return E_SUCCESS;
118 }
119
120 result
121 Registry::Construct(const String& regPath, const char* pOpenMode, const ByteBuffer& key)
122 {
123         SysAssertf(__pRegistryImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
124         SysTryReturnResult(NID_IO, regPath.GetLength() > 0 && regPath.GetLength() <= PATH_MAX, E_INVALID_ARG,
125                         "The length of the specified regPath is zero or exceeds system limitations.");
126
127         unique_ptr<_RegistryImpl> pRegistryImpl(new (std::nothrow) _RegistryImpl());
128         SysTryReturnResult(NID_IO, pRegistryImpl != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
129
130         result r = pRegistryImpl->Construct(regPath, pOpenMode, &key);
131         SysTryReturn(NID_IO, !IsFailed(r), r, r, "[%s] Propagated.", GetErrorMessage(r));
132
133         __pRegistryImpl = pRegistryImpl.release();
134
135         return E_SUCCESS;
136 }
137
138 result
139 Registry::Flush(void)
140 {
141         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
142         result r = E_SUCCESS;
143
144         r = __pRegistryImpl->Flush();
145         SysTryReturn(NID_IO, !IsFailed(r), r, r, "[%s] Flush failed.", GetErrorMessage(r));
146
147         return r;
148 }
149
150 result
151 Registry::AddSection(const String& sectionName)
152 {
153         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
154         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
155
156         return __pRegistryImpl->AddSection(sectionName);
157 }
158
159 result
160 Registry::RemoveSection(const String& sectionName)
161 {
162         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
163         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
164
165         return __pRegistryImpl->RemoveSection(sectionName);
166 }
167
168 IList*
169 Registry::GetAllSectionNamesN(void) const
170 {
171         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
172         result r = E_SUCCESS;
173         IList* pList = null;
174
175         r = __pRegistryImpl->GetSectionListN(&pList);
176         SysTryReturn(NID_IO, !IsFailed(r), null, r, "[%s] Propagating to caller...", GetErrorMessage(r));
177
178         SetLastResult(E_SUCCESS);
179         return pList;
180 }
181
182 IList*
183 Registry::GetAllEntryNamesN(const String& sectionName) const
184 {
185         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
186         return __pRegistryImpl->GetAllEntryNamesN(sectionName);
187 }
188
189 result
190 Registry::AddValue(const String& sectionName, const String& entryName, int entryValue)
191 {
192         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
193         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
194         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
195
196         return __pRegistryImpl->AddValue(sectionName, entryName, Integer::ToString(entryValue));
197 }
198
199 result
200 Registry::AddValue(const String& sectionName, const String& entryName, double entryValue)
201 {
202         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
203         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
204         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
205
206         return __pRegistryImpl->AddValue(sectionName, entryName, entryValue);
207 }
208
209 result
210 Registry::AddValue(const String& sectionName, const String& entryName, float entryValue)
211 {
212         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
213         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
214         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
215
216         return __pRegistryImpl->AddValue(sectionName, entryName, entryValue);
217 }
218
219 result
220 Registry::AddValue(const String& sectionName, const String& entryName, const String& entryValue)
221 {
222         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
223         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
224         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
225
226         return __pRegistryImpl->AddValue(sectionName, entryName, entryValue);
227 }
228
229 result
230 Registry::AddValue(const String& sectionName, const String& entryName, const UuId& entryValue)
231 {
232         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
233         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
234         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
235
236         return __pRegistryImpl->AddValue(sectionName, entryName, entryValue.ToString());
237 }
238
239 result
240 Registry::AddValue(const String& sectionName, const String& entryName, const ByteBuffer& entryValue)
241 {
242         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
243         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
244         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
245
246         int size = entryValue.GetLimit();
247         SysTryReturnResult(NID_IO, size > 0, E_INVALID_ARG, "invalid buffer length");
248
249         String strValEncoded;
250         String strVal;
251         result r = E_SUCCESS;
252         byte* pValue = const_cast< byte* >(entryValue.GetPointer());
253         SysAssert(pValue);
254
255         for (int i = 0; i < size; i++)
256         {
257                 r = strValEncoded.Format(3, L"%02x", (static_cast< unsigned char* >(pValue)[i]));
258                 if (IsFailed(r))
259                 {
260                         SysLog(NID_IO, "[%s] Propagated.", GetErrorMessage(r));
261                         return r;
262                 }
263                 r = strVal.Append(strValEncoded);
264                 if (IsFailed(r))
265                 {
266                         SysLog(NID_IO, "[%s] Propagated.", GetErrorMessage(r));
267                         return r;
268                 }
269         }
270
271         return __pRegistryImpl->AddValue(sectionName, entryName, strVal);
272 }
273
274 result
275 Registry::GetValue(const String& sectionName, const String& entryName, int& retVal) const
276 {
277         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
278         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
279         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
280
281         result r = E_SUCCESS;
282         String valStr;
283
284         r = __pRegistryImpl->GetValue(sectionName, entryName, valStr);
285         if (!IsFailed(r))
286         {
287                 r = Integer::Parse(valStr, retVal);
288                 if (IsFailed(r))
289                 {
290                         r = E_PARSING_FAILED;
291                 }
292         }
293
294         return r;
295 }
296
297 result
298 Registry::GetValue(const String& sectionName, const String& entryName, double& retVal) const
299 {
300         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
301         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
302         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
303
304         return __pRegistryImpl->GetValue(sectionName, entryName, retVal);
305 }
306
307 result
308 Registry::GetValue(const String& sectionName, const String& entryName, float& retVal) const
309 {
310         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
311         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
312         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
313
314         return __pRegistryImpl->GetValue(sectionName, entryName, retVal);
315 }
316
317 result
318 Registry::GetValue(const String& sectionName, const String& entryName, String& retVal) const
319 {
320         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
321         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
322         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
323
324         return __pRegistryImpl->GetValue(sectionName, entryName, retVal);
325 }
326
327 result
328 Registry::GetValue(const String& sectionName, const String& entryName, UuId& retVal) const
329 {
330         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
331         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
332         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
333
334         result r = E_SUCCESS;
335         String valStr;
336
337         r = __pRegistryImpl->GetValue(sectionName, entryName, valStr);
338         if (!IsFailed(r))
339         {
340                 r = UuId::Parse(valStr, retVal);
341                 if (IsFailed(r))
342                 {
343                         r = E_PARSING_FAILED;
344                 }
345         }
346
347         return r;
348 }
349
350 result
351 Registry::GetValue(const String& sectionName, const String& entryName, ByteBuffer& retVal) const
352 {
353         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
354         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
355         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
356
357         int size = retVal.GetLimit();
358         SysTryReturnResult(NID_IO, size > 0, E_INVALID_ARG, "Invalid buffer length");
359
360         result r = E_SUCCESS;
361         String valStr;
362
363         r = __pRegistryImpl->GetValue(sectionName, entryName, valStr);
364         if (!IsFailed(r))
365         {
366                 int length = valStr.GetLength();
367                 int length2 = (size * 2);
368                 int parseSize = (length2 <= length) ? length2 : length;
369                 byte* pRetVal = const_cast< byte* >(retVal.GetPointer());
370                 SysAssert(pRetVal);
371                 for (int i = 0, j = 0; i < parseSize; i++)
372                 {
373                         unsigned long ul = 0;
374                         wchar_t ch = valStr[i];
375                         wchar_t tmp[3];
376
377                         if ((ch >= L'0' && ch <= L'9') || (ch >= L'a' && ch <= L'f') || (ch >= L'A' && ch <= L'F'))
378                         {
379                                 tmp[i % 2] = ch;
380                                 if (i % 2)
381                                 {
382                                         tmp[2] = L'\0';
383                                         ul = wcstoul(tmp, null, 16);
384                                         (static_cast< unsigned char* >(pRetVal))[j++] = static_cast< unsigned char >(ul);
385                                 }
386                         }
387                         else
388                         {
389                                 return E_PARSING_FAILED;
390                         }
391
392                 }
393
394                 parseSize = parseSize/2;
395                 SysAssertf(parseSize <= size, "The specified ByteBuffer is not enough to get the entry value from registry file.");
396                 if (parseSize < size)
397                 {
398                         // resize buffer limit
399                         r = retVal.SetLimit(parseSize);
400                         SysTryReturn(NID_IO, !IsFailed(r), r, r, "[%s] Propagated.", GetErrorMessage(r));
401                 }
402         }
403         return r;
404 }
405
406 result
407 Registry::SetValue(const String& sectionName, const String& entryName, int newValue)
408 {
409         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
410         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
411         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
412
413         return __pRegistryImpl->SetValue(sectionName, entryName, Integer::ToString(newValue));
414 }
415
416 result
417 Registry::SetValue(const String& sectionName, const String& entryName, double newValue)
418 {
419         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
420         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
421         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
422
423         return __pRegistryImpl->SetValue(sectionName, entryName, newValue);
424 }
425
426 result
427 Registry::SetValue(const String& sectionName, const String& entryName, float newValue)
428 {
429         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
430         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
431         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
432
433         return __pRegistryImpl->SetValue(sectionName, entryName, newValue);
434 }
435
436 result
437 Registry::SetValue(const String& sectionName, const String& entryName, const String& newValue)
438 {
439         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
440         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName is empty");
441         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName is empty");
442         //SysTryReturnResult(NID_IO, newValue.GetLength() > 0, E_INVALID_ARG, "newValue is empty");
443
444         return __pRegistryImpl->SetValue(sectionName, entryName, newValue);
445 }
446
447 result
448 Registry::SetValue(const String& sectionName, const String& entryName, const UuId& newValue)
449 {
450         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
451         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
452         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
453
454         return __pRegistryImpl->SetValue(sectionName, entryName, newValue.ToString());
455 }
456
457 result
458 Registry::SetValue(const String& sectionName, const String& entryName, const ByteBuffer& newValue)
459 {
460         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
461         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
462         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
463
464         int size = newValue.GetLimit();
465         SysTryReturnResult(NID_IO, size > 0, E_INVALID_ARG, "invalid buffer length");
466
467         String strValEncoded;
468         String strVal;
469         result r = E_SUCCESS;
470         byte* pNewValue = const_cast< byte* >(newValue.GetPointer());
471         SysAssert(pNewValue);
472
473         for (int i = 0; i < size; i++)
474         {
475                 r = strValEncoded.Format(3, L"%02x", (static_cast< unsigned char* >(pNewValue)[i]));
476                 if (IsFailed(r))
477                 {
478                         SysLog(NID_IO, "[%s] Propagated.", GetErrorMessage(r));
479                         return r;
480                 }
481                 r = strVal.Append(strValEncoded);
482                 if (IsFailed(r))
483                 {
484                         SysLog(NID_IO, "[%s] Propagated.", GetErrorMessage(r));
485                         return r;
486                 }
487         }
488
489         return __pRegistryImpl->SetValue(sectionName, entryName, strVal);
490 }
491
492 result
493 Registry::RemoveValue(const String& sectionName, const String& entryName)
494 {
495         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
496         SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
497         SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
498
499         return __pRegistryImpl->RemoveValue(sectionName, entryName);
500 }
501
502 result
503 Registry::Remove(const String& regPath)
504 {
505         SysTryReturnResult(NID_IO, regPath.GetLength() > 0 && regPath.GetLength() <= PATH_MAX, E_INVALID_ARG,
506                                          "regPath.GetLength <= 0 or long name was given.");
507
508         return _RegistryImpl::Remove(regPath);
509 }
510
511 result
512 Registry::ConvertToSecureRegistry(const String& plainRegPath, const String& secureRegPath, const ByteBuffer& key)
513 {
514         SysTryReturnResult(NID_IO, plainRegPath.GetLength() > 0 && plainRegPath.GetLength() <= PATH_MAX, E_INVALID_ARG,
515                                          "plainRegPath.GetLength <= 0 or long name was given.");
516         SysTryReturnResult(NID_IO, secureRegPath.GetLength() > 0 && secureRegPath.GetLength() <= PATH_MAX, E_INVALID_ARG,
517                                          "secureRegPath.GetLength <= 0 or long name was given.");
518         SysTryReturnResult(NID_IO, key.GetLimit() > 0, E_INVALID_ARG, "key.GetLimit <= 0.");
519
520         return _RegistryImpl::ConvertToSecureRegistry(plainRegPath, secureRegPath, &key);
521 }
522
523 FileLock*
524 Registry::LockN(FileLockType lockType)
525 {
526         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
527         return __pRegistryImpl->LockN(lockType);
528 }
529
530 FileLock*
531 Registry::TryToLockN(FileLockType lockType)
532 {
533         SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
534         return __pRegistryImpl->TryToLockN(lockType);
535 }
536
537 }} // Tizen::Io
538