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

#include <filesystem.h>

+ Inheritance diagram for Filesystem::IOProxy:

Public Types

enum  Mode { Closed = 0, Read = 'r', Write = 'w' }
 

Public Member Functions

 IOProxy ()
 
 IOProxy (string_view filename, Mode mode)
 
 IOProxy (const std::wstring &filename, Mode mode)
 
virtual ~IOProxy ()
 
virtual const char * proxytype () const =0
 
virtual void close ()
 
virtual bool opened () const
 
virtual int64_t tell ()
 
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
 
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

std::string m_filename
 
int64_t m_pos = 0
 
Mode m_mode = Closed
 
std::string m_error
 

Detailed Description

Proxy class for I/O. This provides a simplified interface for file I/O that can have custom overrides. All char-based filenames are assumed to be UTF-8 encoded.

Definition at line 384 of file filesystem.h.

Member Enumeration Documentation

Enumerator
Closed 
Read 
Write 

Definition at line 386 of file filesystem.h.

Constructor & Destructor Documentation

Filesystem::IOProxy::IOProxy ( )
inline

Definition at line 387 of file filesystem.h.

Filesystem::IOProxy::IOProxy ( string_view  filename,
Mode  mode 
)
inline

Definition at line 388 of file filesystem.h.

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

Definition at line 390 of file filesystem.h.

virtual Filesystem::IOProxy::~IOProxy ( )
inlinevirtual

Definition at line 392 of file filesystem.h.

Member Function Documentation

virtual void Filesystem::IOProxy::close ( )
inlinevirtual

Reimplemented in Filesystem::IOFile.

Definition at line 394 of file filesystem.h.

std::string Filesystem::IOProxy::error ( ) const
void Filesystem::IOProxy::error ( string_view  e)
const std::string& Filesystem::IOProxy::filename ( ) const
inline

Definition at line 408 of file filesystem.h.

virtual void Filesystem::IOProxy::flush ( ) const
inlinevirtual

Reimplemented in Filesystem::IOFile.

Definition at line 405 of file filesystem.h.

Mode Filesystem::IOProxy::mode ( ) const
inline

Definition at line 407 of file filesystem.h.

virtual bool Filesystem::IOProxy::opened ( ) const
inlinevirtual

Definition at line 395 of file filesystem.h.

virtual size_t Filesystem::IOProxy::pread ( void buf,
size_t  size,
int64_t  offset 
)
virtual
virtual const char* Filesystem::IOProxy::proxytype ( ) const
pure virtual
virtual size_t Filesystem::IOProxy::pwrite ( const void buf,
size_t  size,
int64_t  offset 
)
virtual
virtual size_t Filesystem::IOProxy::read ( void buf,
size_t  size 
)
virtual
template<class T >
size_t Filesystem::IOProxy::read ( span< T >  buf)
inline

Definition at line 409 of file filesystem.h.

virtual bool Filesystem::IOProxy::seek ( int64_t  offset)
inlinevirtual

Reimplemented in Filesystem::IOMemReader, and Filesystem::IOFile.

Definition at line 397 of file filesystem.h.

bool Filesystem::IOProxy::seek ( int64_t  offset,
int  origin 
)
inline

Definition at line 418 of file filesystem.h.

virtual size_t Filesystem::IOProxy::size ( void  ) const
inlinevirtual

Reimplemented in Filesystem::IOMemReader, Filesystem::IOVecOutput, and Filesystem::IOFile.

Definition at line 404 of file filesystem.h.

virtual int64_t Filesystem::IOProxy::tell ( )
inlinevirtual

Definition at line 396 of file filesystem.h.

virtual size_t Filesystem::IOProxy::write ( const void buf,
size_t  size 
)
virtual
template<class T >
size_t Filesystem::IOProxy::write ( span< T >  buf)
inline

Definition at line 412 of file filesystem.h.

size_t Filesystem::IOProxy::write ( string_view  buf)
inline

Definition at line 415 of file filesystem.h.

Member Data Documentation

std::string Filesystem::IOProxy::m_error
protected

Definition at line 432 of file filesystem.h.

std::string Filesystem::IOProxy::m_filename
protected

Definition at line 429 of file filesystem.h.

Mode Filesystem::IOProxy::m_mode = Closed
protected

Definition at line 431 of file filesystem.h.

int64_t Filesystem::IOProxy::m_pos = 0
protected

Definition at line 430 of file filesystem.h.


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