MongoDB C++ Driver mongocxx-4.0.0
|
#include <mongocxx/v_noabi/mongocxx/gridfs/downloader.hpp>
Class used to download a GridFS file.
Public Member Functions | |
downloader () noexcept | |
Default constructs a downloader object. The downloader is equivalent to the state of a moved from downloader. The only valid actions to take with a default constructed downloader are to assign to it, or destroy it. | |
downloader (downloader &&) noexcept | |
Move constructs a downloader. | |
~downloader () | |
Destroys a downloader. | |
std::int32_t | chunk_size () const |
Gets the chunk size of the file being downloaded. | |
void | close () |
Closes the downloader stream. | |
std::int64_t | file_length () const |
Gets the length of the file being downloaded. | |
bsoncxx::v_noabi::document::view | files_document () const |
Gets the files collection document of the file being downloaded. | |
operator bool () const noexcept | |
Returns true if the downloader is valid, meaning it was not default constructed or moved from. | |
downloader & | operator= (downloader &&) noexcept |
Move assigns a downloader. | |
std::size_t | read (std::uint8_t *buffer, std::size_t length) |
Reads a specified number of bytes from the GridFS file being downloaded. | |
|
noexcept |
Default constructs a downloader object. The downloader is equivalent to the state of a moved from downloader. The only valid actions to take with a default constructed downloader are to assign to it, or destroy it.
|
noexcept |
Move constructs a downloader.
mongocxx::v_noabi::gridfs::downloader::~downloader | ( | ) |
Destroys a downloader.
std::int32_t mongocxx::v_noabi::gridfs::downloader::chunk_size | ( | ) | const |
Gets the chunk size of the file being downloaded.
void mongocxx::v_noabi::gridfs::downloader::close | ( | ) |
Closes the downloader stream.
mongocxx::v_noabi::logic_error | if the download stream was already closed. |
std::int64_t mongocxx::v_noabi::gridfs::downloader::file_length | ( | ) | const |
Gets the length of the file being downloaded.
bsoncxx::v_noabi::document::view mongocxx::v_noabi::gridfs::downloader::files_document | ( | ) | const |
Gets the files collection document of the file being downloaded.
|
explicitnoexcept |
Returns true if the downloader is valid, meaning it was not default constructed or moved from.
|
noexcept |
Move assigns a downloader.
std::size_t mongocxx::v_noabi::gridfs::downloader::read | ( | std::uint8_t * | buffer, |
std::size_t | length ) |
Reads a specified number of bytes from the GridFS file being downloaded.
buffer | A pointer to a buffer to store the bytes read from the file. |
length | The number of bytes to read from the file. |
mongocxx::v_noabi::logic_error | if the download stream was already closed. |
mongocxx::v_noabi::gridfs_exception | if the requested file has been corrupted. |
mongocxx::v_noabi::query_exception | if an error occurs when reading chunk data from the database for the requested file. |