libfilezilla
Public Member Functions | List of all members
file_writer_factory Class Referencefinal

Factory for. More...

#include <writer.hpp>

Inheritance diagram for file_writer_factory:
Inheritance graph
[legend]
Collaboration diagram for file_writer_factory:
Collaboration graph
[legend]

Public Member Functions

 file_writer_factory (std::wstring const &file, thread_pool &tpool, file_writer_flags={})
 
virtual std::unique_ptr< writer_baseopen (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_factoryclone () const override
 Clones the factory.
 
virtual bool offsetable () const override
 If true, writer can be opened from any position, not just the beginning, such as file_writer.
 
virtual uint64_t size () const override
 Some writers, e.g. for files, may have a pre-existing size.
 
virtual datetime mtime () const override
 
virtual bool set_mtime (datetime const &t) override
 Sets the mtime of the target. More...
 
virtual bool multiple_buffer_usage () const override
 Whether the writer can benefit from multiple buffers.
 
virtual size_t preferred_buffer_count () const override
 
- Public Member Functions inherited from writer_factory
 writer_factory (std::wstring const &name)
 
 writer_factory (std::wstring &&name)
 
std::wstring const & name () const
 
virtual size_t min_buffer_usage () const
 The writer requires at least this many buffers.
 

Additional Inherited Members

- Protected Member Functions inherited from writer_factory
 writer_factory (writer_factory const &)=default
 

Detailed Description

Factory for.

See also
file_writer

Member Function Documentation

◆ open()

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 
)
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.

◆ set_mtime()

virtual bool set_mtime ( datetime const &  )
overridevirtual

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 from writer_factory.


The documentation for this class was generated from the following file: