BSON-XS
view release on metacpan or search on metacpan
bson/bson.h view on Meta::CPAN
* See http://bsonspec.org for more information on this type.
*
* Returns: true if successful; false if append would overflow max size.
*/
bool
bson_append_maxkey (bson_t *bson,
const char *key,
int key_length);
/**
* bson_append_null:
* @bson: A bson_t.
* @key: The key for the field.
*
* Appends a new field to @bson with NULL for the value.
*
* Returns: true if successful; false if append would overflow max size.
*/
bool
bson_append_null (bson_t *bson,
const char *key,
int key_length);
/**
* bson_append_oid:
* @bson: A bson_t.
* @key: The key for the field.
* @oid: bson_oid_t.
*
* Appends a new field to the @bson of type BSON_TYPE_OID using the contents of
* @oid.
*
* Returns: true if successful; false if append would overflow max size.
*/
bool
bson_append_oid (bson_t *bson,
const char *key,
int key_length,
const bson_oid_t *oid);
/**
* bson_append_regex:
* @bson: A bson_t.
* @key: The key of the field.
* @regex: The regex to append to the bson.
* @options: Options for @regex.
*
* Appends a new field to @bson of type BSON_TYPE_REGEX. @regex should
* be the regex string. @options should contain the options for the regex.
*
* Valid options for @options are:
*
* 'i' for case-insensitive.
* 'm' for multiple matching.
* 'x' for verbose mode.
* 'l' to make \w and \W locale dependent.
* 's' for dotall mode ('.' matches everything)
* 'u' to make \w and \W match unicode.
*
* For more information on what comprimises a BSON regex, see bsonspec.org.
*
* Returns: true if successful; false if append would overflow max size.
*/
bool
bson_append_regex (bson_t *bson,
const char *key,
int key_length,
const char *regex,
const char *options);
/**
* bson_append_utf8:
* @bson: A bson_t.
* @key: The key for the field.
* @value: A UTF-8 encoded string.
* @length: The length of @value or -1 if it is NUL terminated.
*
* Appends a new field to @bson using @key as the key and @value as the UTF-8
* encoded value.
*
* It is the callers responsibility to ensure @value is valid UTF-8. You can
* use bson_utf8_validate() to perform this check.
*
* Returns: true if successful; false if append would overflow max size.
*/
bool
bson_append_utf8 (bson_t *bson,
const char *key,
int key_length,
const char *value,
int length);
/**
* bson_append_symbol:
* @bson: A bson_t.
* @key: The key for the field.
* @value: The symbol as a string.
* @length: The length of @value or -1 if NUL-terminated.
*
* Appends a new field to @bson of type BSON_TYPE_SYMBOL. This BSON type is
* deprecated and should not be used in new code.
*
* See http://bsonspec.org for more information on this type.
*
* Returns: true if successful; false if append would overflow max size.
*/
bool
bson_append_symbol (bson_t *bson,
const char *key,
int key_length,
const char *value,
int length);
/**
* bson_append_time_t:
( run in 2.891 seconds using v1.01-cache-2.11-cpan-99c4e6809bf )