Mana
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
FS::File Class Reference

File wrapper class to provide a more convenient API and automatic closing. More...

#include <filesystem.h>

Public Member Functions

 File (PHYSFS_file *file)
 
 ~File ()
 
bool isOpen () const
 
 operator bool () const
 
bool close ()
 
std::optional< size_t > read (void *data, size_t size)
 
std::optional< size_t > write (const void *data, size_t size)
 
bool flush ()
 
bool seek (size_t pos)
 
std::optional< size_t > fileLength () const
 
std::optional< size_t > tell () const
 
bool eof () const
 

Private Attributes

PHYSFS_file * file
 

Detailed Description

File wrapper class to provide a more convenient API and automatic closing.

Definition at line 161 of file filesystem.h.

Constructor & Destructor Documentation

◆ File()

FS::File::File ( PHYSFS_file *  file)
inlineexplicit

Definition at line 164 of file filesystem.h.

◆ ~File()

FS::File::~File ( )
inline

Definition at line 168 of file filesystem.h.

Member Function Documentation

◆ close()

bool FS::File::close ( )
inline

Definition at line 184 of file filesystem.h.

◆ eof()

bool FS::File::eof ( ) const
inline

Definition at line 228 of file filesystem.h.

◆ fileLength()

std::optional< size_t > FS::File::fileLength ( ) const
inline

Definition at line 216 of file filesystem.h.

◆ flush()

bool FS::File::flush ( )
inline

Definition at line 206 of file filesystem.h.

◆ isOpen()

bool FS::File::isOpen ( ) const
inline

Definition at line 174 of file filesystem.h.

◆ operator bool()

FS::File::operator bool ( ) const
inline

Definition at line 179 of file filesystem.h.

◆ read()

std::optional< size_t > FS::File::read ( void *  data,
size_t  size 
)
inline

Definition at line 194 of file filesystem.h.

◆ seek()

bool FS::File::seek ( size_t  pos)
inline

Definition at line 211 of file filesystem.h.

◆ tell()

std::optional< size_t > FS::File::tell ( ) const
inline

Definition at line 222 of file filesystem.h.

◆ write()

std::optional< size_t > FS::File::write ( const void *  data,
size_t  size 
)
inline

Definition at line 200 of file filesystem.h.

Member Data Documentation

◆ file

PHYSFS_file* FS::File::file
private

Definition at line 234 of file filesystem.h.


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