|
| | FileInputStream () |
| | Default constructor.
|
| | ~FileInputStream () override |
| | Default destructor.
|
| | FileInputStream (const FileInputStream &)=delete |
| | Deleted copy constructor.
|
| FileInputStream & | operator= (const FileInputStream &)=delete |
| | Deleted copy assignment.
|
| | FileInputStream (FileInputStream &&) noexcept |
| | Move constructor.
|
| FileInputStream & | operator= (FileInputStream &&) noexcept |
| | Move assignment.
|
| | FileInputStream (const std::filesystem::path &filename) |
| | Construct the stream from a file path.
|
| bool | open (const std::filesystem::path &filename) |
| | Open the stream from a file path.
|
| std::optional< std::size_t > | read (void *data, std::size_t size) override |
| | Read data from the stream.
|
| std::optional< std::size_t > | seek (std::size_t position) override |
| | Change the current reading position.
|
| std::optional< std::size_t > | tell () override |
| | Get the current reading position in the stream.
|
| std::optional< std::size_t > | getSize () override |
| | Return the size of the stream.
|
| virtual | ~InputStream ()=default |
| | Virtual destructor.
|
Implementation of input stream based on a file.
This class is a specialization of InputStream that reads from a file on disk.
It wraps a file in the common InputStream interface and therefore allows to use generic classes or functions that accept such a stream, with a file on disk as the data source.
In addition to the virtual functions inherited from InputStream, FileInputStream adds a function to specify the file to open.
SFML resource classes can usually be loaded directly from a filename, so this class shouldn't be useful to you unless you create your own algorithms that operate on an InputStream.
Usage example:
if (stream)
process(*stream);
InputStream, MemoryInputStream