}
std::unique_ptr<char[]> pName(new (std::nothrow) char[length + 1]);
- SysTryReturn(NID_UIX, pName != null, Tizen::Base::String(""), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY))
+ SysSecureTryReturn(NID_UIX, pName != null, Tizen::Base::String(""), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY))
//set data to char pointer, with allocated memory
__pImageFeatureInfoImpl->GetDescription(pName.get(), length + 1);
ImageFeatureInfo::GetThumbnailN(void) const
{
int bufWidth = __pImageFeatureInfoImpl->GetThumbnailWidth();
- SysTryReturn(NID_UIX, bufWidth > 0, null, E_FAILURE, "[%s] Failed to get thumbnail width.", GetErrorMessage(E_FAILURE));
+ SysSecureTryReturn(NID_UIX, bufWidth > 0, null, E_FAILURE, "[%s] Failed to get thumbnail width.", GetErrorMessage(E_FAILURE));
int bufHeight = __pImageFeatureInfoImpl->GetThumbnailHeight();
- SysTryReturn(NID_UIX, bufHeight > 0, null, E_FAILURE, "[%s] Failed to get thumbnail height.", GetErrorMessage(E_FAILURE));
+ SysSecureTryReturn(NID_UIX, bufHeight > 0, null, E_FAILURE, "[%s] Failed to get thumbnail height.", GetErrorMessage(E_FAILURE));
std::unique_ptr<Tizen::Base::ByteBuffer> pOutBuffer(new (std::nothrow) Tizen::Base::ByteBuffer());
- SysTryReturn(NID_UIX, pOutBuffer != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysSecureTryReturn(NID_UIX, pOutBuffer != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
result res = pOutBuffer->Construct(bufWidth * bufHeight);
- SysTryReturn(NID_UIX, res == E_SUCCESS, null, res, "[%s] Failed to construct ByteBuffer.", GetErrorMessage(res));
+ SysSecureTryReturn(NID_UIX, res == E_SUCCESS, null, res, "[%s] Failed to construct ByteBuffer.", GetErrorMessage(res));
bool success = __pImageFeatureInfoImpl->GetThumbnail((char*)pOutBuffer->GetPointer(), bufWidth, bufHeight, false);
- SysTryReturn(NID_UIX, success == true, null, E_FAILURE, "[%s] Failed to get thumbnail.", GetErrorMessage(E_FAILURE));
+ SysSecureTryReturn(NID_UIX, success == true, null, E_FAILURE, "[%s] Failed to get thumbnail.", GetErrorMessage(E_FAILURE));
return pOutBuffer.release();
}
"Calling Construct() twice or more on a same instance is not allowed for this class.");
std::unique_ptr<_ImageFeatureManagerImpl> pImageFeatureManagerImpl (new (std::nothrow) _ImageFeatureManagerImpl());
- SysTryReturn(NID_UIX, pImageFeatureManagerImpl != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysSecureTryReturn(NID_UIX, pImageFeatureManagerImpl != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
__pImageFeatureManagerImpl = pImageFeatureManagerImpl.release();
__pImageFeatureManagerImpl->InitDB();
{
SysAssertf(__pImageFeatureManagerImpl != null, "Not yet constructed! Consruct() should be called before use.");
- SysTryReturn(NID_UIX, featureIndex >= 0, E_FAILURE, E_INVALID_ARG,
+ SysSecureTryReturn(NID_UIX, featureIndex >= 0, E_FAILURE, E_INVALID_ARG,
"index should be greater than 0. [E_INVALID_ARG]");
return __pImageFeatureManagerImpl->DeleteFeature(featureIndex) ? E_SUCCESS : E_FAILURE;
ImageFeatureManager::DeleteAllFeatures(void)
{
SysAssertf(__pImageFeatureManagerImpl != null, "Not yet constructed! Consruct() should be called before use.");
- SysTryReturnResult(NID_UIX, __pImageFeatureManagerImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY]");
+ SysSecureTryReturnResult(NID_UIX, __pImageFeatureManagerImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY]");
__pImageFeatureManagerImpl->ReleaseDB();
__pImageFeatureManagerImpl->InitDB();
return E_SUCCESS;
SysAssertf(__pImageFeatureManagerImpl != null, "Not yet constructed! Consruct() should be called before use.");
- SysTryReturn(NID_UIX, width > 0 && height > 0, -1, E_INVALID_ARG,
+ SysSecureTryReturn(NID_UIX, width > 0 && height > 0, -1, E_INVALID_ARG,
"Width and height must me more than 0. [E_INVALID_ARG]");
const unsigned char* image = (unsigned char*) imageBuffer.GetPointer();
- SysTryReturn(NID_UIX, image != null, -1, E_INVALID_ARG,
+ SysSecureTryReturn(NID_UIX, image != null, -1, E_INVALID_ARG,
"image pointer must not be null. [E_INVALID_ARG]");
return (int) __pImageFeatureManagerImpl->AddFeature(image, width, height, descr);
{
SysAssertf(__pImageFeatureManagerImpl != null, "Not yet constructed! Consruct() should be called before use.");
- SysTryReturn(NID_UIX, !imagePath.IsEmpty(), -1, E_INVALID_ARG,
+ SysSecureTryReturn(NID_UIX, !imagePath.IsEmpty(), -1, E_INVALID_ARG,
"image path must not be empty. [E_INVALID_ARG]");
- SysTryReturn(NID_UIX, Tizen::Io::File::IsFileExist(imagePath), -1, E_INVALID_ARG,
+ SysSecureTryReturn(NID_UIX, Tizen::Io::File::IsFileExist(imagePath), -1, E_INVALID_ARG,
"image path must exist. [E_INVALID_ARG]");
Tizen::Io::FileAttributes _fileAtt;
- SysTryReturn(NID_UIX, Tizen::Io::File::GetAttributes(imagePath, _fileAtt) == E_SUCCESS, -1, E_INVALID_ARG,
+ SysSecureTryReturn(NID_UIX, Tizen::Io::File::GetAttributes(imagePath, _fileAtt) == E_SUCCESS, -1, E_INVALID_ARG,
"image file must have attributes. [E_INVALID_ARG]");
- SysTryReturn(NID_UIX, !_fileAtt.IsDirectory(), -1, E_INVALID_ARG,
+ SysSecureTryReturn(NID_UIX, !_fileAtt.IsDirectory(), -1, E_INVALID_ARG,
"image file must exist. [E_INVALID_ARG]");
return (int) __pImageFeatureManagerImpl->AddFeature(imagePath);
{
SysAssertf(__pImageFeatureManagerImpl != null, "Not yet constructed! Consruct() should be called before use.");
- SysTryReturnResult(NID_UIX, !featureSetFilePath.IsEmpty(), E_INVALID_ARG,
+ SysSecureTryReturnResult(NID_UIX, !featureSetFilePath.IsEmpty(), E_INVALID_ARG,
"feature set path must not be empty. [E_INVALID_ARG]");
- SysTryReturnResult(NID_UIX, Tizen::Io::File::IsFileExist(featureSetFilePath), E_INVALID_ARG,
+ SysSecureTryReturnResult(NID_UIX, Tizen::Io::File::IsFileExist(featureSetFilePath), E_INVALID_ARG,
"feature set path must exist. [E_INVALID_ARG]");
Tizen::Io::FileAttributes _fileAtt;
- SysTryReturnResult(NID_UIX, Tizen::Io::File::GetAttributes(featureSetFilePath, _fileAtt) == E_SUCCESS, E_INVALID_ARG,
+ SysSecureTryReturnResult(NID_UIX, Tizen::Io::File::GetAttributes(featureSetFilePath, _fileAtt) == E_SUCCESS, E_INVALID_ARG,
"feature set file must have attributes. [E_INVALID_ARG]");
- SysTryReturnResult(NID_UIX, !_fileAtt.IsDirectory(), E_INVALID_ARG,
+ SysSecureTryReturnResult(NID_UIX, !_fileAtt.IsDirectory(), E_INVALID_ARG,
"feature set file must exist. [E_INVALID_ARG]");
return __pImageFeatureManagerImpl->OpenDB(featureSetFilePath) ? E_SUCCESS : E_FAILURE;
ImageFeatureManager::GetSupportedImageFileFormatsListN(void)
{
std::unique_ptr<Tizen::Base::Collection::ArrayListT<Tizen::Media::ImageFormat> > pFormatList(new (std::nothrow) Tizen::Base::Collection::ArrayListT<Tizen::Media::ImageFormat>);
- SysTryReturn(NID_UIX, pFormatList != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysSecureTryReturn(NID_UIX, pFormatList != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
pFormatList->Add(Tizen::Media::IMG_FORMAT_BMP);
pFormatList->Add(Tizen::Media::IMG_FORMAT_JPG);
"Calling Construct() twice or more on a same instance is not allowed for this class.");
std::unique_ptr<_ImageRecognizerImpl> pImageRecognizerImpl (new (std::nothrow) _ImageRecognizerImpl);
- SysTryReturn(NID_UIX, pImageRecognizerImpl != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysSecureTryReturn(NID_UIX, pImageRecognizerImpl != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
__pImageRecognizerImpl = pImageRecognizerImpl.release();
return E_SUCCESS;
{
SysAssertf(__pImageRecognizerImpl != null, "Not yet constructed! Consruct() should be called before use.");
- SysTryReturnResult(NID_UIX, width > 0 && height > 0, E_INVALID_ARG,
+ SysSecureTryReturnResult(NID_UIX, width > 0 && height > 0, E_INVALID_ARG,
"Width and height must me more than 0. [E_INVALID_ARG]");
return __pImageRecognizerImpl->SetImageSize(width, height) ? E_SUCCESS : E_FAILURE;
{
SysAssertf(__pImageRecognizerImpl != null, "Not yet constructed! Consruct() should be called before use.");
- SysTryReturn(NID_UIX, imageBuffer.GetPointer(), -1, E_INVALID_ARG,
+ SysSecureTryReturn(NID_UIX, imageBuffer.GetPointer(), -1, E_INVALID_ARG,
"imageBuffer must not be null. [E_INVALID_ARG]");
return __pImageRecognizerImpl->ProcessImage((unsigned char*) imageBuffer.GetPointer()) != -1 ? E_SUCCESS : E_FAILURE;
"Calling Construct() twice or more on a same instance is not allowed for this class.");
std::unique_ptr<_QrCodeGeneratorImpl> pQrCodeGeneratorImpl(new (std::nothrow) _QrCodeGeneratorImpl());
- SysTryReturn(NID_UIX, pQrCodeGeneratorImpl != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysSecureTryReturn(NID_UIX, pQrCodeGeneratorImpl != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
__pQrCodeGeneratorImpl = pQrCodeGeneratorImpl.release();
return E_SUCCESS;
{
SysAssertf(__pQrCodeGeneratorImpl != null, "Not yet constructed! Consruct() should be called before use.");
- SysTryReturnResult(NID_UIX, !message.IsEmpty(), null,
+ SysSecureTryReturnResult(NID_UIX, !message.IsEmpty(), null,
"message must not be empty. [E_INVALID_ARG]");
Tizen::Text::Utf8Encoding utf8;
__pQrCodeGeneratorImpl->GetSize(width, height);
std::unique_ptr<Tizen::Base::ByteBuffer> pBuffer(new (std::nothrow) Tizen::Base::ByteBuffer());
- SysTryReturn(NID_UIX, pBuffer != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysSecureTryReturn(NID_UIX, pBuffer != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
pBuffer->Construct(width * height);
{
SysAssertf(__pQrCodeGeneratorImpl != null, "Not yet constructed! Consruct() should be called before use.");
- SysTryReturnResult(NID_UIX, !message.IsEmpty(), E_INVALID_ARG,
+ SysSecureTryReturnResult(NID_UIX, !message.IsEmpty(), E_INVALID_ARG,
"message must not be empty. [E_INVALID_ARG]");
- SysTryReturnResult(NID_UIX, !imageFilePath.IsEmpty(), E_INVALID_ARG,
+ SysSecureTryReturnResult(NID_UIX, !imageFilePath.IsEmpty(), E_INVALID_ARG,
"image path must not be empty. [E_INVALID_ARG]");
Tizen::Text::Utf8Encoding utf8;
{
std::unique_ptr<Tizen::Base::Collection::ArrayListT<Tizen::Media::ImageFormat> > pFormatList(
new (std::nothrow) Tizen::Base::Collection::ArrayListT<Tizen::Media::ImageFormat>);
- SysTryReturn(NID_UIX, pFormatList != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysSecureTryReturn(NID_UIX, pFormatList != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
pFormatList->Add(Tizen::Media::IMG_FORMAT_BMP);
"Calling Construct() twice or more on a same instance is not allowed for this class.");
std::unique_ptr<_QrCodeRecognizerImpl> pQrCodeRecognizerImpl(new (std::nothrow) _QrCodeRecognizerImpl());
- SysTryReturn(NID_UIX, pQrCodeRecognizerImpl != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysSecureTryReturn(NID_UIX, pQrCodeRecognizerImpl != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
__pQrCodeRecognizerImpl = pQrCodeRecognizerImpl.release();
return __pQrCodeRecognizerImpl->Init() ? E_SUCCESS : E_FAILURE;
{
SysAssertf(__pQrCodeRecognizerImpl != null, "Not yet constructed! Consruct() should be called before use.");
- SysTryReturn(NID_UIX, width > 0 && height > 0, false, E_INVALID_ARG,
+ SysSecureTryReturn(NID_UIX, width > 0 && height > 0, false, E_INVALID_ARG,
"width and height must be greater then 0. [E_INVALID_ARG]");
return __pQrCodeRecognizerImpl->SetFrameSize(width, height) ? E_SUCCESS : E_FAILURE;
{
SysAssertf(__pQrCodeRecognizerImpl != null, "Not yet constructed! Consruct() should be called before use.");
- SysTryReturn(NID_UIX, imageBuffer.GetPointer(), false, E_INVALID_ARG,
+ SysSecureTryReturn(NID_UIX, imageBuffer.GetPointer(), false, E_INVALID_ARG,
"image buffer must not be null. [E_INVALID_ARG]");
return __pQrCodeRecognizerImpl->ProcessFrame((unsigned char*) imageBuffer.GetPointer()) ? E_SUCCESS : E_FAILURE;
result
_ImageFeatureManagerImpl::SaveDB(bool optimizeDatabase, const Tizen::Base::String* dbPath)
{
- SysTryReturnResult(NID_UIX, (!__path.IsEmpty()) || (null != dbPath), E_INVALID_ARG,
+ SysSecureTryReturnResult(NID_UIX, (!__path.IsEmpty()) || (null != dbPath), E_INVALID_ARG,
"You need to open some database first or specify path to save data. [E_INVALID_ARG]");
UpdateDB();
if (null != dbPath)
{
- SysTryReturnResult(NID_UIX, !dbPath->IsEmpty(), E_INVALID_ARG,
+ SysSecureTryReturnResult(NID_UIX, !dbPath->IsEmpty(), E_INVALID_ARG,
"database path must not be empty. [E_INVALID_ARG]");
Tizen::Text::Utf8Encoding utf8;
result = __imageFeatureManager->saveDB(optimizeDatabase, (const char*) utf8.GetBytesN(*dbPath)->GetPointer()) ? E_SUCCESS : E_FAILURE;