Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

IODevice.h

00001 /*****************************************************************************
00002  * Author:   Valient Gough <vgough@pobox.com>
00003  *
00004  *****************************************************************************
00005  * Copyright (c) 2001, Valient Gough
00006  *
00007  * This library is free software; you can distribute it and/or modify it under
00008  * the terms of the GNU Lesser General Public License (LGPL), as published by
00009  * the Free Software Foundation; either version 2.1 of the License, or (at your
00010  * option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful, but WITHOUT
00013  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014  * FITNESS FOR A PARTICULAR PURPOSE.  See the LGPL in the file COPYING for more
00015  * details.
00016  *
00017  */
00018 
00019 #ifndef _IODevice_incl_
00020 #define _IODevice_incl_
00021 
00022 #include <rel/SmartPtr.h>
00023 #include <stdint.h>
00024 
00025 namespace rel
00026 {
00027 
00028     class OpaqueValue;
00029 
00039     class IODevice
00040     {
00041     public:
00042         typedef int64_t size_type;
00043 
00044         IODevice();
00045         virtual ~IODevice();
00046 
00050         virtual int getReadDescriptor() const;
00051 
00055         virtual bool isDirectAccess() const;
00056 
00061         virtual size_type at() const;
00062 
00064         virtual bool at(size_type offset);
00065 
00066         // return true if at end of stream
00067         virtual bool atEnd() const;
00068 
00069 
00073         virtual size_type writeBytes(const char *data, size_type len);
00074 
00078         virtual void flush();
00079 
00084         virtual size_type readBytes(char *data, size_type maxLen);
00085 
00086 
00087 
00090         virtual SmartPtr<char*> print();
00091 
00092     private:
00093     };
00094 
00095 
00096 } // namespace rel
00097 
00098 #endif
00099 
00100 

Generated at Sat Sep 22 02:20:00 2001 for librel by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001