亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? qbuffer.cpp

?? QT 開發環境里面一個很重要的文件
?? CPP
字號:
/******************************************************************************** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.**** This file is part of the QtCore module of the Qt Toolkit.**** This file may be used under the terms of the GNU General Public** License version 2.0 as published by the Free Software Foundation** and appearing in the file LICENSE.GPL included in the packaging of** this file.  Please review the following information to ensure GNU** General Public Licensing requirements will be met:** http://www.trolltech.com/products/qt/opensource.html**** If you are unsure which license is appropriate for your use, please** review the following information:** http://www.trolltech.com/products/qt/licensing.html or contact the** sales department at sales@trolltech.com.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.******************************************************************************/#include "qbuffer.h"#include "private/qiodevice_p.h"/** QBufferPrivate **/class QBufferPrivate : public QIODevicePrivate{    Q_DECLARE_PUBLIC(QBuffer)public:    QBufferPrivate()        :#ifndef QT_NO_QOBJECT        signalsEmitted(false), writtenSinceLastEmit(0),#endif        buf(0)  { }    ~QBufferPrivate() { }#ifndef QT_NO_QOBJECT    // private slots    void _q_emitSignals();    bool signalsEmitted;    qint64 writtenSinceLastEmit;#endif    QByteArray *buf;    int ioIndex;    QByteArray defaultBuf;};#ifndef QT_NO_QOBJECTvoid QBufferPrivate::_q_emitSignals(){    Q_Q(QBuffer);    emit q->bytesWritten(writtenSinceLastEmit);    writtenSinceLastEmit = 0;    emit q->readyRead();    signalsEmitted = false;}#endif/*!    \class QBuffer    \reentrant    \brief The QBuffer class provides a QIODevice interface for a QByteArray.    \ingroup io    QBuffer allows you to access a QByteArray using the QIODevice    interface. The QByteArray is treated just as a standard random-accessed    file. Example:    \quotefromfile snippets/buffer/buffer.cpp    \skipto main_snippet    \skipto QBuffer buffer    \printto /^\}$/    By default, an internal QByteArray buffer is created for you when    you create a QBuffer. You can access this buffer directly by    calling buffer(). You can also use QBuffer with an existing    QByteArray by calling setBuffer(), or by passing your array to    QBuffer's constructor.    Call open() to open the buffer. Then call write() or    putChar() to write to the buffer, and read(), readLine(),    readAll(), or getChar() to read from it. size() returns the    current size of the buffer, and you can seek to arbitrary    positions in the buffer by calling seek(). When you are done with    accessing the buffer, call close().    The following code snippet shows how to write data to a    QByteArray using QDataStream and QBuffer:    \skipto write_datastream_snippet    \skipto QByteArray    \printto /^\}$/    Effectively, we convert the application's QPalette into a byte    array. Here's how to read the data from the QByteArray:    \skipto read_datastream_snippet    \skipto QPalette    \printto /^\}$/    QTextStream and QDataStream also provide convenience constructors    that take a QByteArray and that create a QBuffer behind the    scenes.    QBuffer emits readyRead() when new data has arrived in the    buffer. By connecting to this signal, you can use QBuffer to    store temporary data before processing it. For example, you can    pass the buffer to QFtp when downloading a file from an FTP    server. Whenever a new payload of data has been downloaded,    readyRead() is emitted, and you can process the data that just    arrived. QBuffer also emits bytesWritten() every time new data    has been written to the buffer.    \sa QFile, QDataStream, QTextStream, QByteArray*/#ifdef QT_NO_QOBJECTQBuffer::QBuffer()    : QIODevice(*new QBufferPrivate){    Q_D(QBuffer);    d->buf = &d->defaultBuf;    d->ioIndex = 0;}QBuffer::QBuffer(QByteArray *buf)    : QIODevice(*new QBufferPrivate){    Q_D(QBuffer);    d->buf = buf ? buf : &d->defaultBuf;    d->ioIndex = 0;    d->defaultBuf.clear();}#else/*!    Constructs an empty buffer with the given \a parent. You can call    setData() to fill the buffer with data, or you can open it in    write mode and use write().    \sa open()*/QBuffer::QBuffer(QObject *parent)    : QIODevice(*new QBufferPrivate, parent){    Q_D(QBuffer);    d->buf = &d->defaultBuf;    d->ioIndex = 0;}/*!    Constructs a QBuffer that uses the QByteArray pointed to by \a    byteArray as its internal buffer, and with the given \a parent.    The caller is responsible for ensuring that \a byteArray remains    valid until the QBuffer is destroyed, or until setBuffer() is    called to change the buffer. QBuffer doesn't take ownership of    the QByteArray.    If you open the buffer in write-only mode or read-write mode and    write something into the QBuffer, \a byteArray will be modified.    Example:    \quotefromfile snippets/buffer/buffer.cpp    \skipto bytearray_ptr_ctor_snippet    \skipto QByteArray    \printto /^\}/    \sa open(), setBuffer(), setData()*/QBuffer::QBuffer(QByteArray *byteArray, QObject *parent)    : QIODevice(*new QBufferPrivate, parent){    Q_D(QBuffer);    d->buf = byteArray ? byteArray : &d->defaultBuf;    d->defaultBuf.clear();    d->ioIndex = 0;}#endif/*!    Destroys the buffer.*/QBuffer::~QBuffer(){}/*!    Makes QBuffer uses the QByteArray pointed to by \a    byteArray as its internal buffer. The caller is responsible for    ensuring that \a byteArray remains valid until the QBuffer is    destroyed, or until setBuffer() is called to change the buffer.    QBuffer doesn't take ownership of the QByteArray.    Does nothing if isOpen() is true.    If you open the buffer in write-only mode or read-write mode and    write something into the QBuffer, \a byteArray will be modified.    Example:    \quotefromfile snippets/buffer/buffer.cpp    \skipto setBuffer_snippet    \skipto QByteArray    \printto /^\}/    If \a byteArray is 0, the buffer creates its own internal    QByteArray to work on. This byte array is initially empty.    \sa buffer(), setData(), open()*/void QBuffer::setBuffer(QByteArray *byteArray){    Q_D(QBuffer);    if (isOpen()) {        qWarning("QBuffer::setBuffer: Buffer is open");        return;    }    if (byteArray) {        d->buf = byteArray;    } else {        d->buf = &d->defaultBuf;    }    d->defaultBuf.clear();    d->ioIndex = 0;}/*!    Returns a reference to the QBuffer's internal buffer. You can use    it to modify the QByteArray behind the QBuffer's back.    \sa setBuffer(), data()*/QByteArray &QBuffer::buffer(){    Q_D(QBuffer);    return *d->buf;}/*!    \overload    This is the same as data().*/const QByteArray &QBuffer::buffer() const{    Q_D(const QBuffer);    return *d->buf;}/*!    Returns the data contained in the buffer.    This is the same as buffer().    \sa setData(), setBuffer()*/const QByteArray &QBuffer::data() const{    Q_D(const QBuffer);    return *d->buf;}/*!    Sets the contents of the internal buffer to be \a data. This is    the same as assigning \a data to buffer().    Does nothing if isOpen() is true.    \sa setBuffer()*/void QBuffer::setData(const QByteArray &data){    Q_D(QBuffer);    if (isOpen()) {        qWarning("QBuffer::setData: Buffer is open");        return;    }    *d->buf = data;    d->ioIndex = 0;}/*!    \fn void QBuffer::setData(const char *data, int size)    \overload    Sets the contents of the internal buffer to be the first \a size    bytes of \a data.*//*!   \reimp*/bool QBuffer::open(OpenMode flags){    Q_D(QBuffer);    if ((flags & Append) == Append)        flags |= WriteOnly;    setOpenMode(flags);    if (!(isReadable() || isWritable())) {        qWarning("QFile::open: File access not specified");        return false;    }    if ((flags & QIODevice::Truncate) == QIODevice::Truncate) {        d->buf->resize(0);    }    if ((flags & QIODevice::Append) == QIODevice::Append) // append to end of buffer        seek(d->buf->size());    else        seek(0);    return true;}/*!    \reimp*/void QBuffer::close(){    QIODevice::close();}/*!    \reimp*/qint64 QBuffer::pos() const{    return QIODevice::pos();}/*!    \reimp*/qint64 QBuffer::size() const{    Q_D(const QBuffer);    return qint64(d->buf->size());}/*!    \reimp*/bool QBuffer::seek(qint64 pos){    Q_D(QBuffer);    if (pos < 0 || pos >= d->buf->size() + 1) {        qWarning("QBuffer::seek: Invalid pos: %d", int(pos));        return false;    }    d->ioIndex = int(pos);    return QIODevice::seek(pos);}/*!    \reimp*/bool QBuffer::atEnd() const{    return QIODevice::atEnd();}/*!   \reimp*/bool QBuffer::canReadLine() const{    Q_D(const QBuffer);    if (!isOpen())        return false;    return d->buf->indexOf('\n', int(pos())) != -1 || QIODevice::canReadLine();}/*!    \reimp*/qint64 QBuffer::readData(char *data, qint64 len){    Q_D(QBuffer);    if ((len = qMin(len, qint64(d->buf->size()) - d->ioIndex)) <= 0)        return qint64(0);    memcpy(data, d->buf->constData() + d->ioIndex, len);    d->ioIndex += int(len);    return len;}/*!    \reimp*/qint64 QBuffer::writeData(const char *data, qint64 len){    Q_D(QBuffer);    int extraBytes = d->ioIndex + len - d->buf->size();    if (extraBytes > 0) { // overflow        int newSize = d->buf->size() + extraBytes;        d->buf->resize(newSize);        if (d->buf->size() != newSize) { // could not resize            qWarning("QBuffer::writeData: Memory allocation error");            return -1;        }    }    memcpy(d->buf->data() + d->ioIndex, (uchar *)data, int(len));    d->ioIndex += int(len);#ifndef QT_NO_QOBJECT    d->writtenSinceLastEmit += len;    if (!d->signalsEmitted) {        d->signalsEmitted = true;        QMetaObject::invokeMethod(this, "_q_emitSignals", Qt::QueuedConnection);    }#endif    return len;}#ifndef QT_NO_QOBJECT# include "moc_qbuffer.cpp"#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
高清久久久久久| 有坂深雪av一区二区精品| 中文字幕一区二区视频| 亚洲综合另类小说| 天堂成人国产精品一区| 狠狠色丁香九九婷婷综合五月| 国产乱码一区二区三区| 色哟哟在线观看一区二区三区| 欧美美女一区二区三区| 国产精品―色哟哟| 午夜欧美视频在线观看| 国产精品影视在线| 欧美亚洲一区三区| 久久久精品综合| 亚洲小说欧美激情另类| 国产精品一色哟哟哟| 色成年激情久久综合| 欧美精品一区二区三区蜜臀| 亚洲人成伊人成综合网小说| 精品一区二区三区不卡 | 久久久久久久综合狠狠综合| 一区二区三区美女视频| 黄色小说综合网站| 91国模大尺度私拍在线视频| 久久久久久久久久美女| 亚洲国产美国国产综合一区二区| 国内不卡的二区三区中文字幕| 91国偷自产一区二区开放时间 | 成人综合日日夜夜| 欧美久久免费观看| 日韩理论片在线| 国产在线日韩欧美| 欧美丰满少妇xxxxx高潮对白| 中文字幕在线视频一区| 免费黄网站欧美| 欧美亚洲高清一区| 中文字幕二三区不卡| 蜜臀av性久久久久蜜臀aⅴ流畅| 一本大道av一区二区在线播放| 久久蜜桃av一区二区天堂| 五月综合激情网| 91日韩精品一区| 国产欧美日韩麻豆91| 免费一级欧美片在线观看| 色天使色偷偷av一区二区| 国产欧美一区二区精品秋霞影院 | 国产午夜三级一区二区三| 欧美aaaaaa午夜精品| 欧美午夜免费电影| 一区二区三区在线视频观看| av中文字幕亚洲| 国产丝袜欧美中文另类| 精品综合久久久久久8888| 欧美一区二区播放| 日本不卡一二三区黄网| 欧美日韩成人在线| 亚洲一区二区三区爽爽爽爽爽 | 丝袜美腿亚洲色图| 在线视频你懂得一区| 中文字幕一区在线观看视频| 岛国精品在线观看| 久久精品无码一区二区三区| 九九视频精品免费| 精品国产免费一区二区三区四区| 日韩成人免费看| 制服丝袜激情欧洲亚洲| 不卡的电视剧免费网站有什么| 欧美精品一区二区三区在线播放| 捆绑调教一区二区三区| 91精品黄色片免费大全| 麻豆免费精品视频| 精品久久久三级丝袜| 精品在线免费视频| 精品国产三级电影在线观看| 国产乱子轮精品视频| 国产欧美日韩视频在线观看| 大白屁股一区二区视频| 国产精品女主播在线观看| 成人动漫一区二区三区| 最好看的中文字幕久久| 91免费国产视频网站| 亚洲精品欧美激情| 欧美精品色一区二区三区| 51精品秘密在线观看| 免费一级欧美片在线观看| 7777精品伊人久久久大香线蕉超级流畅| 一区二区不卡在线播放 | 国产精品第13页| 99久久婷婷国产| 亚洲精品高清在线观看| 欧美偷拍一区二区| 青草国产精品久久久久久| 精品久久久久久久久久久久包黑料| 狠狠v欧美v日韩v亚洲ⅴ| 久久只精品国产| 成人av在线资源网| 一二三四区精品视频| 69成人精品免费视频| 狠狠色综合播放一区二区| 国产欧美一区二区精品性色超碰| 99精品在线观看视频| 一区二区激情小说| 日韩精品中文字幕一区二区三区 | 另类综合日韩欧美亚洲| 久久九九99视频| 一本色道久久综合亚洲91| 午夜精品免费在线| 欧美一区二区三区在线看| 国产不卡在线一区| 国产成人综合在线| 亚洲视频一区二区免费在线观看| 欧美熟乱第一页| 九九精品视频在线看| 中文字幕一区在线观看| 69久久夜色精品国产69蝌蚪网| 国产99久久久国产精品潘金| 一区二区三区四区视频精品免费 | 国模大尺度一区二区三区| 中文字幕成人av| 欧美高清视频不卡网| 国产91精品精华液一区二区三区| 洋洋成人永久网站入口| 欧美mv日韩mv国产| 91麻豆免费看| 韩日精品视频一区| 亚洲与欧洲av电影| 久久久久久久免费视频了| 欧美日韩中文字幕精品| 黄色资源网久久资源365| 亚洲精品免费在线播放| 久久精品一区二区| 欧美日韩亚洲另类| 成人久久18免费网站麻豆| 日本网站在线观看一区二区三区| 国产精品午夜在线观看| 欧美精品tushy高清| 99vv1com这只有精品| 久久精工是国产品牌吗| 亚洲综合色成人| 亚洲国产精品精华液ab| 日韩三级中文字幕| 91久久精品日日躁夜夜躁欧美| 国产一区二区伦理| 日日夜夜精品视频天天综合网| 136国产福利精品导航| 精品99999| 制服丝袜国产精品| 色av一区二区| 不卡av在线免费观看| 国产在线精品不卡| 免费成人小视频| 亚洲五月六月丁香激情| 国产精品伦一区| 国产亚洲欧美激情| 精品久久久久久久久久久院品网| 欧美又粗又大又爽| 色呦呦日韩精品| 99精品久久免费看蜜臀剧情介绍| 韩国一区二区在线观看| 免费观看成人鲁鲁鲁鲁鲁视频| 亚洲成人先锋电影| 一区二区三区中文字幕| 亚洲三级在线播放| 国产精品狼人久久影院观看方式| 久久影院午夜片一区| 日韩欧美视频在线| 制服丝袜日韩国产| 欧美妇女性影城| 91 com成人网| 欧美一区二区视频在线观看2022 | 久久国产精品72免费观看| 亚洲国产日韩a在线播放 | 678五月天丁香亚洲综合网| 欧美在线影院一区二区| 色菇凉天天综合网| 91亚洲精品乱码久久久久久蜜桃 | 亚洲国产你懂的| 一区二区理论电影在线观看| 亚洲欧美另类久久久精品| 中文字幕亚洲一区二区av在线| 中文字幕av一区二区三区免费看 | 色诱亚洲精品久久久久久| heyzo一本久久综合| hitomi一区二区三区精品| av中文字幕在线不卡| 91欧美激情一区二区三区成人| www.亚洲国产| 91丨九色丨蝌蚪丨老版| 91福利国产精品| 欧美日韩亚洲综合| 日韩视频一区在线观看| 2021国产精品久久精品| 中文字幕欧美区| 亚洲欧洲美洲综合色网| 亚洲精品免费播放| 亚洲国产精品久久人人爱| 日韩高清在线电影| 久久99国产精品久久99果冻传媒| 国产精品自拍一区| 9i在线看片成人免费|