MongoDB C++ Driver mongocxx-4.0.0
Loading...
Searching...
No Matches
bucket.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
20
22
26
28
29namespace mongocxx {
30namespace v_noabi {
31namespace options {
32namespace gridfs {
33
37class bucket {
38 public:
50
58 bucket_name() const;
59
72
79 MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional<std::int32_t>&)
81
94
102 const bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::read_concern>&)
104
124
132 const bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::read_preference>&)
134
148
156 const bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::write_concern>&)
158
159 private:
160 bsoncxx::v_noabi::stdx::optional<std::string> _bucket_name;
161 bsoncxx::v_noabi::stdx::optional<std::int32_t> _chunk_size_bytes;
162 bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::read_concern> _read_concern;
163 bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::read_preference> _read_preference;
164 bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::write_concern> _write_concern;
165};
166
167} // namespace gridfs
168} // namespace options
169} // namespace v_noabi
170} // namespace mongocxx
171
172#include <mongocxx/config/postlude.hpp>
173
A polyfill for std::optional<T>.
Definition optional.hpp:826
Class representing the optional arguments to a MongoDB GridFS bucket creation operation.
Definition bucket.hpp:37
const bsoncxx::v_noabi::stdx::optional< std::int32_t > & chunk_size_bytes() const
Gets the size of the chunks in the bucket.
const bsoncxx::v_noabi::stdx::optional< std::string > & bucket_name() const
Gets the name of the bucket.
bucket & bucket_name(std::string bucket_name)
Sets the name of the bucket. Defaults to 'fs'.
A class to represent the read concern. Read concern can be set at the client, database,...
Definition read_concern.hpp:57
Class representing a preference for how the driver routes read operations to members of a replica set...
Definition read_preference.hpp:64
Class representing the server-side requirement for reporting the success of a write operation....
Definition write_concern.hpp:60
#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::options::gridfs::bucket.
Provides mongocxx::v_noabi::read_concern.
Provides mongocxx::v_noabi::read_preference.
Provides mongocxx::v_noabi::write_concern.