harmony 鸿蒙oh_preferences_value.h
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
Types
Name | Description |
---|---|
typedef enum Preference_ValueType Preference_ValueType | Defines an enum for data types of PreferencesValue. |
typedef struct OH_PreferencesPair OH_PreferencesPair | Defines a Preferences data record in the key-value (KV) format. |
typedef struct OH_PreferencesValue OH_PreferencesValue | Defines a PreferencesValue object. |
Enums
Name | Description |
---|---|
Preference_ValueType { PREFERENCE_TYPE_NULL = 0, PREFERENCE_TYPE_INT, PREFERENCE_TYPE_BOOL, PREFERENCE_TYPE_STRING, PREFERENCE_TYPE_BUTT } |
Enumerates the data types of PreferencesValue. |
Functions
Name | Description |
---|---|
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 a PreferencesValue instance. |
int OH_PreferencesValue_GetInt (const OH_PreferencesValue *object, int *value) | Obtains an integer value 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. |
你可能感兴趣的鸿蒙文章
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