MongoDB C++ Driver
mongocxx-3.10.2
|
A validator is used to enable or disable specific checks that can be performed during BSON validation. More...
#include <validate.hpp>
Public Member Functions | |
validator () | |
Constructs a validator. | |
~validator () | |
Destructs a validator. | |
void | check_utf8 (bool check_utf8) |
Verify that all keys and string values are valid UTF-8. More... | |
bool | check_utf8 () const |
Getter for the current check_utf8 value of the underlying validator. More... | |
void | check_utf8_allow_null (bool check_utf8_allow_null) |
Verify that all keys and string values are valid UTF-8, but allow null bytes. More... | |
bool | check_utf8_allow_null () const |
Getter for the current check_utf8_allow_null value of the underlying validator. More... | |
void | check_dollar_keys (bool check_dollar_keys) |
Verifies that document keys are not preceeded with '$'. More... | |
bool | check_dollar_keys () const |
Getter for the current check_dollar_keys value of the underlying validator. More... | |
void | check_dot_keys (bool check_dot_keys) |
Verifies that document keys do not contain any '. More... | |
bool | check_dot_keys () const |
Getter for the current check_dot_keys value of the underlying validator. More... | |
A validator is used to enable or disable specific checks that can be performed during BSON validation.
bool bsoncxx::v_noabi::validator::check_dollar_keys | ( | ) | const |
Getter for the current check_dollar_keys value of the underlying validator.
void bsoncxx::v_noabi::validator::check_dollar_keys | ( | bool | check_dollar_keys | ) |
Verifies that document keys are not preceeded with '$'.
check_dollar_keys | If true, keys starting with '$' will be treated as invalid. |
bool bsoncxx::v_noabi::validator::check_dot_keys | ( | ) | const |
Getter for the current check_dot_keys value of the underlying validator.
void bsoncxx::v_noabi::validator::check_dot_keys | ( | bool | check_dot_keys | ) |
Verifies that document keys do not contain any '.
' characters.
check_dot_keys | If true, keys containing '.' will be treated as invalid. |
bool bsoncxx::v_noabi::validator::check_utf8 | ( | ) | const |
Getter for the current check_utf8 value of the underlying validator.
void bsoncxx::v_noabi::validator::check_utf8 | ( | bool | check_utf8 | ) |
Verify that all keys and string values are valid UTF-8.
check_utf8 | If true, UTF-8 validation is performed. |
bool bsoncxx::v_noabi::validator::check_utf8_allow_null | ( | ) | const |
Getter for the current check_utf8_allow_null value of the underlying validator.
void bsoncxx::v_noabi::validator::check_utf8_allow_null | ( | bool | check_utf8_allow_null | ) |
Verify that all keys and string values are valid UTF-8, but allow null bytes.
This is generally bad practice, but some languages such as Python, can sennd UTF-8 encoded strings with null bytes.
check_utf8_allow_null | If true, UTF-8 validation (with null bytes allowed) is performed. |