Buffer.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 #ifndef PROTOCOLS__GENERICS__BUFFER_H
00024 #define PROTOCOLS__GENERICS__BUFFER_H
00025
00026 #include "Imports.h"
00027
00028 namespace Protocols {
00029 namespace Generics {
00030
00032
00040 class Buffer
00041 {
00042 public:
00043 virtual ~Buffer() {};
00044
00045 virtual bool canRead (int count) const = 0;
00046
00047 virtual QByteArray peek (int count) const = 0;
00048 virtual QByteArray peekAtMost (int count) const = 0;
00049 virtual QByteArray peekTo (const QByteArray &delimiter) const = 0;
00050 virtual QByteArray peekAll() const = 0;
00051
00052 virtual QByteArray read (int count) = 0;
00053 virtual QByteArray readAtMost (int count) = 0;
00054 virtual QByteArray readTo (const QByteArray &delimiter) = 0;
00055 virtual QByteArray readAll() = 0;
00056
00057 virtual bool canWrite (int count) const = 0;
00058 virtual bool write (const QByteArray &bytes, bool flush = true) = 0;
00059 };
00060
00061 }
00062 }
00063
00064 #endif // PROTOCOLS__GENERICS__BUFFER_H