niodevice.h

Go to the documentation of this file.
00001 // LICENSE: (Please see the file COPYING for details)
00002 //
00003 // NUS - Nemesis Utilities System: A C++ application development framework 
00004 // Copyright (C) 2006, 2007 Otavio Rodolfo Piske
00005 //
00006 //  This file is part of NUS
00007 //
00008 //  This library is free software; you can redistribute it and/or
00009 //  modify it under the terms of the GNU Lesser General Public
00010 //  License as published by the Free Software Foundation version 2.1
00011 //  of the License.
00012 //
00013 //  This library is distributed in the hope that it will be useful,
00014 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016 //  Lesser General Public License for more details.
00017 //
00018 //  You should have received a copy of the GNU Lesser General Public
00019 //  License along with this library; if not, write to the Free Software
00020 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00021 //
00022 #ifndef NIODEVICE_H
00023 #define NIODEVICE_H
00024 
00029 #include "ndefs.h"
00030 #include "nobject.h"
00031 #include "ndatastream.h"
00032 
00033 
00037 class DllDeclSpec NIODevice: public NObject {
00038       public:
00043             enum Mode {
00044                   NotOpen = 1,      
00045                   ReadOnly = 2,     
00046                   ReadWrite = 4,    
00047                   Append = 8,       
00048                   Truncate = 16,    
00049             };
00050             
00054             NIODevice(void);
00055             
00059             virtual ~NIODevice();
00060             
00065             virtual void open(Mode mode) = 0;
00066             
00070             virtual void closeDevice(void) = 0;
00071             
00076             void setReadBufferSize(nuint32 size);
00077             
00082             nuint32 getReadBufferSize(void) const;
00083             
00084             
00090             virtual nint32 read(NDataStream *buffer) = 0;
00091             
00098             virtual nint32 read(NDataStream *buffer, nuint32 bytes) = 0;
00099             
00105             virtual nint32 readLine(NDataStream *buffer) = 0;
00106             
00114             virtual nint32 write(const NDataStream &data, nuint32 bytes = 0) = 0;
00115       
00116       protected:
00117             nuint32 m_readBufferSize;     
00118 };
00119 
00120 #endif // NIODEVICE_H

Generated on Wed Mar 5 23:10:35 2008 for NemesisUtilitiesSystem by  doxygen 1.5.4