#include <DLIOStream.h>
Inheritance diagram for DLIOStream:
Public Member Functions | |
DLIOStream () | |
virtual int | dlRead (void *buff, int size)=0 |
virtual int | dlGets (void *buff, int size)=0 |
virtual string | dlGetLine ()=0 |
virtual int | dlGetInt (DLEndian endian)=0 |
virtual short | dlGetShort (DLEndian endian)=0 |
virtual void | dlWriteInt (int intVal, DLEndian endian)=0 |
virtual void | dlWriteShort (short shortVal, DLEndian endian)=0 |
virtual int | dlWrite (void *buff, int size)=0 |
virtual int | dlClose ()=0 |
virtual int | dlFlush ()=0 |
Protected Member Functions | |
virtual | ~DLIOStream () |
Destructor. | |
Protected Attributes | |
DLEndian | sys_endian |
DLIOStream implements the common features and defines all the required interfaces (minimum features) that all child objects must implement to allow the ease of swapping in/out other DOCLIB I/O objects.
Currently, Some of the DOCLIB supported image objects (PPM, BMP, PBM) are using DLIOStream to read and write to and from file/memory.
DLIOStream also take care of the byte order (endian) of the current system when reading for int/short data types.
Definition at line 25 of file DLIOStream.h.
DLIOStream::DLIOStream | ( | ) | [inline] |
virtual DLIOStream::~DLIOStream | ( | ) | [inline, protected, virtual] |
virtual int DLIOStream::dlRead | ( | void * | buff, | |
int | size | |||
) | [pure virtual] |
dlRead is a pure virtual function to read up to a number of (size) bytes form the DOCLIB I/O stream into the buffer. dlRead will read up to the max size or end of file. The buffer must be allocated prior calling the dlRead() function. The number of bytes read in is returned.
buff | buffer to store the data | |
size | max buffer size to read. |
Implemented in DLFileBasedIO, and DLMemoryBasedIO.
virtual int DLIOStream::dlGets | ( | void * | buff, | |
int | size | |||
) | [pure virtual] |
dlGets is a pure virtual function to read up to a number of (size) bytes form the DOCLIB I/O stream into the buffer. dlGets will read up to the max size or until line feed or end of file. The buffer must be allocated prior calling the dlRead() function. The number of bytes read in is returned.
buff | buffer to store the data | |
size | max buffer size to read |
Implemented in DLFileBasedIO, and DLMemoryBasedIO.
virtual string DLIOStream::dlGetLine | ( | ) | [pure virtual] |
dlGetLine is a pure virtual function to read a line form the DOCLIB I/O stream. dlGetLine will read up to an end of line or DL_PPM_MAX_LINE_LENGTH (256) or end of file. A string of the read in line will be returned.
Implemented in DLFileBasedIO, and DLMemoryBasedIO.
virtual int DLIOStream::dlGetInt | ( | DLEndian | endian | ) | [pure virtual] |
dlGetInt is a pure virtual function to read an int "sizeof(int) bytes" form the DOCLIB I/O stream. dlGetInt will convert the byte order of the current int value into the indicated byte order. The read in "int" value is returned.
endian | desired byte order
|
Implemented in DLFileBasedIO, and DLMemoryBasedIO.
virtual short DLIOStream::dlGetShort | ( | DLEndian | endian | ) | [pure virtual] |
dlGetShort is a pure virtual function to read a short "sizeof(short) bytes" form the DOCLIB I/O stream. dlGetShort will convert the byte order of the current short value into the indicated byte order. The read in "short" value is returned.
endian | desired byte order
|
Implemented in DLFileBasedIO, and DLMemoryBasedIO.
virtual void DLIOStream::dlWriteInt | ( | int | intVal, | |
DLEndian | endian | |||
) | [pure virtual] |
dlWriteInt is a pure virtual function to write an int to the DOCLIB I/O stream. dlWriteInt will convert the int value into the indicated byte order and then writes it out to the DOCLIB I/O stream.
intVal | int value to write | |
endian | desired byte order
|
Implemented in DLFileBasedIO, and DLMemoryBasedIO.
virtual void DLIOStream::dlWriteShort | ( | short | shortVal, | |
DLEndian | endian | |||
) | [pure virtual] |
dlWriteInt is a pure virtual function to write a short to the DOCLIB I/O stream. dlWriteInt will convert the short value into the indicated byte order and then writes it out to the DOCLIB I/O stream.
shortVal | short value to write | |
endian | desired byte order
|
Implemented in DLFileBasedIO, and DLMemoryBasedIO.
virtual int DLIOStream::dlWrite | ( | void * | buff, | |
int | size | |||
) | [pure virtual] |
dlWrite is a pure virtual function to write a buffer with size to the DOCLIB I/O stream.
buff | buffer to write | |
size | buffer size to write |
Implemented in DLFileBasedIO, and DLMemoryBasedIO.
virtual int DLIOStream::dlClose | ( | ) | [pure virtual] |
dlClose is a pure virtual function to close the current DOCLIB I/O stream.
Implemented in DLFileBasedIO, and DLMemoryBasedIO.
virtual int DLIOStream::dlFlush | ( | ) | [pure virtual] |
dlFlush is a pure virtual function to flush the current DOCLIB I/O stream.
Implemented in DLFileBasedIO, and DLMemoryBasedIO.
DLEndian DLIOStream::sys_endian [protected] |
Stors the current system's byte order (endian).
Definition at line 163 of file DLIOStream.h.
Referenced by DLIOStream().