Class used to download a GridFS file.
More...
#include <downloader.hpp>
Class used to download a GridFS file.
◆ downloader()
mongocxx::gridfs::downloader::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.
◆ chunk_size()
std::int32_t mongocxx::gridfs::downloader::chunk_size |
( |
| ) |
const |
Gets the chunk size of the file being downloaded.
- Returns
- The chunk size in bytes.
◆ close()
void mongocxx::gridfs::downloader::close |
( |
| ) |
|
Closes the downloader stream.
- Exceptions
-
◆ file_length()
std::int64_t mongocxx::gridfs::downloader::file_length |
( |
| ) |
const |
Gets the length of the file being downloaded.
- Returns
- The length in bytes.
◆ files_document()
Gets the files collection document of the file being downloaded.
- Returns
- A view to the files collection document of the file being downloaded.
◆ read()
std::size_t mongocxx::gridfs::downloader::read |
( |
std::uint8_t * |
buffer, |
|
|
std::size_t |
length |
|
) |
| |
Reads a specified number of bytes from the GridFS file being downloaded.
- Parameters
-
buffer | A pointer to a buffer to store the bytes read from the file. |
length | The number of bytes to read from the file. |
- Returns
- The number of bytes actually read. If zero, the downloader has reached the end of the file.
- Exceptions
-
The documentation for this class was generated from the following file: