openharmony 鸿蒙 capi-oh-preferences-value-h

2026-08-25 浏览 (1)

oh_preferences_value.h

Overview

Provides APIs, enums, and structs for accessing the PreferencesValue object.

File to include: <database/preferences/oh_preferences_value.h>

Library: libohpreferences.so

System capability: SystemCapability.DistributedDataManager.Preferences.Core

Since: 13

Related module: Preferences

Summary

Structs

Nametypedef KeywordDescription
OH_PreferencesPairOH_PreferencesPairDefines a struct for the Preferences data in KV format.
OH_PreferencesValueOH_PreferencesValueDefines a struct for the PreferencesValue object.

Enums

Nametypedef KeywordDescription
Preference_ValueTypePreference_ValueTypeEnumerates the data types of PreferencesValue.

Functions

NameDescription
const char *OH_PreferencesPair_GetKey(const OH_PreferencesPair *pairs, uint32_t index)Obtains the key based on the specified index from the KV data.
const OH_PreferencesValue *OH_PreferencesPair_GetPreferencesValue(const OH_PreferencesPair *pairs, uint32_t index)Obtains the value based on the specified index from the KV pairs.
Preference_ValueType OH_PreferencesValue_GetValueType(const OH_PreferencesValue *object)Obtains the data type of an OH_PreferencesValue instance.
int OH_PreferencesValue_GetInt(const OH_PreferencesValue *object, int *value)Obtains an integer from an OH_PreferencesValue instance.
int OH_PreferencesValue_GetBool(const OH_PreferencesValue *object, bool *value)Obtains a Boolean value from an OH_PreferencesValue instance.
int OH_PreferencesValue_GetString(const OH_PreferencesValue *object, char **value, uint32_t *valueLen)Obtains a string from an OH_PreferencesValue instance.
void OH_PreferencesPair_Destroy(OH_PreferencesPair *pairs, uint32_t count)Destroys an OH_PreferencesPair instance.
OH_PreferencesValue* OH_PreferencesValue_Create(void)Creates an OH_PreferencesValue instance.
void OH_PreferencesValue_Destroy(OH_PreferencesValue *value)Destroys an OH_PreferencesValue instance.
int OH_PreferencesValue_SetInt(const OH_PreferencesValue *object, int value)Sets an integer value for an OH_PreferencesValue instance.
int OH_PreferencesValue_SetBool(const OH_PreferencesValue *object, bool value)Sets a boolean value for an OH_PreferencesValue instance.
int OH_PreferencesValue_SetString(const OH_PreferencesValue *object, const char *value)Sets a string value for an OH_PreferencesValue instance.
int OH_PreferencesValue_SetInt64(const OH_PreferencesValue *object, int64_t value)Sets an int64 value for an OH_PreferencesValue instance.
int OH_PreferencesValue_GetInt64(const OH_PreferencesValue *object, int64_t *value)Obtains an int64 value from an OH_PreferencesValue instance.
int OH_PreferencesValue_SetDouble(const OH_PreferencesValue *object, double value)Sets a double value for an OH_PreferencesValue instance.
int OH_PreferencesValue_GetDouble(const OH_PreferencesValue *object, double *value)Obtains a double value from an OH_PreferencesValue instance.
int OH_PreferencesValue_SetIntArray(const OH_PreferencesValue *object, const int *value, uint32_t count)Sets an integer array for an OH_PreferencesValue instance.
int OH_PreferencesValue_GetIntArray(const OH_PreferencesValue *object, int **value, uint32_t *count)Obtains an integer array from an OH_PreferencesValue instance.
int OH_PreferencesValue_SetBoolArray(const OH_PreferencesValue *object, const bool *value, uint32_t count)Sets a boolean array for an OH_PreferencesValue instance.
int OH_PreferencesValue_GetBoolArray(const OH_PreferencesValue *object, bool **value, uint32_t *count)Obtains a boolean array from an OH_PreferencesValue instance.
int OH_PreferencesValue_SetStringArray(const OH_PreferencesValue *object, const char **value, uint32_t count)Sets a string array for an OH_PreferencesValue instance.
int OH_PreferencesValue_GetStringArray(const OH_PreferencesValue *object, char ***value, uint32_t *count)Obtains a string array of an OH_PreferencesValue instance.
int OH_PreferencesValue_SetInt64Array(const OH_PreferencesValue *object, const int64_t *value, uint32_t count)Sets an int64 array for an OH_PreferencesValue instance.
int OH_PreferencesValue_GetInt64Array(const OH_PreferencesValue *object, int64_t **value, uint32_t *count)Obtains an int64 array from an OH_PreferencesValue instance.
int OH_PreferencesValue_SetDoubleArray(const OH_PreferencesValue *object, const double *value, uint32_t count)Sets a double array for an OH_PreferencesValue instance.
int OH_PreferencesValue_GetDoubleArray(const OH_PreferencesValue *object, double **value, uint32_t *count)Obtains a double array of an OH_PreferencesValue instance.
int OH_PreferencesValue_SetBlob(const OH_PreferencesValue *object, const uint8_t *value, uint32_t count)Sets a blob value for an OH_PreferencesValue instance.
int OH_PreferencesValue_GetBlob(const OH_PreferencesValue *object, uint8_t **value, uint32_t *count)Obtains a blob value from an OH_PreferencesValue instance.

