}
-int icl_state_del_value(iotcon_state_h state, const char *key, iotcon_types_e value_type)
+int icl_state_del_value(iotcon_state_h state, const char *key)
{
gboolean ret = FALSE;
iotcon_value_h value = NULL;
return IOTCON_ERROR_NO_DATA;
}
- if (value_type != value->type) {
- ERR("Type matching Fail(input:%d, saved:%d)", value_type, value->type);
- return IOTCON_ERROR_INVALID_TYPE;
- }
-
ret = g_hash_table_remove(state->hash_table, key);
if (FALSE == ret) {
ERR("g_hash_table_remove(%s) Fail", key);
return IOTCON_ERROR_NONE;
}
-API int iotcon_state_del_int(iotcon_state_h state, const char *key)
+API int iotcon_state_del(iotcon_state_h state, const char *key)
{
int ret;
RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
- ret = icl_state_del_value(state, key, IOTCON_TYPE_INT);
+ ret = icl_state_del_value(state, key);
if (IOTCON_ERROR_NONE != ret)
ERR("icl_state_del_value() Fail(%d)", ret);
return IOTCON_ERROR_NONE;
}
-API int iotcon_state_del_bool(iotcon_state_h state, const char *key)
-{
- int ret;
-
- RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
-
- ret = icl_state_del_value(state, key, IOTCON_TYPE_BOOL);
- if (IOTCON_ERROR_NONE != ret)
- ERR("icl_state_del_value() Fail(%d)", ret);
-
- return ret;
-}
-
API int iotcon_state_get_double(iotcon_state_h state, const char *key, double *val)
{
icl_basic_s *real = NULL;
return IOTCON_ERROR_NONE;
}
-API int iotcon_state_del_double(iotcon_state_h state, const char *key)
-{
- int ret;
-
- RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
-
- ret = icl_state_del_value(state, key, IOTCON_TYPE_DOUBLE);
- if (IOTCON_ERROR_NONE != ret)
- ERR("icl_state_del_value() Fail(%d)", ret);
-
- return ret;
-}
-
API int iotcon_state_get_str(iotcon_state_h state, const char *key, char **val)
{
icl_basic_s *real = NULL;
return IOTCON_ERROR_NONE;
}
-API int iotcon_state_del_str(iotcon_state_h state, const char *key)
-{
- int ret;
-
- RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
-
- ret = icl_state_del_value(state, key, IOTCON_TYPE_STR);
- if (IOTCON_ERROR_NONE != ret)
- ERR("icl_state_del_value() Fail(%d)", ret);
-
- return ret;
-}
-
API int iotcon_state_is_null(iotcon_state_h state, const char *key, bool *is_null)
{
icl_basic_s *real = NULL;
return IOTCON_ERROR_NONE;
}
-API int iotcon_state_del_null(iotcon_state_h state, const char *key)
-{
- int ret;
-
- RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
-
- ret = icl_state_del_value(state, key, IOTCON_TYPE_NULL);
- if (IOTCON_ERROR_NONE != ret)
- ERR("icl_state_del_value() Fail(%d)", ret);
-
- return ret;
-}
-
API int iotcon_state_get_list(iotcon_state_h state, const char *key, iotcon_list_h *list)
{
iotcon_value_h value = NULL;
return IOTCON_ERROR_NONE;
}
-API int iotcon_state_del_list(iotcon_state_h state, const char *key)
-{
- int ret;
-
- RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
-
- ret = icl_state_del_value(state, key, IOTCON_TYPE_LIST);
- if (IOTCON_ERROR_NONE != ret)
- ERR("icl_state_del_value() Fail(%d)", ret);
-
- return ret;
-}
-
-
API int iotcon_state_get_state(iotcon_state_h src, const char *key, iotcon_state_h *dest)
{
icl_val_state_s *real = NULL;
return IOTCON_ERROR_NONE;
}
-API int iotcon_state_del_state(iotcon_state_h state, const char *key)
-{
- int ret;
-
- RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
-
- ret = icl_state_del_value(state, key, IOTCON_TYPE_STATE);
- if (IOTCON_ERROR_NONE != ret)
- ERR("icl_state_del_value() Fail(%d)", ret);
-
- return ret;
-}
-
API int iotcon_state_get_type(iotcon_state_h state, const char *key, int *type)
{
iotcon_value_h value = NULL;
int iotcon_state_is_null(iotcon_state_h state, const char *key, bool *is_null);
/**
- * @brief Deletes the key and its associated integer value from the state.
+ * @brief Deletes the key and its associated value from the state.
*
* @since_tizen 3.0
*
* @retval #IOTCON_ERROR_NONE Successful
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #IOTCON_ERROR_NO_DATA No data available
- * @retval #IOTCON_ERROR_INVALID_TYPE Invalid type
- */
-int iotcon_state_del_int(iotcon_state_h state, const char *key);
-
-/**
- * @brief Deletes the key and its associated boolean value from the state.
- *
- * @since_tizen 3.0
- *
- * @param[in] state The state handle
- * @param[in] key The key
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #IOTCON_ERROR_NONE Successful
- * @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #IOTCON_ERROR_NO_DATA No data available
- * @retval #IOTCON_ERROR_INVALID_TYPE Invalid type
- */
-int iotcon_state_del_bool(iotcon_state_h state, const char *key);
-
-/**
- * @brief Deletes the key and its associated double value from the state.
- *
- * @since_tizen 3.0
- *
- * @param[in] state The state handle
- * @param[in] key The key
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #IOTCON_ERROR_NONE Successful
- * @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #IOTCON_ERROR_NO_DATA No data available
- * @retval #IOTCON_ERROR_INVALID_TYPE Invalid type
- */
-int iotcon_state_del_double(iotcon_state_h state, const char *key);
-
-/**
- * @brief Deletes the key and its associated string value from the state.
- *
- * @since_tizen 3.0
- *
- * @param[in] state The state handle
- * @param[in] key The key
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #IOTCON_ERROR_NONE Successful
- * @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #IOTCON_ERROR_NO_DATA No data available
- * @retval #IOTCON_ERROR_INVALID_TYPE Invalid type
- */
-int iotcon_state_del_str(iotcon_state_h state, const char *key);
-
-/**
- * @brief Deletes the key and its associated list value from the state.
- *
- * @since_tizen 3.0
- *
- * @param[in] state The state handle
- * @param[in] key The key
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #IOTCON_ERROR_NONE Successful
- * @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #IOTCON_ERROR_NO_DATA No data available
- * @retval #IOTCON_ERROR_INVALID_TYPE Invalid type
- */
-int iotcon_state_del_list(iotcon_state_h state, const char *key);
-
-/**
- * @brief Deletes the key and its associated state value from the state.
- *
- * @since_tizen 3.0
- *
- * @param[in] state The state handle
- * @param[in] key The key
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #IOTCON_ERROR_NONE Successful
- * @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #IOTCON_ERROR_NO_DATA No data available
- * @retval #IOTCON_ERROR_INVALID_TYPE Invalid type
- */
-int iotcon_state_del_state(iotcon_state_h state, const char *key);
-
-/**
- * @brief Deletes the key from the state.
- *
- * @since_tizen 3.0
- *
- * @param[in] state The state handle
- * @param[in] key The key
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #IOTCON_ERROR_NONE Successful
- * @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #IOTCON_ERROR_NO_DATA No data available
- * @retval #IOTCON_ERROR_INVALID_TYPE Invalid type
*/
-int iotcon_state_del_null(iotcon_state_h state, const char *key);
+int iotcon_state_del(iotcon_state_h state, const char *key);
/**
* @brief Gets the type of a value at the given key.