libfilezilla
|
#include <writer.hpp>
Public Member Functions | |
buffer_writer_factory (buffer &b, std::wstring const &name, size_t size_limit) | |
virtual std::unique_ptr< writer_base > | open (aio_buffer_pool &pool, uint64_t offset, writer_base::progress_cb_t progress_cb=nullptr, size_t max_buffers=0) override |
Creates a writer. More... | |
virtual std::unique_ptr< writer_factory > | clone () const override |
Clones the factory. | |
Public Member Functions inherited from writer_factory | |
writer_factory (std::wstring const &name) | |
writer_factory (std::wstring &&name) | |
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... | |
Additional Inherited Members | |
Protected Member Functions inherited from writer_factory | |
writer_factory (writer_factory const &)=default | |
Factory for buffer_writer.
The buffer must live longer than the writer. Note that there is no synchronization. Never open two writers for the same buffer in different threads, or access the buffer from any other thread while there is a writer.
|
overridevirtual |
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.
Implements writer_factory.