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
00044 class KDECORE_EXPORT KIOBufferBase
00045 {
00046 public:
00050 KIOBufferBase()
00051 { }
00052
00056 KIOBufferBase(const KIOBufferBase& )
00057 { }
00058
00062 virtual ~KIOBufferBase()
00063 { }
00064
00068 KIOBufferBase& operator=(const KIOBufferBase& )
00069 { return *this; }
00070
00074 virtual bool canReadLine() const = 0;
00075
00079 virtual qint64 readLine(char* data, qint64 maxlen) = 0;
00080
00087 virtual qint64 length() const = 0;
00088
00092 inline bool isEmpty() const
00093 { return length() == 0; }
00094
00101 virtual qint64 size() const = 0;
00102
00106 inline bool isFull() const
00107 { return size() != -1 && size() == length(); }
00108
00116 virtual bool setSize(qint64 size) = 0;
00117
00125 virtual qint64 feedBuffer(const char *data, qint64 len) = 0;
00126
00135 virtual qint64 consumeBuffer(char *data, qint64 maxlen, bool discard = true) = 0;
00136
00140 virtual void clear() = 0;
00141 };
00142
00143 #endif