#include <mongocxx/v_noabi/mongocxx/gridfs/uploader.hpp>
Used to upload a GridFS file.
◆ uploader() [1/3]
| mongocxx::v_noabi::gridfs::uploader::uploader |
( |
| ) |
|
|
inlinenoexcept |
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() [2/3]
| mongocxx::v_noabi::gridfs::uploader::uploader |
( |
uploader && | | ) |
|
|
defaultnoexcept |
Move constructs an uploader.
◆ ~uploader()
| mongocxx::v_noabi::gridfs::uploader::~uploader |
( |
| ) |
|
|
default |
◆ uploader() [3/3]
◆ abort()
| void mongocxx::v_noabi::gridfs::uploader::abort |
( |
| ) |
|
Aborts uploading the file.
- Exceptions
-
| 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. |
◆ chunk_size()
| std::int32_t mongocxx::v_noabi::gridfs::uploader::chunk_size |
( |
| ) |
const |
Gets the chunk size of the file being uploaded.
- Returns
- The chunk size in bytes.
◆ close()
Closes the uploader stream.
- Exceptions
-
| 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. |
◆ operator bool()
| mongocxx::v_noabi::gridfs::uploader::operator bool |
( |
| ) |
const |
|
inlineexplicitnoexcept |
Returns true if the uploader is valid, meaning it was not default constructed or moved from.
◆ operator v1::gridfs::uploader() [1/2]
Convert to the mongocxx::v1 equivalent.
- Postconditions:
- *this is in an assign-or-destroy-only state.
- Warning
- Invalidates all associated objects.
◆ operator v1::gridfs::uploader() [2/2]
This class is not copyable.
◆ operator=()
Move assigns an uploader.
◆ write()
| void mongocxx::v_noabi::gridfs::uploader::write |
( |
std::uint8_t const * | bytes, |
|
|
std::size_t | length ) |
Writes a specified number of bytes to a GridFS file.
- Parameters
-
| bytes | A pointer to the bytes to write. |
| length | The number of bytes to write. |
- Exceptions
-
| 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. |
The documentation for this class was generated from the following file: