FreeBSD Manual Pages
BSON_VALIDATE_...RROR_AND_OFFSET(3) libbsonBSON_VALIDATE_...RROR_AND_OFFSET(3) SYNOPSIS bool bson_validate_with_error_and_offset (const bson_t *bson, bson_validate_flags_t flags, size_t *offset, bson_error_t *error) PARAMETERS • bson: A bson_t. • flags: A bitwise-or of all desired bson_validate_flags_t. • offset: Optional location where the error offset will be written. • error: Optional bson_error_t. DESCRIPTION Validates a BSON document by walking through the document and inspect- ing the keys and values for valid content. You can modify how the validation occurs through the use of the flags parameter, see bson_validate_flags_t for details. RETURNS If bson passes the requested validations, returns true. Otherwise, re- turns false and writes each non-NULL output parameter: offset with the byte offset of the detected error and error with the details. The bson_error_t domain is set to BSON_ERROR_INVALID. Its code is set to one of the bson_validate_flags_t flags indicating which validation failed; for example, if a key contains invalid UTF-8, then the code is set to BSON_VALIDATE_UTF8, but if the basic structure of the BSON docu- ment is corrupt, the code is set to BSON_VALIDATE_NONE. The error mes- sage is filled out, and gives more detail if possible. SEE ALSO: bson_validate(), bson_validate_with_error(). bson_visitor_t can be used for custom validation, Example Custom Validation. AUTHOR MongoDB, Inc COPYRIGHT 2009-present, MongoDB, Inc. 1.30.2 Apr 12, 20BSON_VALIDATE_...RROR_AND_OFFSET(3)
SYNOPSIS | PARAMETERS | DESCRIPTION | RETURNS | AUTHOR | COPYRIGHT
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=bson_validate_with_error_and_offset&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>