HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Filesystem::IOFile Class Reference

#include <filesystem.h>

+ Inheritance diagram for Filesystem::IOFile:

Public Member Functions

 IOFile (string_view filename, Mode mode)
 
 IOFile (const std::wstring &filename, Mode mode)
 
 IOFile (FILE *file, Mode mode)
 
virtual ~IOFile ()
 
virtual const char * proxytype () const
 
virtual void close ()
 
virtual bool seek (int64_t offset)
 
virtual size_t read (void *buf, size_t size)
 
virtual size_t write (const void *buf, size_t size)
 
virtual size_t pread (void *buf, size_t size, int64_t offset)
 
virtual size_t pwrite (const void *buf, size_t size, int64_t offset)
 
virtual size_t size () const
 
virtual void flush () const
 
FILE * handle () const
 
- Public Member Functions inherited from Filesystem::IOProxy
 IOProxy ()
 
 IOProxy (string_view filename, Mode mode)
 
 IOProxy (const std::wstring &filename, Mode mode)
 
virtual ~IOProxy ()
 
virtual bool opened () const
 
virtual int64_t tell ()
 
Mode mode () const
 
const std::stringfilename () const
 
template<class T >
size_t read (span< T > buf)
 
template<class T >
size_t write (span< T > buf)
 
size_t write (string_view buf)
 
bool seek (int64_t offset, int origin)
 
std::string error () const
 
void error (string_view e)
 

Protected Attributes

FILE * m_file = nullptr
 
size_t m_size = 0
 
bool m_auto_close = false
 
std::mutex m_mutex
 
- Protected Attributes inherited from Filesystem::IOProxy
std::string m_filename
 
int64_t m_pos = 0
 
Mode m_mode = Closed
 
std::string m_error
 

Additional Inherited Members

- Public Types inherited from Filesystem::IOProxy
enum  Mode { Closed = 0, Read = 'r', Write = 'w' }
 

Detailed Description

IOProxy subclass for reading or writing (but not both) that wraps C stdio 'FILE'.

Definition at line 438 of file filesystem.h.

Constructor & Destructor Documentation

Filesystem::IOFile::IOFile ( string_view  filename,
Mode  mode 
)
Filesystem::IOFile::IOFile ( const std::wstring &  filename,
Mode  mode 
)
inline

Definition at line 442 of file filesystem.h.

Filesystem::IOFile::IOFile ( FILE *  file,
Mode  mode 
)
virtual Filesystem::IOFile::~IOFile ( )
virtual

Member Function Documentation

virtual void Filesystem::IOFile::close ( )
virtual

Reimplemented from Filesystem::IOProxy.

virtual void Filesystem::IOFile::flush ( ) const
virtual

Reimplemented from Filesystem::IOProxy.

FILE* Filesystem::IOFile::handle ( ) const
inline

Definition at line 459 of file filesystem.h.

virtual size_t Filesystem::IOFile::pread ( void buf,
size_t  size,
int64_t  offset 
)
virtual

Reimplemented from Filesystem::IOProxy.

virtual const char* Filesystem::IOFile::proxytype ( ) const
inlinevirtual

Implements Filesystem::IOProxy.

Definition at line 448 of file filesystem.h.

virtual size_t Filesystem::IOFile::pwrite ( const void buf,
size_t  size,
int64_t  offset 
)
virtual

Reimplemented from Filesystem::IOProxy.

virtual size_t Filesystem::IOFile::read ( void buf,
size_t  size 
)
virtual

Reimplemented from Filesystem::IOProxy.

virtual bool Filesystem::IOFile::seek ( int64_t  offset)
virtual

Reimplemented from Filesystem::IOProxy.

virtual size_t Filesystem::IOFile::size ( ) const
virtual

Reimplemented from Filesystem::IOProxy.

virtual size_t Filesystem::IOFile::write ( const void buf,
size_t  size 
)
virtual

Reimplemented from Filesystem::IOProxy.

Member Data Documentation

bool Filesystem::IOFile::m_auto_close = false
protected

Definition at line 464 of file filesystem.h.

FILE* Filesystem::IOFile::m_file = nullptr
protected

Definition at line 462 of file filesystem.h.

std::mutex Filesystem::IOFile::m_mutex
protected

Definition at line 465 of file filesystem.h.

size_t Filesystem::IOFile::m_size = 0
protected

Definition at line 463 of file filesystem.h.


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