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

Factory for. More...

#include <reader.hpp>

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

Public Member Functions

 string_reader_factory (std::wstring const &name, std::string const &data)
 
 string_reader_factory (std::wstring &&name, std::string &&data)
 
virtual std::unique_ptr< reader_baseopen (aio_buffer_pool &pool, uint64_t offset=0, uint64_t size=reader_base::nosize, size_t max_buffers=1) override
 Creates a reader. More...
 
virtual std::unique_ptr< reader_factoryclone () const override
 Clones the factory.
 
virtual bool seekable () const override
 
virtual uint64_t size () const override
 
- Public Member Functions inherited from reader_factory
 reader_factory (std::wstring const &name)
 
 reader_factory (std::wstring &&name)
 
std::wstring name () const
 
virtual datetime mtime () const
 
virtual size_t min_buffer_usage () const
 The reader requires at least this many buffers. More...
 
virtual bool multiple_buffer_usage () const
 Whether the reader can benefit from multiple buffers. More...
 
virtual size_t preferred_buffer_count () const
 

Additional Inherited Members

- Protected Member Functions inherited from reader_factory
 reader_factory (reader_factory const &)=default
 
- Protected Attributes inherited from reader_factory
std::wstring const name_
 

Detailed Description

Factory for.

See also
string_reader, keeps a copy of the string.

Member Function Documentation

◆ open()

virtual std::unique_ptr<reader_base> open ( aio_buffer_pool pool,
uint64_t  offset = 0,
uint64_t  size = reader_base::nosize,
size_t  max_buffers = 1 
)
overridevirtual

Creates a reader.

The pool must live longer than the returned reader.

Seekable readers can be opened at any position. If the reader is not seekable, pass an offset of 0 or open will fails.

size can limit the amount of data the reader can returned. Note that a size limit that exceeds the actual size will result in reader_base::get_buffer eventually returning an error.

Implements reader_factory.


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