MongoDB C++ Driver  mongocxx-3.9.0
All Classes Namespaces Functions Typedefs Enumerations Enumerator Friends Pages
upload.hpp
1 // Copyright 2017 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 <bsoncxx/array/value.hpp>
18 #include <bsoncxx/types/bson_value/view.hpp>
19 
20 #include <mongocxx/config/prelude.hpp>
21 
22 namespace mongocxx {
23 inline namespace v_noabi {
24 namespace result {
25 namespace gridfs {
26 
28 class MONGOCXX_API upload {
29  public:
31 
38 
39  private:
40  // Array with a single element, containing the value of the _id field for the inserted files
41  // collection document.
42  bsoncxx::array::value _id_owned;
43 
44  // Points into _id_owned.
46 
47  friend MONGOCXX_API bool MONGOCXX_CALL operator==(const upload&, const upload&);
48  friend MONGOCXX_API bool MONGOCXX_CALL operator!=(const upload&, const upload&);
49 };
50 
51 } // namespace gridfs
52 } // namespace result
53 } // namespace v_noabi
54 } // namespace mongocxx
55 
56 #include <mongocxx/config/postlude.hpp>
A view-only variant that can contain any BSON type.
Definition: view.hpp:44
Class representing the result of a GridFS upload operation.
Definition: upload.hpp:28
const bsoncxx::types::bson_value::view & id() const
Gets the id of the uploaded GridFS file.
The top-level namespace for mongocxx library entities.
Definition: bulk_write.hpp:24