Enum Description

Preference_ValueType

enum Preference_ValueType

Description

Enumerates the data types of PreferencesValue.

Since: 13

Enum ItemDescription
PREFERENCE_TYPE_NULL = 0Null.
PREFERENCE_TYPE_INTInteger.
PREFERENCE_TYPE_BOOLBoolean.
PREFERENCE_TYPE_STRINGString.
PREFERENCE_TYPE_INT6464-bit integer.
Since: 23
PREFERENCE_TYPE_DOUBLEDouble.
Since: 23
PREFERENCE_TYPE_INT_ARRAYInteger array.
Since: 23
PREFERENCE_TYPE_BOOL_ARRAYBoolean array.
Since: 23
PREFERENCE_TYPE_STRING_ARRAYString array.
Since: 23
PREFERENCE_TYPE_INT64_ARRAY64-bit integer array.
Since: 23
PREFERENCE_TYPE_DOUBLE_ARRAYDouble array.
Since: 23
PREFERENCE_TYPE_BLOBBlob.
Since: 23
PREFERENCE_TYPE_BUTTEnd type.

Function Description

OH_PreferencesPair_GetKey()

const char *OH_PreferencesPair_GetKey(const OH_PreferencesPair *pairs, uint32_t index)

Description

Obtains the key based on the specified index from the KV data.

Since: 13

Parameters

NameDescription
const OH_PreferencesPair *pairsPointer to the target OH_PreferencesPair.
uint32_t indexIndex of the target OH_PreferencesPair.

Returns

TypeDescription
const char *Returns the pointer to the key obtained if the operation is successful; returns a null pointer if the operation fails or invalid parameters are specified.

OH_PreferencesPair_GetPreferencesValue()

const OH_PreferencesValue *OH_PreferencesPair_GetPreferencesValue(const OH_PreferencesPair *pairs, uint32_t index)

Description

Obtains the value based on the specified index from the KV pairs.

Since: 13

Parameters

NameDescription
const OH_PreferencesPair *pairsPointer to the target OH_PreferencesPair.
uint32_t indexIndex of the target OH_PreferencesPair.

Returns

TypeDescription
const OH_PreferencesValueReturns the pointer to the value obtained if the operation is successful; returns a null pointer if the operation fails or invalid parameters are specified.

OH_PreferencesValue_GetValueType()

Preference_ValueType OH_PreferencesValue_GetValueType(const OH_PreferencesValue *object)

Description

Obtains the data type of a PreferencesValue instance.

Since: 13

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the OH_PreferencesValue instance.

Returns

TypeDescription
Preference_ValueTypeReturns the obtained data type. If PREFERENCE_TYPE_NULL is returned, invalid parameters are passed in.

OH_PreferencesValue_GetInt()

int OH_PreferencesValue_GetInt(const OH_PreferencesValue *object, int *value)

Description

Obtains an integer from an OH_PreferencesValue instance.

Since: 13

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the OH_PreferencesValue instance.
int *valuePointer to the integer value obtained.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_GetBool()

int OH_PreferencesValue_GetBool(const OH_PreferencesValue *object, bool *value)

Description

Obtains a Boolean value from an OH_PreferencesValue instance.

Since: 13

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the OH_PreferencesValue instance.
bool *valuePointer to the Boolean value obtained.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_GetString()

int OH_PreferencesValue_GetString(const OH_PreferencesValue *object, char **value, uint32_t *valueLen)

Description

Obtains a string from an OH_PreferencesValue instance.

Since: 13

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the OH_PreferencesValue instance.
char **valueDouble pointer to the string obtained. If the string is not required, you can use OH_Preferences_FreeString to free the string (release the memory occupied by the string).
uint32_t *valueLenPointer to the length of the string obtained.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesPair_Destroy()

void OH_PreferencesPair_Destroy(OH_PreferencesPair *pairs, uint32_t count)

Description

Destroys an OH_PreferencesPair instance.

Since: 23

Parameters

NameDescription
OH_PreferencesPair *pairsPointer to the target OH_PreferencesPair instance.
uint32_t countSize of the KV array to be destroyed.

OH_PreferencesValue_Create()

OH_PreferencesValue* OH_PreferencesValue_Create(void)

Description

Creates an OH_PreferencesValue instance.

Since: 23

Returns

TypeDescription
OH_PreferencesValue*Returns the pointer to the OH_PreferencesValue object; returns a null pointer otherwise.

OH_PreferencesValue_Destroy()

void OH_PreferencesValue_Destroy(OH_PreferencesValue *value)

Description

Destroys an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
OH_PreferencesValue *valuePointer to the target OH_PreferencesValue instance.

OH_PreferencesValue_SetInt()

int OH_PreferencesValue_SetInt(const OH_PreferencesValue *object, int value)

Description

Sets an integer value for an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
int valueInteger value to be set.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_SetBool()

int OH_PreferencesValue_SetBool(const OH_PreferencesValue *object, bool value)

Description

Sets a boolean value for an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
bool valueBoolean value to be set.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_SetString()

int OH_PreferencesValue_SetString(const OH_PreferencesValue *object, const char *value)

Description

Sets a string value for an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
const char *valueString value to be set.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_SetInt64()

int OH_PreferencesValue_SetInt64(const OH_PreferencesValue *object, int64_t value)

Description

Sets an int64 value for an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
int64_t valueInt64 value to be set.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_GetInt64()

int OH_PreferencesValue_GetInt64(const OH_PreferencesValue *object, int64_t *value)

Description

Obtains an int64 value from an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
int64_t *valuePointer to the obtained int64 value.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_SetDouble()

int OH_PreferencesValue_SetDouble(const OH_PreferencesValue *object, double value)

Description

Sets a double value for an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
double valueDouble value to be set.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_GetDouble()

int OH_PreferencesValue_GetDouble(const OH_PreferencesValue *object, double *value)

Description

Obtains a double value from an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
double *valuePointer to the obtained double value.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_SetIntArray()

int OH_PreferencesValue_SetIntArray(const OH_PreferencesValue *object, const int *value, uint32_t count)

Description

Sets an integer array for an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
const int *valueInteger array to be set.
uint32_t countPointer to the size of the array to be set.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_GetIntArray()

int OH_PreferencesValue_GetIntArray(const OH_PreferencesValue *object, int **value, uint32_t *count)

Description

Obtains an integer array from an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
int **valueDouble pointer to the obtained integer array.
uint32_t *countPointer to the size of the array obtained.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_SetBoolArray()

