libfilezilla
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
writer_factory Class Referenceabstract

A writer factory. More...

#include <writer.hpp>

Inheritance diagram for writer_factory:
Inheritance graph
[legend]

Public Member Functions

 writer_factory (std::wstring const &name)
 
 writer_factory (std::wstring &&name)
 
virtual std::unique_ptr< writer_factoryclone () const =0
 Clones the factory.
 
virtual std::unique_ptr< writer_baseopen (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.
 
std::wstring constname () 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.
 

Protected Member Functions

 writer_factory (writer_factory const &)=default
 

Detailed Description

A writer factory.

Member Function Documentation

◆ clone()

virtual std::unique_ptr< writer_factory > clone ( ) const
pure virtual

Clones the factory.

Implemented in file_writer_factory, and buffer_writer_factory.

◆ multiple_buffer_usage()

virtual bool multiple_buffer_usage ( ) const
inlinevirtual

Whether the writer can benefit from multiple buffers.

Reimplemented in file_writer_factory.

◆ offsetable()

virtual bool offsetable ( ) const
inlinevirtual

If true, writer can be opened from any position, not just the beginning, such as file_writer.

Reimplemented in file_writer_factory.

◆ open()

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 
)
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 file_writer_factory, and buffer_writer_factory.

◆ set_mtime()

virtual bool set_mtime ( datetime const )
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.

◆ size()

virtual uint64_t size ( ) const
inlinevirtual

Some writers, e.g. for files, may have a pre-existing size.

Reimplemented in file_writer_factory.


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