MongoDB C++ Driver mongocxx-3.11.0
Loading...
Searching...
No Matches
upload.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
18
21
22#include <mongocxx/stdx.hpp>
23
25
26namespace mongocxx {
27namespace v_noabi {
28namespace options {
29namespace gridfs {
30
34class upload {
35 public:
48
56
69
77 metadata() const;
78
79 private:
80 stdx::optional<std::int32_t> _chunk_size_bytes;
81 stdx::optional<bsoncxx::v_noabi::document::view_or_value> _metadata;
82};
83
84} // namespace gridfs
85} // namespace options
86} // namespace v_noabi
87} // namespace mongocxx
88
89#include <mongocxx/config/postlude.hpp>
90
A polyfill for std::optional<T>.
Definition optional.hpp:874
Class representing the optional arguments to a MongoDB GridFS upload operation.
Definition upload.hpp:34
const stdx::optional< std::int32_t > & chunk_size_bytes() const
Gets the chunk size of the GridFS file being uploaded.
upload & metadata(bsoncxx::v_noabi::document::view_or_value metadata)
Sets the metadata field of the GridFS file being uploaded. A GridFS file can store arbitrary metadata...
const stdx::optional< bsoncxx::v_noabi::document::view_or_value > & metadata() const
Gets the metadata of the GridFS file being uploaded.
upload & chunk_size_bytes(std::int32_t chunk_size_bytes)
Sets the chunk size of the GridFS file being uploaded. Defaults to the chunk size specified in option...
Provides bsoncxx::v_noabi::document::view_or_value.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition fwd.hpp:222
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::upload.
Redeclares bsoncxx::v_noabi::stdx in mongocxx::v_noabi::stdx for internal use.