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