KDECore
k3iobuffer.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef KIOBUFFER_H
00026 #define KIOBUFFER_H
00027
00028 #include <kdecore_export.h>
00029 #include <QtCore/QByteArray>
00030
00031
00043 class KDECORE_EXPORT KIOBufferBase
00044 {
00045 public:
00049 KIOBufferBase()
00050 { }
00051
00055 KIOBufferBase(const KIOBufferBase& )
00056 { }
00057
00061 virtual ~KIOBufferBase()
00062 { }
00063
00067 KIOBufferBase& operator=(const KIOBufferBase& )
00068 { return *this; }
00069
00073 virtual bool canReadLine() const = 0;
00074
00078 virtual qint64 readLine(char* data, qint64 maxlen) = 0;
00079
00086 virtual qint64 length() const = 0;
00087
00091 inline bool isEmpty() const
00092 { return length() == 0; }
00093
00100 virtual qint64 size() const = 0;
00101
00105 inline bool isFull() const
00106 { return size() != -1 && size() == length(); }
00107
00115 virtual bool setSize(qint64 size) = 0;
00116
00124 virtual qint64 feedBuffer(const char *data, qint64 len) = 0;
00125
00134 virtual qint64 consumeBuffer(char *data, qint64 maxlen, bool discard = true) = 0;
00135
00139 virtual void clear() = 0;
00140 };
00141
00142 #endif