1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
// automatically generated by rust-bindgen 0.71.1
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
use crate::rdb_types::Data_Asset;
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
impl Data_AssetStatus {
/// Means the status of asset is null.
pub const ASSET_NULL: Data_AssetStatus = Data_AssetStatus(0);
/// Means the status of asset is normal.
pub const ASSET_NORMAL: Data_AssetStatus = Data_AssetStatus(1);
/// Means the asset needs to be inserted.
pub const ASSET_INSERT: Data_AssetStatus = Data_AssetStatus(2);
/// Means the asset needs to be updated.
pub const ASSET_UPDATE: Data_AssetStatus = Data_AssetStatus(3);
/// Means the asset needs to be deleted.
pub const ASSET_DELETE: Data_AssetStatus = Data_AssetStatus(4);
/// Means the status of asset is abnormal.
pub const ASSET_ABNORMAL: Data_AssetStatus = Data_AssetStatus(5);
/// Means the status of asset is downloading.
pub const ASSET_DOWNLOADING: Data_AssetStatus = Data_AssetStatus(6);
}
#[repr(transparent)]
/// Describes the status of asset.
///
///
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Data_AssetStatus(pub ::core::ffi::c_uint);
extern "C" {
/// Set the name of the Data_Asset.
///
/// # Arguments
///
/// * `asset` - Represents a pointer to an [`Data_Asset`] instance.
///
/// * `name` - Indicates the name to set.
///
/// # Returns
///
/// * Returns a specific error code.
/// [`RDB_OK`] - success.
/// [`RDB_E_INVALID_ARGS`] - The error code for common invalid args.
/// Specific error codes can be referenced [`OH_Rdb_ErrCode`].
/// [`Data_Asset`]
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Data_Asset_SetName(
asset: *mut Data_Asset,
name: *const ::core::ffi::c_char,
) -> ::core::ffi::c_int;
/// Set the uri of the Data_Asset.
///
/// # Arguments
///
/// * `asset` - Represents a pointer to an [`Data_Asset`] instance.
///
/// * `uri` - Indicates the uri to set.
///
/// # Returns
///
/// * Returns a specific error code.
/// [`RDB_OK`] - success.
/// [`RDB_E_INVALID_ARGS`] - The error code for common invalid args.
/// Specific error codes can be referenced [`OH_Rdb_ErrCode`].
/// [`Data_Asset`]
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Data_Asset_SetUri(
asset: *mut Data_Asset,
uri: *const ::core::ffi::c_char,
) -> ::core::ffi::c_int;
/// Set the path of the Data_Asset.
///
/// # Arguments
///
/// * `asset` - Represents a pointer to an [`Data_Asset`] instance.
///
/// * `path` - Indicates the path to set.
///
/// # Returns
///
/// * Returns a specific error code.
/// [`RDB_OK`] - success.
/// [`RDB_E_INVALID_ARGS`] - The error code for common invalid args.
/// Specific error codes can be referenced [`OH_Rdb_ErrCode`].
/// [`Data_Asset`]
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Data_Asset_SetPath(
asset: *mut Data_Asset,
path: *const ::core::ffi::c_char,
) -> ::core::ffi::c_int;
/// Set the create time of the Data_Asset.
///
/// # Arguments
///
/// * `asset` - Represents a pointer to an [`Data_Asset`] instance.
///
/// * `createTime` - Indicates the create time to set.
///
/// # Returns
///
/// * Returns a specific error code.
/// [`RDB_OK`] - success.
/// [`RDB_E_INVALID_ARGS`] - The error code for common invalid args.
/// Specific error codes can be referenced [`OH_Rdb_ErrCode`].
/// [`Data_Asset`]
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Data_Asset_SetCreateTime(
asset: *mut Data_Asset,
createTime: i64,
) -> ::core::ffi::c_int;
/// Set the modify time of the Data_Asset.
///
/// # Arguments
///
/// * `asset` - Represents a pointer to an [`Data_Asset`] instance.
///
/// * `modifyTime` - Indicates the create time to set.
///
/// # Returns
///
/// * Returns a specific error code.
/// [`RDB_OK`] - success.
/// [`RDB_E_INVALID_ARGS`] - The error code for common invalid args.
/// Specific error codes can be referenced [`OH_Rdb_ErrCode`].
/// [`Data_Asset`]
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Data_Asset_SetModifyTime(
asset: *mut Data_Asset,
modifyTime: i64,
) -> ::core::ffi::c_int;
/// Set the size of the Data_Asset.
///
/// # Arguments
///
/// * `asset` - Represents a pointer to an [`Data_Asset`] instance.
///
/// * `size` - Indicates the size to set.
///
/// # Returns
///
/// * Returns a specific error code.
/// [`RDB_OK`] - success.
/// [`RDB_E_INVALID_ARGS`] - The error code for common invalid args.
/// Specific error codes can be referenced [`OH_Rdb_ErrCode`].
/// [`Data_Asset`]
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Data_Asset_SetSize(asset: *mut Data_Asset, size: usize) -> ::core::ffi::c_int;
/// Set the status of the Data_Asset.
///
/// # Arguments
///
/// * `asset` - Represents a pointer to an [`Data_Asset`] instance.
///
/// * `status` - Indicates the status to set. Specific status can be referenced [`Data_AssetStatus`].
///
/// # Returns
///
/// * Returns a specific error code.
/// [`RDB_OK`] - success.
/// [`RDB_E_INVALID_ARGS`] - The error code for common invalid args.
/// Specific error codes can be referenced [`OH_Rdb_ErrCode`].
/// [`Data_Asset,`] Data_AssetStatus
///
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Data_Asset_SetStatus(
asset: *mut Data_Asset,
status: Data_AssetStatus,
) -> ::core::ffi::c_int;
/// Obtains the name of the asset.
///
/// # Arguments
///
/// * `asset` - Represents a pointer to an [`Data_Asset`] instance.
///
/// * `name` - This parameter is the output parameter,
/// and the name of the asset as a char * is written to this variable.
///
/// * `length` - Indicates the length of the name.
///
/// # Returns
///
/// * Returns a specific error code.
/// [`RDB_ERR`] - Indicates that the function execution exception.
/// [`RDB_OK`] - success.
/// [`RDB_E_INVALID_ARGS`] - The error code for common invalid args.
/// Specific error codes can be referenced [`OH_Rdb_ErrCode`].
/// [`Data_Asset`]
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Data_Asset_GetName(
asset: *mut Data_Asset,
name: *mut ::core::ffi::c_char,
length: *mut usize,
) -> ::core::ffi::c_int;
/// Obtains the uri of the asset.
///
/// # Arguments
///
/// * `asset` - Represents a pointer to an [`Data_Asset`] instance.
///
/// * `uri` - This parameter is the output parameter,
/// and the uri of the asset as a char * is written to this variable.
///
/// * `length` - Indicates the length of the uri.
///
/// # Returns
///
/// * Returns a specific error code.
/// [`RDB_ERR`] - Indicates that the function execution exception.
/// [`RDB_OK`] - success.
/// [`RDB_E_INVALID_ARGS`] - The error code for common invalid args.
/// Specific error codes can be referenced [`OH_Rdb_ErrCode`].
/// [`Data_Asset`]
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Data_Asset_GetUri(
asset: *mut Data_Asset,
uri: *mut ::core::ffi::c_char,
length: *mut usize,
) -> ::core::ffi::c_int;
/// Obtains the path of the asset.
///
/// # Arguments
///
/// * `asset` - Represents a pointer to an [`Data_Asset`] instance.
///
/// * `path` - This parameter is the output parameter,
/// and the path of the asset as a char * is written to this variable.
///
/// * `length` - Indicates the length of the path.
///
/// # Returns
///
/// * Returns a specific error code.
/// [`RDB_ERR`] - Indicates that the function execution exception.
/// [`RDB_OK`] - success.
/// [`RDB_E_INVALID_ARGS`] - The error code for common invalid args.
/// Specific error codes can be referenced [`OH_Rdb_ErrCode`].
/// [`Data_Asset`]
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Data_Asset_GetPath(
asset: *mut Data_Asset,
path: *mut ::core::ffi::c_char,
length: *mut usize,
) -> ::core::ffi::c_int;
/// Obtains the create time of the asset.
///
/// # Arguments
///
/// * `asset` - Represents a pointer to an [`Data_Asset`] instance.
///
/// * `createTime` - This parameter is the output parameter,
/// and the create time of the asset as a int64_t is written to this variable.
///
/// # Returns
///
/// * Returns a specific error code.
/// [`RDB_ERR`] - Indicates that the function execution exception.
/// [`RDB_OK`] - success.
/// [`RDB_E_INVALID_ARGS`] - The error code for common invalid args.
/// Specific error codes can be referenced [`OH_Rdb_ErrCode`].
/// [`Data_Asset`]
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Data_Asset_GetCreateTime(
asset: *mut Data_Asset,
createTime: *mut i64,
) -> ::core::ffi::c_int;
/// Obtains the modify time of the asset.
///
/// # Arguments
///
/// * `asset` - Represents a pointer to an [`Data_Asset`] instance.
///
/// * `modifyTime` - This parameter is the output parameter,
/// and the create time of the asset as a int64_t is written to this variable.
///
/// # Returns
///
/// * Returns a specific error code.
/// [`RDB_ERR`] - Indicates that the function execution exception.
/// [`RDB_OK`] - success.
/// [`RDB_E_INVALID_ARGS`] - The error code for common invalid args.
/// Specific error codes can be referenced [`OH_Rdb_ErrCode`].
/// [`Data_Asset`]
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Data_Asset_GetModifyTime(
asset: *mut Data_Asset,
modifyTime: *mut i64,
) -> ::core::ffi::c_int;
/// Obtains the size of the asset.
///
/// # Arguments
///
/// * `asset` - Represents a pointer to an [`Data_Asset`] instance.
///
/// * `size` - This parameter is the output parameter,
/// and the size of the asset as a size_t is written to this variable.
///
/// # Returns
///
/// * Returns a specific error code.
/// [`RDB_ERR`] - Indicates that the function execution exception.
/// [`RDB_OK`] - success.
/// [`RDB_E_INVALID_ARGS`] - The error code for common invalid args.
/// Specific error codes can be referenced [`OH_Rdb_ErrCode`].
/// [`Data_Asset`]
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Data_Asset_GetSize(asset: *mut Data_Asset, size: *mut usize) -> ::core::ffi::c_int;
/// Obtains the status of the asset.
///
/// # Arguments
///
/// * `asset` - Represents a pointer to an [`Data_Asset`] instance.
///
/// * `status` - This parameter is the output parameter,
/// and the size of the status as a [`Data_AssetStatus`] is written to this variable.
///
/// # Returns
///
/// * Returns a specific error code.
/// [`RDB_OK`] - success.
/// [`RDB_E_INVALID_ARGS`] - The error code for common invalid args.
/// Specific error codes can be referenced [`OH_Rdb_ErrCode`].
/// [`Data_Asset`] Data_AssetStatus.
///
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Data_Asset_GetStatus(
asset: *mut Data_Asset,
status: *mut Data_AssetStatus,
) -> ::core::ffi::c_int;
/// Creates an [`Data_Asset`] instance.
///
///
/// # Returns
///
/// * If the creation is successful, a pointer to the instance of the Data_Asset} structure is returned,
/// otherwise NULL is returned.
/// [`Data_Asset.`]
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Data_Asset_CreateOne() -> *mut Data_Asset;
/// Destroy the [`Data_Asset`] object and reclaim the memory occupied by the object.
///
/// # Arguments
///
/// * `asset` - Represents a pointer to an [`Data_Asset`] instance.
///
/// # Returns
///
/// * Returns the status code of the execution. Successful execution returns RDB_OK,
/// while failure returns a specific error code.
/// [`RDB_OK`] - success.
/// Specific error codes can be referenced [`OH_Rdb_ErrCode`].
/// [`Data_Asset,`] OH_Rdb_ErrCode.
///
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Data_Asset_DestroyOne(asset: *mut Data_Asset) -> ::core::ffi::c_int;
/// Creates [`Data_Asset`] instances of given number.
///
/// # Arguments
///
/// * `count` - Represents the count of [`Data_Asset`] to create.
///
/// # Returns
///
/// * If the creation is successful, a pointer to the instance of the [`Data_Asset`] structure is returned.
/// If the creation is unsuccessful, NULL is returned.
/// [`Data_Asset.`]
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Data_Asset_CreateMultiple(count: u32) -> *mut *mut Data_Asset;
/// Destroy the [`Data_Asset`] objects and reclaim the memory occupied by the objects.
///
/// # Arguments
///
/// * `assets` - Represents a pointer to an [`Data_Asset`] instance.
///
/// * `count` - Represents the count of [`Data_Asset`] to destroy.
///
/// # Returns
///
/// * Returns the status code of the execution. Successful execution returns RDB_OK,
/// while failure returns a specific error code.
/// [`RDB_OK`] - success.
/// Specific error codes can be referenced [`OH_Rdb_ErrCode`].
/// [`Data_Asset,`] OH_Rdb_ErrCode.
///
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Data_Asset_DestroyMultiple(
assets: *mut *mut Data_Asset,
count: u32,
) -> ::core::ffi::c_int;
}