8#ifndef GALAXY_FS_PHYSFSSTREAM_HPP_
9#define GALAXY_FS_PHYSFSSTREAM_HPP_
13#include <SFML/System/InputStream.hpp>
64 bool open(
const std::string& filename)
noexcept;
69 void close()
noexcept;
83 std::optional<std::size_t>
read(
void* data, std::size_t size)
override;
93 std::optional<std::size_t>
seek(std::size_t position)
override;
101 std::optional<std::size_t>
tell()
override;
109 std::optional<std::size_t>
getSize()
override;
Custom SFML input stream using PhysFS.
bool open(const std::string &filename) noexcept
Open file in physfs.
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.
PhysfsStream() noexcept
Constructor.
std::optional< std::size_t > tell() override
Get the current reading position in the stream.
virtual ~PhysfsStream() noexcept
Virtual destructor.
PHYSFS_File * m_file
Handle to physfs file data.
PhysfsStream(const PhysfsStream &)=delete
Copy constructor.
PhysfsStream & operator=(PhysfsStream &&)=delete
Move assignment operator.
PhysfsStream(PhysfsStream &&)=delete
Move constructor.
void close() noexcept
Close the open physfs handle.
std::optional< std::size_t > getSize() override
Return the size of the stream.
PhysfsStream & operator=(const PhysfsStream &)=delete
Copy assignment operator.
bool is_open() const noexcept
Is the physfs file open.