libfilezilla
|
A writer factory. More...
#include <writer.hpp>
Public Member Functions | |
writer_factory (std::wstring const &name) | |
writer_factory (std::wstring &&name) | |
virtual std::unique_ptr< writer_factory > | clone () const =0 |
Clones the factory. | |
virtual std::unique_ptr< writer_base > | open (aio_buffer_pool &pool, uint64_t offset=0, writer_base::progress_cb_t progress_cb=nullptr, size_t max_buffers=0)=0 |
Creates a writer. More... | |
std::wstring const & | name () const |
virtual bool | offsetable () const |
If true, writer can be opened from any position, not just the beginning, such as file_writer. | |
virtual uint64_t | size () const |
Some writers, e.g. for files, may have a pre-existing size. | |
virtual datetime | mtime () const |
virtual size_t | min_buffer_usage () const |
The writer requires at least this many buffers. | |
virtual bool | multiple_buffer_usage () const |
Whether the writer can benefit from multiple buffers. | |
virtual size_t | preferred_buffer_count () const |
virtual bool | set_mtime (datetime const &) |
Sets the mtime of the target. More... | |
Protected Member Functions | |
writer_factory (writer_factory const &)=default | |
A writer factory.
|
pure virtual |
Creates a writer.
The pool must live longer than the returned writer.
Offsetable writers can be opened at any position. If the writer is not seekable, pass an offset
of 0 or open will fail.
Implemented in buffer_writer_factory, and file_writer_factory.
|
inlinevirtual |
Sets the mtime of the target.
If there are still writers open for the entity represented by the factory, the mtime might change again as the writers are closed.
Reimplemented in file_writer_factory.