MongoDB C++ Driver mongocxx-4.0.0
Loading...
Searching...
No Matches
server_api.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 <string>
18
21#include <mongocxx/pool-fwd.hpp>
22
25
27
28namespace mongocxx {
29namespace v_noabi {
30namespace options {
31
39 public:
43 enum class version {
45 };
46
59
72
85 version_from_string(bsoncxx::v_noabi::stdx::string_view version);
86
98
105 MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional<bool>&) strict() const;
106
118
125 MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional<bool>&)
127
135
136 private:
137 friend ::mongocxx::v_noabi::client;
138 friend ::mongocxx::v_noabi::pool;
139
140 version _version;
141 bsoncxx::v_noabi::stdx::optional<bool> _strict;
142 bsoncxx::v_noabi::stdx::optional<bool> _deprecation_errors;
143};
144
145} // namespace options
146} // namespace v_noabi
147} // namespace mongocxx
148
149#include <mongocxx/config/postlude.hpp>
150
Class representing the optional arguments to a MongoDB driver client object.
Definition client.hpp:39
Class representing the optional arguments to a MongoDB driver pool object. Pool options logically ext...
Definition pool.hpp:31
Class representing options for server API.
Definition server_api.hpp:38
static version version_from_string(bsoncxx::v_noabi::stdx::string_view version)
Converts a version string to its enum value.
static std::string version_to_string(version version)
Converts a version enum value to its string value.
version
Enum representing the possible values for server API version.
Definition server_api.hpp:43
const bsoncxx::v_noabi::stdx::optional< bool > & strict() const
Gets the current value of the strict option.
version get_version() const
Gets the declared server api version.
const bsoncxx::v_noabi::stdx::optional< bool > & deprecation_errors() const
Gets the current value of the deprecation errors option.
Declares mongocxx::v_noabi::client.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition fwd.hpp:204
The mongocxx macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
The top-level namespace within which all mongocxx library entities are declared.
The top-level namespace reserved for the C++ standard library.
Provides std::optional-related polyfills for library API usage.
Declares mongocxx::v_noabi::pool.
Declares mongocxx::v_noabi::options::server_api.
Provides std::string_view-related polyfills for library API usage.