MongoDB C++ Driver 4.1.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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(bsoncxx::v_noabi::stdx::optional<std::int32_t> const&)
81
94
103
123
132
146
155
156 private:
157 bsoncxx::v_noabi::stdx::optional<std::string> _bucket_name;
158 bsoncxx::v_noabi::stdx::optional<std::int32_t> _chunk_size_bytes;
159 bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::read_concern> _read_concern;
160 bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::read_preference> _read_preference;
161 bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::write_concern> _write_concern;
162};
163
164} // namespace gridfs
165} // namespace options
166} // namespace v_noabi
167} // namespace mongocxx
168
169#include <mongocxx/config/postlude.hpp>
170
A polyfill for std::optional<T>.
Definition optional.hpp:800
Used by mongocxx::v_noabi::gridfs::bucket.
Definition bucket.hpp:37
bucket & read_preference(mongocxx::v_noabi::read_preference read_preference)
Sets the read preference to be used when reading from the GridFS bucket. Defaults to the read prefere...
bucket & write_concern(mongocxx::v_noabi::write_concern write_concern)
Sets the write concern to be used when writing to the GridFS bucket. Defaults to the write concern of...
bucket & read_concern(mongocxx::v_noabi::read_concern read_concern)
Sets the read concern to be used when reading from the bucket. Defaults to the read concern of the da...
bucket & chunk_size_bytes(std::int32_t chunk_size_bytes)
Sets the size of the chunks in the bucket. This will be used as the chunk size for files uploaded thr...
bucket & bucket_name(std::string bucket_name)
Sets the name of the bucket. Defaults to 'fs'.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
The mongocxx v_noabi macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
Declares entities representing options specific to GridFS.
Declares entities representing options to use with various commands.
Declares entities whose ABI stability is NOT guaranteed.
The top-level namespace within which all mongocxx library entities are declared.
Declares mongocxx::v_noabi::options::gridfs::bucket.
Provides mongocxx::v_noabi::read_concern.
Provides mongocxx::v_noabi::read_preference.
Provides std::optional-related polyfills for library API usage.
Provides mongocxx::v_noabi::write_concern.