MongoDB C++ Driver 4.1.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
validate.hpp
Go to the documentation of this file.
1// Copyright 2009-present MongoDB, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
17#include <cstdint>
18#include <memory>
19
21
24
26
27namespace bsoncxx {
28namespace v_noabi {
29
45validate(std::uint8_t const* data, std::size_t length);
46
69 std::uint8_t const* data,
70 std::size_t length,
71 validator const& validator,
72 std::size_t* invalid_offset = nullptr);
73
159
160} // namespace v_noabi
161} // namespace bsoncxx
162
163namespace bsoncxx {
164
166
167} // namespace bsoncxx
168
170
#define BSONCXX_ABI_EXPORT_CDECL(...)
Equivalent to BSONCXX_ABI_EXPORT with BSONCXX_ABI_CDECL.
Definition export.hpp:52
The bsoncxx v_noabi macro guard postlude header.
The bsoncxx v_noabi macro guard prelude header.
A polyfill for std::optional<T>.
Definition optional.hpp:800
Used to toggle checks which may be performed during BSON validation.
Definition validate.hpp:77
validator()
Constructs a validator.
void check_dot_keys(bool check_dot_keys)
Verifies that document keys do not contain any '.' characters.
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 p...
void check_utf8(bool check_utf8)
Verify that all keys and string values are valid UTF-8.
void check_dollar_keys(bool check_dollar_keys)
Verifies that document keys are not preceeded with '$'.
Provides bsoncxx::v_noabi::document::view.
Declares entities representing a BSON document.
Declares C++17 standard library polyfills.
Declares entities whose ABI stability is NOT guaranteed.
stdx::optional< document::view > validate(std::uint8_t const *data, std::size_t length)
Validates a BSON document. This is a simplified overload that will only do the bare minimum validatio...
The top-level namespace within which all bsoncxx library entities are declared.
Provides std::optional-related polyfills for library API usage.
Declares bsoncxx::v_noabi::validator.