QBuffer

QBuffer 

#include <QBuffer>

 

Public Functions

  QBuffer(QObject *parent = nullptr)
  QBuffer(QByteArray *byteArray, QObject *parent = nullptr)
virtual ~QBuffer()
QByteArray & buffer()
const QByteArray & buffer() const
const QByteArray & data() const
void setBuffer(QByteArray *byteArray)
void setData(const QByteArray &data)
void setData(const char *data, int size)

 

 

 

 

 

 

 

 

 

 

 

Reimplemented Public Functions

virtual bool atEnd() const override
virtual bool canReadLine() const override
virtual void close() override
virtual bool open(QIODevice::OpenMode flags) override
virtual qint64 pos() const override
virtual bool seek(qint64 pos) override
virtual qint64 size() const override

 

 

 

 

 

 

 

 

 

QBuffer buffer;
char ch;

buffer.open(QBuffer::ReadWrite);
buffer.write("Qt rocks!");
buffer.seek(0);
buffer.getChar(&ch);  // ch == 'Q'
buffer.getChar(&ch);  // ch == 't'
buffer.getChar(&ch);  // ch == ' '
buffer.getChar(&ch);  // ch == 'r'

 

 

 

######################

posted @ 2022-12-15 15:21  西北逍遥  阅读(82)  评论(0编辑  收藏  举报