MongoDB C++ Driver mongocxx-4.0.0
|
#include <mongocxx/v_noabi/mongocxx/gridfs/uploader.hpp>
Class used to upload a GridFS file.
Public Member Functions | |
uploader () noexcept | |
Default constructs an uploader object. The uploader is equivalent to the state of a moved from uploader. The only valid actions to take with a default constructed uploader are to assign to it, or destroy it. | |
uploader (uploader &&) noexcept | |
Move constructs an uploader. | |
~uploader () | |
Destroys an uploader. | |
void | abort () |
Aborts uploading the file. | |
std::int32_t | chunk_size () const |
Gets the chunk size of the file being uploaded. | |
result::gridfs::upload | close () |
Closes the uploader stream. | |
operator bool () const noexcept | |
Returns true if the uploader is valid, meaning it was not default constructed or moved from. | |
uploader & | operator= (uploader &&) noexcept |
Move assigns an uploader. | |
void | write (const std::uint8_t *bytes, std::size_t length) |
Writes a specified number of bytes to a GridFS file. | |
|
noexcept |
Default constructs an uploader object. The uploader is equivalent to the state of a moved from uploader. The only valid actions to take with a default constructed uploader are to assign to it, or destroy it.
|
noexcept |
Move constructs an uploader.
mongocxx::v_noabi::gridfs::uploader::~uploader | ( | ) |
Destroys an uploader.
void mongocxx::v_noabi::gridfs::uploader::abort | ( | ) |
Aborts uploading the file.
mongocxx::v_noabi::logic_error | if the upload stream was already closed. |
mongocxx::v_noabi::bulk_write_exception | if an error occurs when removing chunk data from the database. |
std::int32_t mongocxx::v_noabi::gridfs::uploader::chunk_size | ( | ) | const |
Gets the chunk size of the file being uploaded.
result::gridfs::upload mongocxx::v_noabi::gridfs::uploader::close | ( | ) |
Closes the uploader stream.
mongocxx::v_noabi::logic_error | if the upload stream was already closed. |
mongocxx::v_noabi::bulk_write_exception | if an error occurs when writing chunk data or file metadata to the database. |
mongocxx::v_noabi::gridfs_exception | if the uploader requires more than 2^31-1 chunks to store the file at the requested chunk size. |
|
explicitnoexcept |
Returns true if the uploader is valid, meaning it was not default constructed or moved from.
Move assigns an uploader.
void mongocxx::v_noabi::gridfs::uploader::write | ( | const std::uint8_t * | bytes, |
std::size_t | length ) |
Writes a specified number of bytes to a GridFS file.
bytes | A pointer to the bytes to write. |
length | The number of bytes to write. |
mongocxx::v_noabi::logic_error | if the upload stream was already closed. |
mongocxx::v_noabi::bulk_write_exception | if an error occurs when writing chunk data to the database. |
mongocxx::v_noabi::gridfs_exception | if the uploader requires more than 2^31-1 chunks to store the file at the requested chunk size. |