kdecore Library API Documentation

kiobuffer.h

00001 /*  -*- C++ -*-
00002  *  Copyright (C) 2003 Thiago Macieira <thiago.macieira@kdemail.net>
00003  *
00004  *
00005  *  Permission is hereby granted, free of charge, to any person obtaining
00006  *  a copy of this software and associated documentation files (the
00007  *  "Software"), to deal in the Software without restriction, including
00008  *  without limitation the rights to use, copy, modify, merge, publish,
00009  *  distribute, sublicense, and/or sell copies of the Software, and to
00010  *  permit persons to whom the Software is furnished to do so, subject to
00011  *  the following conditions:
00012  *
00013  *  The above copyright notice and this permission notice shall be included 
00014  *  in all copies or substantial portions of the Software.
00015  *
00016  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00017  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00018  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00019  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00020  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00021  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00022  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00023  */
00024 
00025 #ifndef KIOBUFFER_H
00026 #define KIOBUFFER_H
00027 
00028 #include <qglobal.h>
00029 
00030 class QIODevice;
00031 
00042 class KIOBufferBase
00043 {
00044 public:
00048   KIOBufferBase()
00049   { }
00050 
00054   KIOBufferBase(const KIOBufferBase& )
00055   { }
00056 
00060   virtual ~KIOBufferBase()
00061   { }
00062 
00066   KIOBufferBase& operator=(const KIOBufferBase& )
00067   { return *this; }
00068 
00072   virtual bool canReadLine() const = 0;
00073 
00077   virtual QCString readLine() = 0;
00078 
00085   virtual Q_LONG length() const = 0;
00086 
00090   inline bool isEmpty() const
00091   { return length() == 0; }
00092 
00099   virtual Q_LONG size() const = 0;
00100 
00104   inline bool isFull() const
00105   { return size() != -1 && size() == length(); }
00106 
00114   virtual bool setSize(Q_LONG size) = 0;
00115 
00123   virtual Q_LONG feedBuffer(const char *data, Q_LONG len) = 0;
00124 
00133   virtual Q_LONG consumeBuffer(char *data, Q_LONG maxlen, bool discard = true) = 0;
00134 
00138   virtual void clear() = 0;
00139 };
00140 
00141 #endif
KDE Logo
This file is part of the documentation for kdecore Library Version 3.3.90.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 30 10:09:39 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003