21#include <mongocxx/database-fwd.hpp>
22#include <mongocxx/gridfs/bucket-fwd.hpp>
24#include <bsoncxx/document/view_or_value.hpp>
25#include <bsoncxx/stdx/optional.hpp>
26#include <bsoncxx/stdx/string_view.hpp>
27#include <bsoncxx/types/bson_value/view.hpp>
28#include <mongocxx/cursor.hpp>
29#include <mongocxx/gridfs/downloader.hpp>
30#include <mongocxx/gridfs/uploader.hpp>
31#include <mongocxx/options/find.hpp>
32#include <mongocxx/options/gridfs/bucket.hpp>
33#include <mongocxx/options/gridfs/upload.hpp>
34#include <mongocxx/result/gridfs/upload.hpp>
35#include <mongocxx/stdx.hpp>
37#include <mongocxx/config/prelude.hpp>
100 explicit operator
bool() const noexcept;
131 const options::gridfs::upload& options = {});
164 stdx::string_view filename,
201 stdx::string_view filename,
238 stdx::string_view filename,
288 std::istream* source,
336 stdx::string_view filename,
337 std::istream* source,
387 stdx::string_view filename,
388 std::istream* source,
437 stdx::string_view filename,
438 std::istream* source,
511 std::ostream* destination);
521 std::ostream* destination,
550 std::ostream* destination);
562 std::ostream* destination,
664 friend ::mongocxx::v_noabi::database;
669 MONGOCXX_PRIVATE
void create_indexes_if_nonexistent(
const client_session* session);
674 stdx::string_view filename,
677 MONGOCXX_PRIVATE
void _upload_from_stream_with_id(
const client_session* session,
679 stdx::string_view filename,
680 std::istream* source,
685 stdx::optional<std::size_t> start,
686 stdx::optional<std::size_t> end);
688 MONGOCXX_PRIVATE
void _download_to_stream(
const client_session* session,
690 std::ostream* destination,
691 stdx::optional<std::size_t> start,
692 stdx::optional<std::size_t> end);
697 class MONGOCXX_PRIVATE impl;
699 MONGOCXX_PRIVATE impl& _get_impl();
700 MONGOCXX_PRIVATE
const impl& _get_impl()
const;
702 std::unique_ptr<impl> _impl;
709#include <mongocxx/config/postlude.hpp>
A view-only variant that can contain any BSON type.
Definition view.hpp:41
Use a session for a sequence of operations, optionally with either causal consistency or snapshots.
Definition client_session.hpp:47
Class representing a pointer to the result set of a query on a MongoDB server.
Definition cursor.hpp:42
Class representing a MongoDB database.
Definition database.hpp:46
Class representing a GridFS bucket.
Definition bucket.hpp:63
void download_to_stream(const client_session &session, bsoncxx::v_noabi::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::v_noabi::types::bson_value::view id, stdx::string_view filename, const options::gridfs::upload &options={})
Opens a gridfs::uploader to create a new GridFS file.
downloader open_download_stream(bsoncxx::v_noabi::types::bson_value::view id)
Opens a gridfs::downloader to read a GridFS file.
void delete_file(const client_session &session, bsoncxx::v_noabi::types::bson_value::view id)
Deletes a GridFS file from the bucket.
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 delete_file(bsoncxx::v_noabi::types::bson_value::view id)
Deletes a GridFS file from the bucket.
downloader open_download_stream(const client_session &session, bsoncxx::v_noabi::types::bson_value::view id)
Opens a gridfs::downloader to read a GridFS file.
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.
bucket() noexcept
Default constructs a bucket object.
cursor find(const client_session &session, bsoncxx::v_noabi::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 download_to_stream(const client_session &session, bsoncxx::v_noabi::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 upload_from_stream_with_id(bsoncxx::v_noabi::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 download_to_stream(bsoncxx::v_noabi::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(bsoncxx::v_noabi::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::v_noabi::document::view_or_value filter, const options::find &options={})
Finds the documents in the files collection of the bucket which match the provided filter.
uploader open_upload_stream(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::v_noabi::types::bson_value::view id, stdx::string_view filename, const options::gridfs::upload &options={})
Opens a gridfs::uploader to create a new GridFS file.
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.
void upload_from_stream_with_id(const client_session &session, bsoncxx::v_noabi::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.
Class used to download a GridFS file.
Definition downloader.hpp:48
Class used to upload a GridFS file.
Definition uploader.hpp:43
Class representing the optional arguments to a MongoDB query.
Definition find.hpp:39
Class representing the optional arguments to a MongoDB GridFS bucket creation operation.
Definition bucket.hpp:37
Class representing the optional arguments to a MongoDB GridFS upload operation.
Definition upload.hpp:33
Class representing the result of a GridFS upload operation.
Definition upload.hpp:30
The top-level namespace for mongocxx library entities.
Definition bulk_write-fwd.hpp:19