int OH_PreferencesValue_SetBoolArray(const OH_PreferencesValue *object, const bool *value, uint32_t count)

Description

Sets a boolean array for an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
const bool *valueBoolean array to be set.
uint32_t countPointer to the size of the array to be set.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_GetBoolArray()

int OH_PreferencesValue_GetBoolArray(const OH_PreferencesValue *object, bool **value, uint32_t *count)

Description

Obtains a boolean array from an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
bool **valueDouble pointer to the obtained boolean array.
uint32_t *countPointer to the size of the array obtained.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_SetStringArray()

int OH_PreferencesValue_SetStringArray(const OH_PreferencesValue *object, const char **value, uint32_t count)

Description

Sets a string array for an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
const char **valueString array to be set.
uint32_t countPointer to the size of the array to be set.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_GetStringArray()

int OH_PreferencesValue_GetStringArray(const OH_PreferencesValue *object, char ***value, uint32_t *count)

Description

Obtains a string array of an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
char ***valueDouble pointer to the obtained string array.
uint32_t *countPointer to the size of the array obtained.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_SetInt64Array()

int OH_PreferencesValue_SetInt64Array(const OH_PreferencesValue *object, const int64_t *value, uint32_t count)

Description

Sets an int64 array for an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
const int64_t *valueInt64 array to be set.
uint32_t countPointer to the size of the array to be set.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_GetInt64Array()

int OH_PreferencesValue_GetInt64Array(const OH_PreferencesValue *object, int64_t **value, uint32_t *count)

Description

Obtains an int64 array from an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
int64_t **valueDouble pointer to the obtained int64 array.
uint32_t *countPointer to the size of the array obtained.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_SetDoubleArray()

int OH_PreferencesValue_SetDoubleArray(const OH_PreferencesValue *object, const double *value, uint32_t count)

Description

Sets a double array for an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
const double *valueDouble array to be set.
uint32_t countPointer to the size of the array to be set.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_GetDoubleArray()

int OH_PreferencesValue_GetDoubleArray(const OH_PreferencesValue *object, double **value, uint32_t *count)

Description

Obtains a double array of an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
double **valueDouble pointer to the obtained double array.
uint32_t *countPointer to the size of the array obtained.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_SetBlob()

int OH_PreferencesValue_SetBlob(const OH_PreferencesValue *object, const uint8_t *value, uint32_t count)

Description

Sets a blob value for an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
const uint8_t *valueBlob value to be set.
uint32_t countPointer to the size of the blob value to be set.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

OH_PreferencesValue_GetBlob()

int OH_PreferencesValue_GetBlob(const OH_PreferencesValue *object, uint8_t **value, uint32_t *count)

Description

Obtains a blob value from an OH_PreferencesValue instance.

Since: 23

Parameters

NameDescription
const OH_PreferencesValue *objectPointer to the target OH_PreferencesValue instance.
uint8_t **valueDouble pointer to the obtained blob value.
uint32_t *countPointer to the size of the blob value obtained.

Returns

TypeDescription
intReturns an error code.
PREFERENCES_OK indicates the operation is successful.
PREFERENCES_ERROR_INVALID_PARAM indicates invalid parameters are specified.
PREFERENCES_ERROR_STORAGE indicates a storage exception.
PREFERENCES_ERROR_MALLOC indicates a failure in memory allocation.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 js-apis-distributedKVStore-sys

openharmony 鸿蒙 capi-oh-preferences-h

openharmony 鸿蒙 capi-udmf-oh-udshyperlink

openharmony 鸿蒙 js-apis-data-dataSharePredicates

openharmony 鸿蒙 capi-udmf-oh-udsappitem

openharmony 鸿蒙 capi-rdb-oh-data-vbuckets

openharmony 鸿蒙 capi-rdb-oh-predicates

openharmony 鸿蒙 capi-rdb-oh-data-value

openharmony 鸿蒙 capi-preferences-oh-preferencespair

openharmony 鸿蒙 errorcode-datashare

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/5OCMun0y