harmony 鸿蒙oh_preferences_option.h

  • 2025-06-12
  • 浏览 (4)

oh_preferences_option.h

Overview

Provides APIs and structs for accessing the PreferencesOption object.

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

Library: libohpreferences.so

System capability: SystemCapability.DistributedDataManager.Preferences.Core

Since: 13

Related module: Preferences

Summary

Types

Name Description
typedef struct OH_PreferencesOption OH_PreferencesOption Defines a PreferencesOption object.
typedef enum Preferences_StorageType Preferences_StorageType Defines an enum for preferences storage types.

Enums

Name Description
Preferences_StorageType { PREFERENCES_STORAGE_XML = 0, PREFERENCES_STORAGE_GSKV } Enumerates the preferences storage types.

Functions

Name Description
int OH_PreferencesOption_SetStorageType (OH_PreferencesOption *option, Preferences_StorageType type) Sets the storage type for a preferences instance.
OH_PreferencesOption * OH_PreferencesOption_Create (void) Creates an OH_PreferencesOption instance and a pointer to it. If this pointer is no longer required, use OH_PreferencesOption_Destroy to destroy it. Otherwise, memory leaks may occur.
int OH_PreferencesOption_SetFileName (OH_PreferencesOption *option, const char *fileName) Sets the file name for an OH_PreferencesOption instance.
int OH_PreferencesOption_SetBundleName (OH_PreferencesOption *option, const char *bundleName) Sets the bundle name for an OH_PreferencesOption instance.
int OH_PreferencesOption_SetDataGroupId (OH_PreferencesOption *option, const char *dataGroupId) Sets the application group ID for an OH_PreferencesOption instance.
int OH_PreferencesOption_Destroy (OH_PreferencesOption *option) Destroys an OH_PreferencesOption instance.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkData (ArkData Management)

harmony 鸿蒙Data

harmony 鸿蒙OH_Cursor

harmony 鸿蒙OH_Predicates

harmony 鸿蒙OH_Rdb_Config

harmony 鸿蒙OH_Rdb_Store

harmony 鸿蒙OH_VBucket

harmony 鸿蒙OH_VObject

harmony 鸿蒙Preferences

harmony 鸿蒙_r_d_b

0  赞