bson_writer_new (3) - Linux Manuals
bson_writer_new: Creates a new instance of bson_writer_t using the buffer, length, offset, and _realloc()_ function supplied.
Command to display bson_writer_new
manual in Linux: $ man 3 bson_writer_new
NAME
bson_writer_new() - Creates a new instance of bson_writer_t using the buffer, length, offset, and _realloc()_ function supplied.
SYNOPSIS
bson_writer_t *
bson_writer_new (uint8_t **buf,
size_t *buflen,
size_t offset,
bson_realloc_func realloc_func,
void *realloc_func_ctx);
PARAMETERS
- buf
-
A uint8_t.
- buflen
-
A size_t.
- offset
-
A size_t.
- realloc_func
-
A bson_realloc_func.
- realloc_func_ctx
-
A bson_realloc_func.
DESCRIPTION
Creates a new instance of
bson_writer_t
using the
buffer
,
length
,
offset
, and _realloc()_ function supplied.
The caller is expected to clean up the structure when finished using
bson_writer_destroy(3)
\&.
RETURNS
A newly allocated bson_writer_t.
COLOPHON
This page is part of libbson.
Please report any bugs at
https://jira.mongodb.org/browse/CDRIVER.
Pages related to bson_writer_new
- bson_writer_begin (3) - Begins writing a new document. The caller may use the bson structure to write out a new BSON document. When completed, the caller must call either bson_writer_end() or bson_writer_rollback().
- bson_writer_destroy (3) - Cleanup after writer and release any allocated memory. Note that the buffer supplied to bson_writer_new() is NOT freed from this method. The caller is responsible for that.
- bson_writer_end (3) - Complete writing of a bson_writer_t to the buffer supplied.
- bson_writer_get_length (3) - Fetches the current length of the content written by the buffer (including the initial offset). This includes a partly written document currently being written.
- bson_writer_rollback (3) - Abort the appending of the current bson_t to the memory region managed by writer. This is useful if you detected that you went past a particular memory limit. For example, MongoDB has 48MB message limits.
- bson_writer_t (3) - Bulk BSON serialization Abstraction
- bson_append_array (3) - The bson_append_array() function shall append child to bson using the specified key. The type of the field will be an array, but it is the responsibility of the caller to ensure that the keys of child are properly formatted with string keys such as "0", "1", "2" and so forth.
- bson_append_array_begin (3) - The bson_append_array_begin() function shall begin appending an array field to bson. This allows for incrementally building a sub-array. Doing so will generally yield better performance as you will serialize to a single buffer. When done building the sub-array, the caller MUST call bson_append_array_end().
- bson_append_array_end (3) - The bson_append_array_end() function shall complete the appending of an array field started with bson_append_array_begin(). child is invalid after calling this function.