#include <mongocxx/v1/gridfs/downloader.hpp>
Support for downloading files from a GridFS bucket.
- See also
-
- Attention
- This feature is experimental! It is not ready for use!
|
| | downloader () |
| | Default initialization.
|
| | downloader (downloader &&other) noexcept |
| | Move constructor.
|
| | downloader (downloader const &other)=delete |
| | This class is not copyable.
|
| | ~downloader () |
| | Destroy this object.
|
| std::int32_t | chunk_size () const |
| | Return the chunk size (in bytes) of the associated GridFS file.
|
| void | close () |
| | Close the underlying GridFS download stream.
|
| std::int64_t | file_length () const |
| | Return the length of the associated GridFS file.
|
| bsoncxx::v1::document::view | files_document () const |
| | Return the files collection document for the associated GridFS file.
|
| bool | is_open () const |
| | Return true when the underlying GridFS file stream is open for reading.
|
| | operator bool () const |
| | Return true when *this is NOT in an assign-or-destroy-only state and this->is_open() == true.
|
| downloader & | operator= (downloader &&other) noexcept |
| | Move assignment.
|
| downloader & | operator= (downloader const &other)=delete |
| | This class is not copyable.
|
| std::size_t | read (std::uint8_t *data, std::size_t length) |
| | Read up to length bytes of the associated GridFS file.
|
◆ errc
Errors codes which may be returned by mongocxx::v1::gridfs::downloader.
- Attention
- This feature is experimental! It is not ready for use!
| Enumerator |
|---|
| zero | Zero.
|
| is_closed | The GridFS file download stream is not open.
|
| corrupt_data | The GridFS file is in an invalid or inconsistent state.
|
◆ ~downloader()
| mongocxx::v1::gridfs::downloader::~downloader |
( |
| ) |
|
Destroy this object.
- Warning
- Invalidates all associated views.
◆ downloader() [1/3]
| mongocxx::v1::gridfs::downloader::downloader |
( |
downloader && | other | ) |
|
|
noexcept |
Move constructor.
- Postconditions:
- other is in an assign-or-destroy-only state.
◆ downloader() [2/3]
| mongocxx::v1::gridfs::downloader::downloader |
( |
downloader const & | other | ) |
|
|
delete |
This class is not copyable.
◆ downloader() [3/3]
| mongocxx::v1::gridfs::downloader::downloader |
( |
| ) |
|
Default initialization.
- Postconditions:
- *this is in an assign-or-destroy-only state.
◆ chunk_size()
| std::int32_t mongocxx::v1::gridfs::downloader::chunk_size |
( |
| ) |
const |
Return the chunk size (in bytes) of the associated GridFS file.
◆ close()
| void mongocxx::v1::gridfs::downloader::close |
( |
| ) |
|
Close the underlying GridFS download stream.
◆ error_category()
| std::error_category const & mongocxx::v1::gridfs::downloader::error_category |
( |
| ) |
|
|
static |
◆ file_length()
| std::int64_t mongocxx::v1::gridfs::downloader::file_length |
( |
| ) |
const |
Return the length of the associated GridFS file.
◆ files_document()
Return the files collection document for the associated GridFS file.
◆ is_open()
| bool mongocxx::v1::gridfs::downloader::is_open |
( |
| ) |
const |
Return true when the underlying GridFS file stream is open for reading.
◆ operator bool()
| mongocxx::v1::gridfs::downloader::operator bool |
( |
| ) |
const |
|
explicit |
Return true when *this is NOT in an assign-or-destroy-only state and this->is_open() == true.
◆ operator=() [1/2]
Move assignment.
- Postconditions:
- other is in an assign-or-destroy-only state.
◆ operator=() [2/2]
This class is not copyable.
◆ read()
| std::size_t mongocxx::v1::gridfs::downloader::read |
( |
std::uint8_t * | data, |
|
|
std::size_t | length ) |
Read up to length bytes of the associated GridFS file.
- Preconditions:
- data is not null.
- The size of the storage region pointed to by data must be greater than or equal to length.
- Returns
- The actual number of bytes read. 0 indicates the downloader has reached the end of the file.
- Exceptions
-
◆ make_error_code
| std::error_code make_error_code |
( |
errc | v | ) |
|
|
friend |
Support implicit conversion to std::error_code.
- Attention
- This feature is experimental! It is not ready for use!
The documentation for this class was generated from the following file: