filters

#include <libmswrite_defs.h>

Inheritance diagram for MSWrite::Device:
MSWrite::MemoryDevice

Public Member Functions

bool setCache (Byte *const cache)
bool readInternal (Byte *buf, const long numBytes)
bool writeInternal (const Byte *buf, const long numBytes)
bool seekInternal (const long offset, const int whence)
long tellInternal (void) const
void debug (const char *s, const int i)
void debug (const char *s1, const char *s2)
void debug (const char *s1, const Byte *s2)
bool good (void) const
int bad (void) const
virtual bool read (Byte *buf, const DWord numBytes)=0
virtual bool write (const Byte *buf, const DWord numBytes)=0
virtual bool seek (const long offset, const int whence)=0
virtual long tell (void)=0
virtual void debug (const char *s)
virtual void debug (const int i)
virtual void error (const int errorCode, const char *message, const char *file="", const int lineno=0, DWord token=NoToken)

Static Public Attributes

static const DWord NoToken = DWord (0xABCD1234)

Protected Attributes

int m_error

Detailed Description

Device that either reads or writes from/to .WRI files.

Definition at line 206 of file libmswrite_defs.h.

Constructor & Destructor Documentation

◆ Device()

MSWrite::Device::Device ( )
inline

Definition at line 221 of file libmswrite_defs.h.

◆ ~Device()

virtual MSWrite::Device::~Device ( )
inlinevirtual

Definition at line 225 of file libmswrite_defs.h.

Member Function Documentation

◆ bad()

int MSWrite::Device::bad ( void ) const
inline

Definition at line 369 of file libmswrite_defs.h.

◆ debug() [1/5]

virtual void MSWrite::Device::debug ( const char * s)
inlinevirtual

Definition at line 389 of file libmswrite_defs.h.

◆ debug() [2/5]

void MSWrite::Device::debug ( const char * s,
const int i )
inline

Definition at line 344 of file libmswrite_defs.h.

◆ debug() [3/5]

void MSWrite::Device::debug ( const char * s1,
const Byte * s2 )
inline

Definition at line 357 of file libmswrite_defs.h.

◆ debug() [4/5]

void MSWrite::Device::debug ( const char * s1,
const char * s2 )
inline

Definition at line 350 of file libmswrite_defs.h.

◆ debug() [5/5]

virtual void MSWrite::Device::debug ( const int i)
inlinevirtual

Definition at line 393 of file libmswrite_defs.h.

◆ error()

virtual void MSWrite::Device::error ( const int errorCode,
const char * message,
const char * file = "",
const int lineno = 0,
DWord token = NoToken )
inlinevirtual

Definition at line 398 of file libmswrite_defs.h.

◆ good()

bool MSWrite::Device::good ( void ) const
inline

Definition at line 364 of file libmswrite_defs.h.

◆ read()

virtual bool MSWrite::Device::read ( Byte * buf,
const DWord numBytes )
pure virtual

Functions that the user must implement.

If the seek function is called to move past EOF (when writing), pad from EOF to the new location with 0's and then seek.

It is your responsibility to call error() if a file op fails.

Implemented in MSWrite::MemoryDevice.

◆ readInternal()

bool MSWrite::Device::readInternal ( Byte * buf,
const long numBytes )
inline

Definition at line 272 of file libmswrite_defs.h.

◆ seekInternal()

bool MSWrite::Device::seekInternal ( const long offset,
const int whence )
inline

Definition at line 310 of file libmswrite_defs.h.

◆ setCache()

bool MSWrite::Device::setCache ( Byte *const cache)
inline

setCache specifies whether or not Device should start reading from memory block specified by

Parameters
cache,insteadof from user defined functions (which probably read from a file).

setting cache to NULL stops the Device from reading from the last memory block specified.

Definition at line 247 of file libmswrite_defs.h.

◆ tellInternal()

long MSWrite::Device::tellInternal ( void ) const
inline

Definition at line 333 of file libmswrite_defs.h.

◆ writeInternal()

bool MSWrite::Device::writeInternal ( const Byte * buf,
const long numBytes )
inline

Definition at line 291 of file libmswrite_defs.h.

Member Data Documentation

◆ m_error

int MSWrite::Device::m_error
protected

Definition at line 218 of file libmswrite_defs.h.

◆ NoToken

const DWord MSWrite::Device::NoToken = DWord (0xABCD1234)
static

Definition at line 397 of file libmswrite_defs.h.


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