DLIOStream.h

Go to the documentation of this file.
00001 
00002 #ifndef DLIOSTREAM_H
00003 #define DLIOSTREAM_H
00004 #include "DLUtils.h"
00005 #include <iostream>
00006 using namespace std;
00007 
00025 class DLIOStream
00026 {
00027    public:
00028 
00029    /*
00030     * Constructor.  Sets the endian byte order for the current system
00031     *  <ul>
00032     *  <li> DL_LE - Little Endian
00033     *  <li> DL_BE - Big Endian
00034     *  </ul>
00035     * 
00036     */
00037    DLIOStream(){this->sys_endian = DLUtils::testByteOrder();
00038    };
00039 
00040 
00052    virtual int dlRead(void* buff, int size) = 0;
00064    virtual int dlGets(void* buff, int size) = 0;
00065 
00074    virtual string dlGetLine () = 0;
00075 
00090    virtual int dlGetInt(DLEndian endian) = 0;
00091 
00105    virtual short dlGetShort(DLEndian endian)  = 0;
00119    virtual void dlWriteInt(int intVal, DLEndian endian) = 0;
00134    virtual void dlWriteShort(short shortVal, DLEndian endian) = 0;
00135 
00143    virtual int dlWrite(void* buff, int size) = 0;  
00144 
00151    virtual int dlClose () = 0;
00158    virtual int dlFlush() = 0;
00159 
00160 
00161    protected:
00163    virtual ~DLIOStream(){};
00172    DLEndian sys_endian;
00173 };
00174 #endif //DLIOSTREAM_H

DOCLIB is being developed under contract by a collaboration between:
The Laboratory for Language and Media Processing
Unviersity of Maryland, College Park
and
Booz | Allen | Hamilton

All Rights Reserved, 2003-2007