• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 * Copyright (c) 2023 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 RDB
18  * @{
19  *
20  * @brief The relational database (RDB) store manages data based on relational models.
21  * With the underlying SQLite database, the RDB store provides a complete mechanism for managing local databases.
22  * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations
23  * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements.
24  *
25  * @since 10
26  */
27 
28 /**
29  * @file oh_value_object.h
30  *
31  * @brief Provides numeric type conversion functions.
32  *
33  * @kit ArkData
34  * @library libnative_rdb_ndk.so
35  * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
36  * @since 10
37  */
38 
39 #ifndef OH_VALUE_OBJECT_H
40 #define OH_VALUE_OBJECT_H
41 
42 #ifdef __cplusplus
43 #include <cstdint>
44 #else
45 #include <stdint.h>
46 #endif
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 /**
53  * @brief Define the OH_VObject structure type.
54  *
55  * @since 10
56  */
57 typedef struct OH_VObject OH_VObject;
58 
59 
60 /**
61  * @brief Define the OH_VObject structure type.
62  *
63  * @since 10
64  */
65 struct OH_VObject {
66     /**
67      * The id used to uniquely identify the OH_VObject struct.
68      */
69     int64_t id;
70 
71     /**
72      * @brief Convert the int64 input parameter to a value of type {@link OH_VObject}.
73      *
74      * @param valueObject Represents a pointer to an {@link OH_VObject} instance.
75      * @param value Represents a pointer to an int64_t input parameter or the array of type int64_t.
76      * @param count If value is a pointer to a single numerical value, count = 1;
77      * if value is a pointer to an array, count is the size of the array.
78      * @return Returns the status code of the execution.
79      * @see OH_VObject.
80      * @since 10
81      */
82     int (*putInt64)(OH_VObject *valueObject, int64_t *value, uint32_t count);
83 
84     /**
85      * @brief Convert the double input parameter to a value of type {@link OH_VObject}.
86      *
87      * @param valueObject Represents a pointer to an {@link OH_VObject} instance.
88      * @param value Represents a pointer to an double input parameter or the array of type double.
89      * @param count If value is a pointer to a single numerical value, count = 1;
90      * if value is a pointer to an array, count is the size of the array.
91      * @return Returns the status code of the execution.
92      * @see OH_VObject.
93      * @since 10
94      */
95     int (*putDouble)(OH_VObject *valueObject, double *value, uint32_t count);
96 
97     /**
98      * @brief Convert the char input parameter to a value of type {@link OH_VObject}.
99      *
100      * @param valueObject Represents a pointer to an {@link OH_VObject} instance.
101      * @param value Indicates the const char * input parameter.
102      * @return Returns the status code of the execution.
103      * @see OH_VObject.
104      * @since 10
105      */
106     int (*putText)(OH_VObject *valueObject, const char *value);
107 
108     /**
109      * @brief Convert the char * array input parameter to a value of type {@link OH_VObject}.
110      *
111      * @param valueObject Represents a pointer to an {@link OH_VObject} instance.
112      * @param value Indicates the const char * array input parameter.
113      * @param count Indicates the size of the value.
114      * @return Returns the status code of the execution.
115      * @see OH_VObject.
116      * @since 10
117      */
118     int (*putTexts)(OH_VObject *valueObject, const char **value, uint32_t count);
119 
120     /**
121      * @brief Destroy the {@link OH_VObject} object and reclaim the memory occupied by the object.
122      *
123      * @param valueObject Represents a pointer to an {@link OH_VObject} instance.
124      * @return Returns the status code of the execution.
125      * @see OH_VObject.
126      * @since 10
127      */
128     int (*destroy)(OH_VObject *valueObject);
129 };
130 
131 #ifdef __cplusplus
132 };
133 #endif
134 
135 /** @} */
136 
137 #endif // OH_VALUE_OBJECT_H
138