• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# OH_VObject
2
3## Overview
4
5Defines a struct for allowed data types.
6
7**Since**: 10
8
9**Related module**: [RDB](capi-rdb.md)
10
11**Header file**: [oh_value_object.h](capi-oh-value-object-h.md)
12
13## Summary
14
15### Member Variables
16
17| Name      | Description                          |
18| ---------- | ------------------------------ |
19| int64_t id | Unique identifier of the **OH_VObject** struct.|
20
21### Member Functions
22
23| Name                                                        | Description                                                    |
24| ------------------------------------------------------------ | -------------------------------------------------------- |
25| [int (*putInt64)(OH_VObject *valueObject, int64_t *value, uint32_t count))](#putint64) | Converts a single parameter or an array of the int64 type into a value of the OH_VObject type. |
26| [int (*putDouble)(OH_VObject *valueObject, double *value, uint32_t count)](#putdouble) | Converts a single parameter or an array of the double type into a value of the OH_VObject type.|
27| [int (*putText)(OH_VObject *valueObject, const char *value)](#puttext) | Converts a character array of the char * type to a value of the OH_VObject type.        |
28| [int (*putTexts)(OH_VObject *valueObject, const char **value, uint32_t count)](#puttexts) | Converts a string array of the char * type to a value of the OH_VObject type.      |
29| [int (*destroy)(OH_VObject *valueObject)](#destroy)          | Destroys an **OH_VObject** object and reclaims the memory occupied.                    |
30
31## Member Function Description
32
33### putInt64()
34
35```
36int (*putInt64)(OH_VObject *valueObject, int64_t *value, uint32_t count))
37```
38
39**Description**
40
41Converts a single parameter or an array of the int64 type into a value of the OH_VObject type.
42
43**Since**: 10
44
45**Parameters**
46
47| Name                 | Description                                                        |
48| ----------------------- | ------------------------------------------------------------ |
49| OH_VObject *valueObject | Pointer to the **OH_VObject** instance.                              |
50| int64_t *value          | Pointer to the data to covert.               |
51| uint32_t count          | If **value** points to a single parameter, **count** is **1**. If **value** points to an array, **count** specifies the length of the array.|
52
53**Returns**
54
55| Type| Description                                      |
56| ---- | ------------------------------------------ |
57| int  | Returns **RDB_OK** if the operation is successful; returns an error code otherwise.|
58
59### putDouble()
60
61```
62int (*putDouble)(OH_VObject *valueObject, double *value, uint32_t count)
63```
64
65**Description**
66
67Converts a single parameter or an array of the double type into a value of the OH_VObject type.
68
69**Since**: 10
70
71**Parameters**
72
73| Name                 | Description                                                        |
74| ----------------------- | ------------------------------------------------------------ |
75| OH_VObject *valueObject | Pointer to the **OH_VObject** instance.                              |
76| double *value           | Pointer to the data to covert.                |
77| uint32_t count          | If **value** points to a single parameter, **count** is **1**. If **value** points to an array, **count** specifies the length of the array.|
78
79**Returns**
80
81| Type| Description                                      |
82| ---- | ------------------------------------------ |
83| int  | Returns **RDB_OK** if the operation is successful; returns an error code otherwise.|
84
85### putText()
86
87```
88int (*putText)(OH_VObject *valueObject, const char *value)
89```
90
91**Description**
92
93Converts a character array of the char * type to a value of the OH_VObject type.
94
95**Since**: 10
96
97**Parameters**
98
99| Name                 | Description                          |
100| ----------------------- | ------------------------------ |
101| OH_VObject *valueObject | Pointer to the **OH_VObject** instance.|
102| const char *value       | Pointer to the character array to convert.            |
103
104**Returns**
105
106| Type| Description                                      |
107| ---- | ------------------------------------------ |
108| int  | Returns **RDB_OK** if the operation is successful; returns an error code otherwise.|
109
110### putTexts()
111
112```
113int (*putTexts)(OH_VObject *valueObject, const char **value, uint32_t count)
114```
115
116**Description**
117
118Converts a string array of the char * type to a value of the OH_VObject type.
119
120**Since**: 10
121
122**Parameters**
123
124| Name                 | Description                           |
125| ----------------------- | ------------------------------- |
126| OH_VObject *valueObject | Pointer to the **OH_VObject** instance. |
127| const char **value      | Double pointer to the string array to convert.           |
128| uint32_t count          | Length of the string array to convert.|
129
130**Returns**
131
132| Type| Description                                      |
133| ---- | ------------------------------------------ |
134| int  | Returns **RDB_OK** if the operation is successful; returns an error code otherwise.|
135
136### destroy()
137
138```
139int (*destroy)(OH_VObject *valueObject)
140```
141
142**Description**
143
144Destroys an **OH_VObject** object and reclaims the memory occupied.
145
146**Since**: 10
147
148**Parameters**
149
150| Name                 | Description                          |
151| ----------------------- | ------------------------------ |
152| OH_VObject *valueObject | Pointer to the **OH_VObject** instance.|
153
154**Returns**
155
156| Type| Description                                      |
157| ---- | ------------------------------------------ |
158| int  | Returns **RDB_OK** if the operation is successful; returns an error code otherwise.|
159