12 #ifndef _ASTARTE_BSON_SERIALIZER_H_
13 #define _ASTARTE_BSON_SERIALIZER_H_
31 deprecated(
"This sould never be used directly, use astarte_bson_serializer_handle_t")));
35 #pragma GCC diagnostic push
36 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
38 #pragma GCC diagnostic pop
39 } __attribute__((deprecated(
"Use the new typedefined astarte_bson_serializer_handle_t")));
41 #pragma GCC diagnostic push
42 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
44 #pragma GCC diagnostic pop
54 __attribute__((deprecated(
"Use astarte_bson_serializer_new instead")));
98 astarte_bson_serializer_handle_t bson,
void *out_buf,
int out_buf_len,
int *out_doc_size);
125 astarte_bson_serializer_handle_t bson,
const char *name,
double value);
136 astarte_bson_serializer_handle_t bson,
const char *name, int32_t value);
147 astarte_bson_serializer_handle_t bson,
const char *name, int64_t value);
159 astarte_bson_serializer_handle_t bson,
const char *name,
const void *value,
size_t size);
170 astarte_bson_serializer_handle_t bson,
const char *name,
const char *
string);
181 astarte_bson_serializer_handle_t bson,
const char *name, uint64_t epoch_millis);
192 astarte_bson_serializer_handle_t bson,
const char *name,
bool value);
203 astarte_bson_serializer_handle_t bson,
const char *name,
const void *document);
216 astarte_bson_serializer_handle_t bson,
const char *name,
const double *arr,
int count);
229 astarte_bson_serializer_handle_t bson,
const char *name,
const int32_t *arr,
int count);
242 astarte_bson_serializer_handle_t bson,
const char *name,
const int64_t *arr,
int count);
255 astarte_bson_serializer_handle_t bson,
const char *name,
const char *
const *arr,
int count);
269 const char *name,
const void *
const *arr,
const int *sizes,
int count);
283 astarte_bson_serializer_handle_t bson,
const char *name,
const int64_t *arr,
int count);
296 astarte_bson_serializer_handle_t bson,
const char *name,
const bool *arr,
int count);
Astarte types and defines.
astarte_err_t
Astarte return codes.
Definition: astarte.h:28
astarte_err_t astarte_bson_serializer_append_int32_array(astarte_bson_serializer_handle_t bson, const char *name, const int32_t *arr, int count)
append an int32 array
astarte_err_t astarte_bson_serializer_append_int64_array(astarte_bson_serializer_handle_t bson, const char *name, const int64_t *arr, int count)
append an int64 array
void astarte_bson_serializer_destroy(astarte_bson_serializer_handle_t bson)
destroy given BSON serializer instance.
void astarte_bson_serializer_append_document(astarte_bson_serializer_handle_t bson, const char *name, const void *document)
append a sub-BSON document.
void astarte_bson_serializer_append_int64(astarte_bson_serializer_handle_t bson, const char *name, int64_t value)
append an int64 value
void astarte_bson_serializer_append_boolean(astarte_bson_serializer_handle_t bson, const char *name, bool value)
append a boolean value
astarte_err_t astarte_bson_serializer_write_document(astarte_bson_serializer_handle_t bson, void *out_buf, int out_buf_len, int *out_doc_size)
copy BSON serializer internal buffer to a different buffer.
void astarte_bson_serializer_append_double(astarte_bson_serializer_handle_t bson, const char *name, double value)
append a double value
astarte_err_t astarte_bson_serializer_append_string_array(astarte_bson_serializer_handle_t bson, const char *name, const char *const *arr, int count)
append a string array
const void * astarte_bson_serializer_get_document(astarte_bson_serializer_handle_t bson, int *size)
getter for the BSON serializer internal buffer.
void astarte_bson_serializer_append_datetime(astarte_bson_serializer_handle_t bson, const char *name, uint64_t epoch_millis)
append a date time value
astarte_err_t astarte_bson_serializer_append_boolean_array(astarte_bson_serializer_handle_t bson, const char *name, const bool *arr, int count)
append a boolean array
void astarte_bson_serializer_append_binary(astarte_bson_serializer_handle_t bson, const char *name, const void *value, size_t size)
append a binary blob value
void astarte_bson_serializer_append_end_of_document(astarte_bson_serializer_handle_t bson)
append end of document marker.
size_t astarte_bson_serializer_document_size(astarte_bson_serializer_handle_t bson)
return the document size
astarte_bson_serializer_handle_t astarte_bson_serializer_new(void)
create a new instance of the BSON serializer.
void astarte_bson_serializer_append_string(astarte_bson_serializer_handle_t bson, const char *name, const char *string)
append an UTF-8 string
astarte_err_t astarte_bson_serializer_append_double_array(astarte_bson_serializer_handle_t bson, const char *name, const double *arr, int count)
append a double array
astarte_err_t astarte_bson_serializer_append_binary_array(astarte_bson_serializer_handle_t bson, const char *name, const void *const *arr, const int *sizes, int count)
append a binary blob array
void astarte_bson_serializer_append_int32(astarte_bson_serializer_handle_t bson, const char *name, int32_t value)
append an int32 value
void astarte_bson_serializer_init(astarte_bson_serializer_handle_t bson) __attribute__((deprecated("Use astarte_bson_serializer_new instead")))
initialize given BSON serializer.
astarte_err_t astarte_bson_serializer_append_datetime_array(astarte_bson_serializer_handle_t bson, const char *name, const int64_t *arr, int count)
append a date time array
Definition: astarte_bson_serializer.h:34
Definition: astarte_bson_serializer.h:26