MongoDB C++ Driver mongocxx-3.11.0
Loading...
Searching...
No Matches
bsoncxx::v_noabi::validator Class Reference

#include <bsoncxx/v_noabi/bsoncxx/validate.hpp>

Description

A validator is used to enable or disable specific checks that can be performed during BSON validation.

Public Member Functions

 validator ()
 Constructs a validator.
 
 ~validator ()
 Destructs a validator.
 
bool check_dollar_keys () const
 Getter for the current check_dollar_keys value of the underlying validator.
 
void check_dollar_keys (bool check_dollar_keys)
 Verifies that document keys are not preceeded with '$'.
 
bool check_dot_keys () const
 Getter for the current check_dot_keys value of the underlying validator.
 
void check_dot_keys (bool check_dot_keys)
 Verifies that document keys do not contain any '.' characters.
 
bool check_utf8 () const
 Getter for the current check_utf8 value of the underlying validator.
 
void check_utf8 (bool check_utf8)
 Verify that all keys and string values are valid UTF-8.
 
bool check_utf8_allow_null () const
 Getter for the current check_utf8_allow_null value of the underlying validator.
 
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. This is generally bad practice, but some languages such as Python, can sennd UTF-8 encoded strings with null bytes.
 

Constructor & Destructor Documentation

◆ validator()

bsoncxx::v_noabi::validator::validator ( )

Constructs a validator.

◆ ~validator()

bsoncxx::v_noabi::validator::~validator ( )

Destructs a validator.

Member Function Documentation

◆ check_dollar_keys() [1/2]

bool bsoncxx::v_noabi::validator::check_dollar_keys ( ) const

Getter for the current check_dollar_keys value of the underlying validator.

Returns
True if keys starting with '$' will be treated as invalid.

◆ check_dollar_keys() [2/2]

void bsoncxx::v_noabi::validator::check_dollar_keys ( bool check_dollar_keys)

Verifies that document keys are not preceeded with '$'.

Parameters
check_dollar_keysIf true, keys starting with '$' will be treated as invalid.

◆ check_dot_keys() [1/2]

bool bsoncxx::v_noabi::validator::check_dot_keys ( ) const

Getter for the current check_dot_keys value of the underlying validator.

Returns
True if keys containing '.' will be treated as invalid.

◆ check_dot_keys() [2/2]

void bsoncxx::v_noabi::validator::check_dot_keys ( bool check_dot_keys)

Verifies that document keys do not contain any '.' characters.

Parameters
check_dot_keysIf true, keys containing '.' will be treated as invalid.

◆ check_utf8() [1/2]

bool bsoncxx::v_noabi::validator::check_utf8 ( ) const

Getter for the current check_utf8 value of the underlying validator.

Returns
True if UTF-8 validation is performed.

◆ check_utf8() [2/2]

void bsoncxx::v_noabi::validator::check_utf8 ( bool check_utf8)

Verify that all keys and string values are valid UTF-8.

Parameters
check_utf8If true, UTF-8 validation is performed.

◆ check_utf8_allow_null() [1/2]

bool bsoncxx::v_noabi::validator::check_utf8_allow_null ( ) const

Getter for the current check_utf8_allow_null value of the underlying validator.

Returns
True if UTF-8 validation (with null bytes allowed) is performed.

◆ check_utf8_allow_null() [2/2]

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.

Parameters
check_utf8_allow_nullIf true, UTF-8 validation (with null bytes allowed) is performed.

The documentation for this class was generated from the following file: