//
-// Open Service Platform
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
}
result
-Registry::AddValue(const String& sectionName, const String& entryName, int value)
+Registry::AddValue(const String& sectionName, const String& entryName, int entryValue)
{
SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
- return __pRegistryImpl->AddValue(sectionName, entryName, Integer::ToString(value));
+ return __pRegistryImpl->AddValue(sectionName, entryName, Integer::ToString(entryValue));
}
result
-Registry::AddValue(const String& sectionName, const String& entryName, double value)
+Registry::AddValue(const String& sectionName, const String& entryName, double entryValue)
{
SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
- return __pRegistryImpl->AddValue(sectionName, entryName, Double::ToString(value));
+ return __pRegistryImpl->AddValue(sectionName, entryName, entryValue);
}
result
-Registry::AddValue(const String& sectionName, const String& entryName, float value)
+Registry::AddValue(const String& sectionName, const String& entryName, float entryValue)
{
SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
- return __pRegistryImpl->AddValue(sectionName, entryName, Float::ToString(value));
+ return __pRegistryImpl->AddValue(sectionName, entryName, entryValue);
}
result
-Registry::AddValue(const String& sectionName, const String& entryName, const String& value)
+Registry::AddValue(const String& sectionName, const String& entryName, const String& entryValue)
{
SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
- return __pRegistryImpl->AddValue(sectionName, entryName, value);
+ return __pRegistryImpl->AddValue(sectionName, entryName, entryValue);
}
result
-Registry::AddValue(const String& sectionName, const String& entryName, const UuId& value)
+Registry::AddValue(const String& sectionName, const String& entryName, const UuId& entryValue)
{
SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
- return __pRegistryImpl->AddValue(sectionName, entryName, value.ToString());
+ return __pRegistryImpl->AddValue(sectionName, entryName, entryValue.ToString());
}
result
-Registry::AddValue(const String& sectionName, const String& entryName, const ByteBuffer& value)
+Registry::AddValue(const String& sectionName, const String& entryName, const ByteBuffer& entryValue)
{
SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
- int size = value.GetLimit();
+ int size = entryValue.GetLimit();
SysTryReturnResult(NID_IO, size > 0, E_INVALID_ARG, "invalid buffer length");
String strValEncoded;
String strVal;
result r = E_SUCCESS;
- byte* pValue = const_cast< byte* >(value.GetPointer());
+ byte* pValue = const_cast< byte* >(entryValue.GetPointer());
SysAssert(pValue);
for (int i = 0; i < size; i++)
SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
- result r = E_SUCCESS;
- String valStr;
-
- r = __pRegistryImpl->GetValue(sectionName, entryName, valStr);
- if (!IsFailed(r))
- {
- r = Double::Parse(valStr, retVal);
- if (IsFailed(r))
- {
- r = E_PARSING_FAILED;
- }
- }
-
- return r;
+ return __pRegistryImpl->GetValue(sectionName, entryName, retVal);
}
result
SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
- result r = E_SUCCESS;
- String valStr;
-
- r = __pRegistryImpl->GetValue(sectionName, entryName, valStr);
- if (!IsFailed(r))
- {
- r = Float::Parse(valStr, retVal);
- if (IsFailed(r))
- {
- r = E_PARSING_FAILED;
- }
- }
-
- return r;
+ return __pRegistryImpl->GetValue(sectionName, entryName, retVal);
}
result
SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
- return __pRegistryImpl->SetValue(sectionName, entryName, Double::ToString(newValue));
+ return __pRegistryImpl->SetValue(sectionName, entryName, newValue);
}
result
SysTryReturnResult(NID_IO, sectionName.GetLength() > 0, E_INVALID_ARG, "sectionName.GetLength() <= 0");
SysTryReturnResult(NID_IO, entryName.GetLength() > 0, E_INVALID_ARG, "entryName.GetLength() <= 0");
- return __pRegistryImpl->SetValue(sectionName, entryName, Float::ToString(newValue));
+ return __pRegistryImpl->SetValue(sectionName, entryName, newValue);
}
result
return _RegistryImpl::ConvertToSecureRegistry(plainRegPath, secureRegPath, &key);
}
+FileLock*
+Registry::LockN(FileLockType lockType)
+{
+ SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
+ return __pRegistryImpl->LockN(lockType);
+}
+
+FileLock*
+Registry::TryToLockN(FileLockType lockType)
+{
+ SysAssertf(__pRegistryImpl != null, "Not yet constructed. Construct() should be called before use.\n");
+ return __pRegistryImpl->TryToLockN(lockType);
+}
+
}} // Tizen::Io