21 #include <bsoncxx/document/view_or_value.hpp>
22 #include <bsoncxx/stdx/optional.hpp>
23 #include <bsoncxx/stdx/string_view.hpp>
24 #include <bsoncxx/types/bson_value/view.hpp>
25 #include <mongocxx/cursor.hpp>
26 #include <mongocxx/gridfs/downloader.hpp>
27 #include <mongocxx/gridfs/uploader.hpp>
28 #include <mongocxx/options/find.hpp>
29 #include <mongocxx/options/gridfs/bucket.hpp>
30 #include <mongocxx/options/gridfs/upload.hpp>
31 #include <mongocxx/result/gridfs/upload.hpp>
32 #include <mongocxx/stdx.hpp>
34 #include <mongocxx/config/prelude.hpp>
37 inline namespace v_noabi {
99 explicit operator
bool() const noexcept;
128 uploader open_upload_stream(stdx::string_view filename,
129 const options::gridfs::upload& options = {});
161 stdx::string_view filename,
197 stdx::string_view filename,
233 stdx::string_view filename,
282 std::istream* source,
329 stdx::string_view filename,
330 std::istream* source,
379 stdx::string_view filename,
380 std::istream* source,
428 stdx::string_view filename,
429 std::istream* source,
510 std::ostream* destination,
539 std::ostream* destination);
551 std::ostream* destination,
637 bsoncxx::document::view_or_value filter,
657 MONGOCXX_PRIVATE
void create_indexes_if_nonexistent(
const client_session* session);
661 stdx::string_view filename,
664 MONGOCXX_PRIVATE
void _upload_from_stream_with_id(
const client_session* session,
666 stdx::string_view filename,
667 std::istream* source,
672 stdx::optional<std::size_t> start,
673 stdx::optional<std::size_t> end);
675 MONGOCXX_PRIVATE
void _download_to_stream(
const client_session* session,
677 std::ostream* destination,
678 stdx::optional<std::size_t> start,
679 stdx::optional<std::size_t> end);
684 class MONGOCXX_PRIVATE impl;
686 MONGOCXX_PRIVATE impl& _get_impl();
687 MONGOCXX_PRIVATE
const impl& _get_impl()
const;
689 std::unique_ptr<impl> _impl;
696 #include <mongocxx/config/postlude.hpp>
A view-only variant that can contain any BSON type.
Definition: view.hpp:44
Use a session for a sequence of operations, optionally with either causal consistency or snapshots.
Definition: client_session.hpp:40
Class representing a pointer to the result set of a query on a MongoDB server.
Definition: cursor.hpp:36
Class representing a MongoDB database.
Definition: database.hpp:44
Class representing a GridFS bucket.
Definition: bucket.hpp:62
void download_to_stream(bsoncxx::types::bson_value::view id, std::ostream *destination, std::size_t start, std::size_t end)
Downloads the contents of a stored GridFS file from the bucket and writes it to a stream.
uploader open_upload_stream_with_id(bsoncxx::types::bson_value::view id, stdx::string_view filename, const options::gridfs::upload &options={})
Opens a gridfs::uploader to create a new GridFS file.
uploader open_upload_stream_with_id(const client_session &session, bsoncxx::types::bson_value::view id, stdx::string_view filename, const options::gridfs::upload &options={})
Opens a gridfs::uploader to create a new GridFS file.
stdx::string_view bucket_name() const
Gets the name of the GridFS bucket.
uploader open_upload_stream(const client_session &session, stdx::string_view filename, const options::gridfs::upload &options={})
Opens a gridfs::uploader to create a new GridFS file.
void download_to_stream(const client_session &session, bsoncxx::types::bson_value::view id, std::ostream *destination)
Downloads the contents of a stored GridFS file from the bucket and writes it to a stream.
void download_to_stream(const client_session &session, bsoncxx::types::bson_value::view id, std::ostream *destination, std::size_t start, std::size_t end)
Downloads the contents of a stored GridFS file from the bucket and writes it to a stream.
cursor find(bsoncxx::document::view_or_value filter, const options::find &options={})
Finds the documents in the files collection of the bucket which match the provided filter.
void upload_from_stream_with_id(const client_session &session, bsoncxx::types::bson_value::view id, stdx::string_view filename, std::istream *source, const options::gridfs::upload &options={})
Creates a new GridFS file with a user-supplied unique id by uploading bytes from an input stream.
void delete_file(const client_session &session, bsoncxx::types::bson_value::view id)
Deletes a GridFS file from the bucket.
downloader open_download_stream(const client_session &session, bsoncxx::types::bson_value::view id)
Opens a gridfs::downloader to read a GridFS file.
void download_to_stream(bsoncxx::types::bson_value::view id, std::ostream *destination)
Downloads the contents of a stored GridFS file from the bucket and writes it to a stream.
result::gridfs::upload upload_from_stream(const client_session &session, stdx::string_view filename, std::istream *source, const options::gridfs::upload &options={})
Creates a new GridFS file by uploading bytes from an input stream.
cursor find(const client_session &session, bsoncxx::document::view_or_value filter, const options::find &options={})
Finds the documents in the files collection of the bucket which match the provided filter.
void delete_file(bsoncxx::types::bson_value::view id)
Deletes a GridFS file from the bucket.
bucket() noexcept
Default constructs a bucket object.
void upload_from_stream_with_id(bsoncxx::types::bson_value::view id, stdx::string_view filename, std::istream *source, const options::gridfs::upload &options={})
Creates a new GridFS file with a user-supplied unique id by uploading bytes from an input stream.
result::gridfs::upload upload_from_stream(stdx::string_view filename, std::istream *source, const options::gridfs::upload &options={})
Creates a new GridFS file by uploading bytes from an input stream.
downloader open_download_stream(bsoncxx::types::bson_value::view id)
Opens a gridfs::downloader to read a GridFS file.
Class used to download a GridFS file.
Definition: downloader.hpp:45
Class used to upload a GridFS file.
Definition: uploader.hpp:40
Class representing the optional arguments to a MongoDB query.
Definition: find.hpp:37
Class representing the optional arguments to a MongoDB GridFS bucket creation operation.
Definition: bucket.hpp:35
Class representing the optional arguments to a MongoDB GridFS upload operation.
Definition: upload.hpp:31
Class representing the result of a GridFS upload operation.
Definition: upload.hpp:28
The top-level namespace for mongocxx library entities.
Definition: bulk_write.hpp:24