Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members  

InputStream

00001 /*
00002  * NOTE: "zlib/libpng" style License
00003  *
00004  *                 ----=== s t d n e t ===----
00005  *
00006  * Copyright (c) 2002 Warwick Molloy   w-molloy@users.sf.net
00007  *
00008  * Copyright (c) 2002 Stdnet Community
00009  * HTTP://Sourceforge.net/projects/stdnet
00010  *
00011  * All references to "software" refer to the stdnet.
00012  *
00013  * This software is provided 'as-is', without any express or
00014  * implied warranty. In no event will the authors be held liable
00015  * for any damages arising from the use of this software.
00016  *
00017  * Permission is granted to anyone to use this software for any
00018  * purpose, including commercial applications, and to alter it
00019  * and redistribute it freely, subject to the following
00020  * restrictions:
00021  *
00022  * 1.  The origin of this software must not be misrepresented;
00023  *     you must not claim that you wrote the original software.
00024  *     If you use this software in a product, an acknowledgment
00025  *     in the product documentation would be appreciated but
00026  *     is not required.
00027  *
00028  * 2.  Altered source versions must be plainly marked as such,
00029  *     and must not be misrepresented as being the original
00030  *     software.
00031  *
00032  * 3.  This notice may not be removed or altered from any source
00033  *     distribution.
00034  */
00035 
00036 #ifndef __io_InputStream__
00037 #define __io_InputStream__
00038 
00039 #include <stdnet/system/Abstract>
00040 #include <stdnet/io/IOException>
00041 #include <stdnet/config.h>
00042 
00043 namespace stdbase {
00044     namespace io {
00045 
00053 class InputStream : public system::Abstract
00054 {
00055 protected:
00056     virtual ~InputStream() {};
00057 
00064     virtual void        inc() const { this->inc(); }
00065 
00072     virtual unsigned    dec() const { return this->dec(); }
00073 
00074 public:
00079     virtual int
00080         available() throw (IOException) = 0;
00081     
00085     virtual void
00086         close() throw (IOException) = 0;
00087 
00096     virtual void
00097         mark( int readlimit) = 0;
00098 
00107     virtual void
00108         reset() throw (IOException) = 0;
00109 
00114     virtual bool
00115         markSupported() = 0;
00116 
00120     virtual int
00121         read( byte buffer[], int len) throw (IOException) = 0;
00122         
00129     virtual int
00130         read() throw (IOException) = 0;
00131 
00137     virtual long
00138         skip( long n ) throw (IOException) = 0;
00139 };
00140 
00141 typedef system::reference< InputStream >    InputStreamRef;
00142 
00143     } // -- end io --
00144 } // -- end stdbase --
00145 #endif  //  __io_InputStream__

Generated at Tue Aug 13 14:19:39 2002 for stdnet2 by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001