{
if (__handle != null)
{
-
contacts_record_destroy(__handle, true);
}
{
contacts_filter_h filterHandle = null;
int ret = contacts_filter_create(__View::GetUri(), &filterHandle);
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
__filterHandle = filterHandle;
__destroyFilterHandle = true;
result AddString(unsigned int propertyId, contacts_match_str_flag_e match, const char* value)
{
int ret = contacts_filter_add_str(__filterHandle, propertyId, match, value);
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
return E_SUCCESS;
}
result AddInt(unsigned int propertyId, contacts_match_int_flag_e match, int value)
{
int ret = contacts_filter_add_int(__filterHandle, propertyId, match, value);
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
return E_SUCCESS;
}
result AddLongLong(unsigned int propertyId, contacts_match_int_flag_e match, long long int value)
{
int ret = contacts_filter_add_lli(__filterHandle, propertyId, match, value);
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
return E_SUCCESS;
}
result AddDouble(unsigned int propertyId, contacts_match_int_flag_e match, double value)
{
int ret = contacts_filter_add_double(__filterHandle, propertyId, match, value);
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
return E_SUCCESS;
}
result AddBool(unsigned int propertyId, bool value)
{
int ret = contacts_filter_add_bool(__filterHandle, propertyId, value);
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
return E_SUCCESS;
}
result AddOperator(contacts_filter_operator_e type)
{
int ret = contacts_filter_add_operator(__filterHandle, type);
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
return E_SUCCESS;
}
{
contacts_filter_h handle = filter.Get();
int ret = contacts_filter_add_filter(__filterHandle, handle);
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
return E_SUCCESS;
}
{
contacts_query_h queryHandle = null;
int ret = contacts_query_create(__View::GetUri(), &queryHandle);
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
__queryHandle = queryHandle;
result SetProjection(unsigned int propertyIds[], int count)
{
int ret = contacts_query_set_projection(__queryHandle, propertyIds, count);
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
return E_SUCCESS;
}
result SetDistinct(bool set)
{
int ret = contacts_query_set_distinct(__queryHandle, set);
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
return E_SUCCESS;
}
if (filterHandle != null)
{
int ret = contacts_query_set_filter(__queryHandle, filterHandle);
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
}
return E_SUCCESS;
result SetSort(unsigned int propertyId, bool ascending)
{
int ret = contacts_query_set_sort(__queryHandle, propertyId, ascending);
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
return E_SUCCESS;
}
contacts_list_h list = null;
int ret = contacts_db_get_records_with_query(query.Get(), offset, limit, &list);
- SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_OUT_OF_MEMORY, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_NO_DATA, null, E_OBJ_NOT_FOUND, "[%s] No matched item found.", GetErrorMessage(E_OBJ_NOT_FOUND));
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, null, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
+ SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_OUT_OF_MEMORY, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
+ SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_NO_DATA, null, E_OBJ_NOT_FOUND, "[%s] No matched item found. (%d)", GetErrorMessage(E_OBJ_NOT_FOUND), ret);
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, null, E_SYSTEM, "[%s] A system error has been occurred. (%d)", GetErrorMessage(E_SYSTEM), ret);
pSearchResult = new (std::nothrow) __SearchResult<__View>(list);
SysTryReturn(NID_SCL, pSearchResult != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
int count = 0;
int ret = contacts_db_get_count_with_query(query.Get(), &count);
- SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_OUT_OF_MEMORY, -1, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, -1, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
+ SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_OUT_OF_MEMORY, -1, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, -1, E_SYSTEM, "[%s] A system error has been occurred. (%d)", GetErrorMessage(E_SYSTEM), ret);
return count;
}
int count = 0;
int ret = contacts_db_get_count(__View::GetUri(), &count);
- SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_OUT_OF_MEMORY, -1, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, -1, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
+ SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_OUT_OF_MEMORY, -1, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, -1, E_SYSTEM, "[%s] A system error has been occurred. (%d)", GetErrorMessage(E_SYSTEM), ret);
return count;
}
contacts_list_h list = null;
int ret = contacts_db_get_all_records(__View::GetUri(), offset, limit, &list);
- SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_OUT_OF_MEMORY, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, null, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
+ SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_OUT_OF_MEMORY, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, null, E_SYSTEM, "[%s] A system error has been occurred. (%d)", GetErrorMessage(E_SYSTEM), ret);
pSearchResult = new (std::nothrow) __SearchResult<__View>(list);
SysTryReturn(NID_SCL, pSearchResult, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
contacts_list_h list = null;
int ret = contacts_db_get_changes_by_version(__View::GetUri(), id, current, &list, &latest);
- SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_OUT_OF_MEMORY, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, null, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
+ SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_OUT_OF_MEMORY, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, null, E_SYSTEM, "[%s] A system error has been occurred. (%d)", GetErrorMessage(E_SYSTEM), ret);
pSearchResult = new (std::nothrow) __SearchResult<__View>(list);
SysTryReturn(NID_SCL, pSearchResult, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
unsigned int count = 0;
contacts_list_h list = null;
int ret = contacts_db_get_changes_by_version(__View::GetUri(), id, current, &list, &latest);
- SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_OUT_OF_MEMORY, -1, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, -1, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
+ SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_OUT_OF_MEMORY, -1, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, -1, E_SYSTEM, "[%s] A system error has been occurred. (%d)", GetErrorMessage(E_SYSTEM), ret);
contacts_list_get_count(list, &count);
contacts_list_destroy(list, true);
contacts_record_h recordHandle = null;
int ret = contacts_record_create(pUri, &recordHandle);
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
return recordHandle;
}
static result InsertContactRecordN(contacts_record_h recordHandle, int& recordId)
{
int ret = contacts_db_insert_record(recordHandle, &recordId);
- SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_OUT_OF_MEMORY, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_FILE_NO_SPACE, E_STORAGE_FULL, E_STORAGE_FULL, "[%s] The storage is insufficient.", GetErrorMessage(E_STORAGE_FULL));
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_SYSTEM, E_SYSTEM, "[%s] A system error has been occurred.", GetErrorMessage(E_SYSTEM));
+ SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_OUT_OF_MEMORY, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
+ SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_FILE_NO_SPACE, E_STORAGE_FULL, E_STORAGE_FULL, "[%s] The storage is insufficient. (%d)", GetErrorMessage(E_STORAGE_FULL), ret);
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, E_SYSTEM, E_SYSTEM, "[%s] A system error has been occurred. (%d)", GetErrorMessage(E_SYSTEM), ret);
return E_SUCCESS;
contacts_record_h recordHandle = null;
int ret = contacts_db_get_record(pUri, recordId, &recordHandle);
- SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_OUT_OF_MEMORY, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_NO_DATA, null, E_OBJ_NOT_FOUND, "[%s] The record %d is not found.", GetErrorMessage(E_OBJ_NOT_FOUND), recordId);
- SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, null, E_SYSTEM, "[%s] A system error has been occurred. Record Id(%d)", GetErrorMessage(E_SYSTEM), recordId);
+ SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_OUT_OF_MEMORY, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed. (%d)", GetErrorMessage(E_OUT_OF_MEMORY), ret);
+ SysTryReturn(NID_SCL, ret != CONTACTS_ERROR_NO_DATA, null, E_OBJ_NOT_FOUND, "[%s] The record %d is not found. (%d)", GetErrorMessage(E_OBJ_NOT_FOUND), recordId, ret);
+ SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, null, E_SYSTEM, "[%s] A system error has been occurred. Record Id(%d). (%d)", GetErrorMessage(E_SYSTEM), recordId, ret);
return recordHandle;
}