1/*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @addtogroup PREFERENCES
18 * @{
19 *
20 * @brief Provides APIs for processing data in the form of key-value (KV) pairs.
21 * You can use the APIs provided by the Preferences module to query, modify, and persist KV pairs.
22 * The key is of the string type, and the value can be a number, a string, a boolean value.
23 *
24 * @since 13
25 */
26
27/**
28 * @file preferences_err_code.h
29 *
30 * @brief Defines the status codes used in the Preferences module.
31 *
32 * @kit ArkData
33 * @library libohpreferences.so
34 * @syscap SystemCapability.DistributedDataManager.Preferences.Core
35 *
36 * @since 13
37 */
38
39
40#ifndef OH_PREFERENCES_ERR_CODE_H
41#define OH_PREFERENCES_ERR_CODE_H
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47/**
48 * @brief Enumerates the status codes.
49 *
50 * @since 13
51 */
52typedef enum OH_Preferences_ErrCode {
53    /** @error Operation successful. */
54    PREFERENCES_OK = 0,
55    /* @error Invalid args. */
56    PREFERENCES_ERROR_INVALID_PARAM = 401,
57    /* @error Capability not supported. */
58    PREFERENCES_ERROR_NOT_SUPPORTED = 801,
59    /* @error Base error code. */
60    PREFERENCES_ERROR_BASE = 15500000,
61    /* @error Failed to delete a file. */
62    PREFERENCES_ERROR_DELETE_FILE = 15500010,
63    /* @error Storage error. */
64    PREFERENCES_ERROR_STORAGE = 15500011,
65    /* @error Failed to malloc memory. */
66    PREFERENCES_ERROR_MALLOC = 15500012,
67    /* @error Key not found error. */
68    PREFERENCES_ERROR_KEY_NOT_FOUND = 15500013,
69    /* @error Failed to get DataObsMgrClient. */
70    PREFERENCES_ERROR_GET_DATAOBSMGRCLIENT = 15500019,
71} OH_Preferences_ErrCode;
72
73#ifdef __cplusplus
74};
75#endif
76
77#endif // OH_PREFERENCES_ERR_CODE_H
78