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)
 
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
 

Detailed Description

Proxy class for I/O. This provides a simplified interface for file I/O that can have custom overrides.

Definition at line 339 of file filesystem.h.

Member Enumeration Documentation

Enumerator
Closed 
Read 
Write 

Definition at line 341 of file filesystem.h.

Constructor & Destructor Documentation

Filesystem::IOProxy::IOProxy ( )
inline

Definition at line 342 of file filesystem.h.

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

Definition at line 343 of file filesystem.h.

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

Definition at line 345 of file filesystem.h.

Member Function Documentation

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

Reimplemented in Filesystem::IOFile.

Definition at line 347 of file filesystem.h.

std::string Filesystem::IOProxy::error ( ) const
inline

Definition at line 382 of file filesystem.h.

void Filesystem::IOProxy::error ( string_view  e)
inline

Definition at line 383 of file filesystem.h.

const std::string& Filesystem::IOProxy::filename ( ) const
inline

Definition at line 361 of file filesystem.h.

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

Reimplemented in Filesystem::IOFile.

Definition at line 358 of file filesystem.h.

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

Definition at line 360 of file filesystem.h.

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

Definition at line 348 of file filesystem.h.

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

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

Definition at line 355 of file filesystem.h.

virtual const char* Filesystem::IOProxy::proxytype ( ) const
pure virtual
virtual size_t Filesystem::IOProxy::pwrite ( const void buf,
size_t  size,
int64_t  offset 
)
inlinevirtual

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

Definition at line 356 of file filesystem.h.

virtual size_t Filesystem::IOProxy::read ( void buf,
size_t  size 
)
inlinevirtual

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

Definition at line 351 of file filesystem.h.

template<class T >
size_t Filesystem::IOProxy::read ( span< T >  buf)
inline

Definition at line 362 of file filesystem.h.

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

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

Definition at line 350 of file filesystem.h.

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

Definition at line 371 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 357 of file filesystem.h.

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

Definition at line 349 of file filesystem.h.

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

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

Definition at line 352 of file filesystem.h.

template<class T >
size_t Filesystem::IOProxy::write ( span< T >  buf)
inline

Definition at line 365 of file filesystem.h.

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

Definition at line 368 of file filesystem.h.

Member Data Documentation

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

Definition at line 387 of file filesystem.h.

Mode Filesystem::IOProxy::m_mode = Closed
protected

Definition at line 389 of file filesystem.h.

int64_t Filesystem::IOProxy::m_pos = 0
protected

Definition at line 388 of file filesystem.h.


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