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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? qtextstream.cpp

?? QT 開發(fā)環(huán)境里面一個很重要的文件
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
/*! \internal*/bool QTextStreamPrivate::fillReadBuffer(qint64 maxBytes){    // no buffer next to the QString itself; this function should only    // be called internally, for devices.    Q_ASSERT(!string);    Q_ASSERT(device);    // handle text translation and bypass the Text flag in the device.    bool textModeEnabled = device->isTextModeEnabled();    if (textModeEnabled)        device->setTextModeEnabled(false);#ifndef QT_NO_TEXTCODEC    // codec auto detection, explicitly defaults to locale encoding if    // the codec has been set to 0.    if (!codec || autoDetectUnicode) {        autoDetectUnicode = false;        char bomBuffer[2];        if (device->peek(bomBuffer, 2) == 2 && (uchar(bomBuffer[0]) == 0xff && uchar(bomBuffer[1]) == 0xfe                                                || uchar(bomBuffer[0]) == 0xfe && uchar(bomBuffer[1]) == 0xff)) {            codec = QTextCodec::codecForName("UTF-16");        } else if (!codec) {            codec = QTextCodec::codecForLocale();            writeConverterState.flags |= QTextCodec::IgnoreHeader;        }    }#if defined (QTEXTSTREAM_DEBUG)    qDebug("QTextStreamPrivate::fillReadBuffer(), using %s codec",           codec->name().constData());#endif#endif    // read raw data into a temporary buffer    char buf[QTEXTSTREAM_BUFFERSIZE];    qint64 bytesRead = 0;#if defined(Q_OS_WIN)    // On Windows, there is no non-blocking stdin - so we fall back to reading    // lines instead. If there is no QOBJECT, we read lines for all sequential    // devices; otherwise, we read lines only for stdin.    QFile *file = 0;    Q_UNUSED(file);    if (device->isSequential()#if !defined(QT_NO_QOBJECT)        && (file = qobject_cast<QFile *>(device)) && file->handle() == 0#endif        ) {        if (maxBytes != -1)            bytesRead = device->readLine(buf, qMin<qint64>(sizeof(buf), maxBytes));        else            bytesRead = device->readLine(buf, sizeof(buf));    } else#endif    {        if (maxBytes != -1)            bytesRead = device->read(buf, qMin<qint64>(sizeof(buf), maxBytes));        else            bytesRead = device->read(buf, sizeof(buf));    }#if defined (QTEXTSTREAM_DEBUG)    qDebug("QTextStreamPrivate::fillReadBuffer(), device->read(\"%s\", %d) == %d",           qt_prettyDebug(buf, qMin(32,int(bytesRead)) , int(bytesRead)).constData(), sizeof(buf), int(bytesRead));#endif    if (bytesRead <= 0)        return false;    int oldReadBufferSize = readBuffer.size();    readBuffer += endOfBufferState;#ifndef QT_NO_TEXTCODEC    // convert to unicode    readBuffer += codec->toUnicode(buf, bytesRead, &readConverterState);#else    readBuffer += QString(QByteArray(buf, bytesRead));#endif    // reset the Text flag.    if (textModeEnabled)        device->setTextModeEnabled(true);    // remove all '\r\n' in the string.    if (readBuffer.size() > oldReadBufferSize && textModeEnabled) {        QChar CR = QLatin1Char('\r');        QChar LF = QLatin1Char('\n');        QChar *writePtr = readBuffer.data();        QChar *readPtr = readBuffer.data();        QChar *endPtr = readBuffer.data() + readBuffer.size();        int n = 0;        while (readPtr < endPtr) {            if (readPtr + 1 < endPtr && *readPtr == CR && *(readPtr + 1) == LF) {                *writePtr = LF;                if (n < readBufferOffset)                    --readBufferOffset;                ++readPtr;            } else  if (readPtr != writePtr) {                *writePtr = *readPtr;            }            ++n;            ++writePtr;            ++readPtr;        }        readBuffer.resize(writePtr - readBuffer.data());        if (readBuffer.endsWith(QLatin1Char('\r')) && !device->atEnd()) {            endOfBufferState = QLatin1String("\r");            readBuffer.chop(1);        } else {            endOfBufferState.clear();        }    }#if defined (QTEXTSTREAM_DEBUG)    qDebug("QTextStreamPrivate::fillReadBuffer() read %d bytes from device. readBuffer = [%s]", int(bytesRead),           qt_prettyDebug(readBuffer.toLatin1(), readBuffer.size(), readBuffer.size()).data());#endif    return true;}/*! \internal*/bool QTextStreamPrivate::flushWriteBuffer(){    // no buffer next to the QString itself; this function should only    // be called internally, for devices.    if (string || !device)        return false;    if (writeBuffer.isEmpty())        return true;#if defined (Q_OS_WIN)    // handle text translation and bypass the Text flag in the device.    bool textModeEnabled = device->isTextModeEnabled();    if (textModeEnabled) {        device->setTextModeEnabled(false);        writeBuffer.replace(QLatin1Char('\n'), QLatin1String("\r\n"));    }#endif#ifndef QT_NO_TEXTCODEC    if (!codec)        codec = QTextCodec::codecForLocale();#if defined (QTEXTSTREAM_DEBUG)    qDebug("QTextStreamPrivate::flushWriteBuffer(), using %s codec (%s generating BOM)",           codec->name().constData(), writeConverterState.flags & QTextCodec::IgnoreHeader ? "not" : "");#endif    // convert from unicode to raw data    QByteArray data = codec->fromUnicode(writeBuffer.data(), writeBuffer.size(), &writeConverterState);#else    QByteArray data = writeBuffer.toLocal8Bit();#endif    writeBuffer.clear();    // write raw data to the device    qint64 bytesWritten = device->write(data);#if defined (QTEXTSTREAM_DEBUG)    qDebug("QTextStreamPrivate::flushWriteBuffer(), device->write(\"%s\") == %d",           qt_prettyDebug(data.constData(), qMin(data.size(),32), data.size()).constData(), int(bytesWritten));#endif    if (bytesWritten <= 0)        return false;#if defined (Q_OS_WIN)    // replace the text flag    if (textModeEnabled)        device->setTextModeEnabled(true);#endif    // flush the file#ifndef QT_NO_QOBJECT    QFile *file = qobject_cast<QFile *>(device);    bool flushed = file && file->flush();#else    bool flushed = true;#endif#if defined (QTEXTSTREAM_DEBUG)    qDebug("QTextStreamPrivate::flushWriteBuffer() wrote %d bytes",           int(bytesWritten));#endif    return flushed && bytesWritten == qint64(data.size());}/*! \internal    Scans no more than \a maxlen QChars in the current buffer for the    first \a delimiter. Stores a pointer to the start offset of the    token in \a ptr, and the length in QChars in \a length.*/bool QTextStreamPrivate::scan(const QChar **ptr, int *length, int maxlen, TokenDelimiter delimiter){    int totalSize = 0;    int delimSize = 0;    bool consumeDelimiter = false;    bool foundToken = false;    int startOffset = device ? readBufferOffset : stringOffset;    QChar lastChar;    bool canStillReadFromDevice = true;    do {        int endOffset;        const QChar *chPtr;        if (device) {            chPtr = readBuffer.constData();            endOffset = readBuffer.size();        } else {            chPtr = string->constData();            endOffset = string->size();        }        chPtr += startOffset;        for (; !foundToken && startOffset < endOffset && (!maxlen || totalSize < maxlen); ++startOffset) {            const QChar ch = *chPtr++;            ++totalSize;            if (delimiter == Space && ch.isSpace()) {                foundToken = true;                delimSize = 1;            } else if (delimiter == NotSpace && !ch.isSpace()) {                foundToken = true;                delimSize = 1;            } else if (delimiter == EndOfLine && ch == QLatin1Char('\n')) {                foundToken = true;                delimSize = (lastChar == QLatin1Char('\r')) ? 2 : 1;                consumeDelimiter = true;            }            lastChar = ch;        }    } while (!foundToken             && (!maxlen || totalSize < maxlen)             && (device && (canStillReadFromDevice = fillReadBuffer())));    // if the token was not found, but we reached the end of input,    // then we accept what we got. if we are not at the end of input,    // we return false.    if (!foundToken && (!maxlen || totalSize < maxlen)        && (totalSize == 0            || (string && stringOffset + totalSize < string->size())            || (device && !device->atEnd() && canStillReadFromDevice))) {#if defined (QTEXTSTREAM_DEBUG)        qDebug("QTextStreamPrivate::scan() did not find the token.");#endif        return false;    }    // if we find a '\r' at the end of the data when reading lines,    // don't make it part of the line.    if (totalSize > 0 && !foundToken && delimiter == EndOfLine) {        if (((string && stringOffset + totalSize == string->size()) || (device && device->atEnd()))            && lastChar == QLatin1Char('\r')) {            consumeDelimiter = true;            ++delimSize;        }    }    // set the read offset and length of the token    if (length)        *length = totalSize - delimSize;    if (ptr)        *ptr = readPtr();    // update last token size. the callee will call consumeLastToken() when    // done.    lastTokenSize = totalSize;    if (!consumeDelimiter)        lastTokenSize -= delimSize;#if defined (QTEXTSTREAM_DEBUG)    qDebug("QTextStreamPrivate::scan(%p, %p, %d, %x) token length = %d, delimiter = %d",           ptr, length, maxlen, (int)delimiter, totalSize - delimSize, delimSize);#endif    return true;}/*! \internal*/inline const QChar *QTextStreamPrivate::readPtr() const{    Q_ASSERT(readBufferOffset <= readBuffer.size());    if (string)        return string->constData() + stringOffset;    return readBuffer.constData() + readBufferOffset;}/*! \internal*/inline void QTextStreamPrivate::consumeLastToken(){    if (lastTokenSize)        consume(lastTokenSize);    lastTokenSize = 0;}/*! \internal*/inline void QTextStreamPrivate::consume(int size){#if defined (QTEXTSTREAM_DEBUG)    qDebug("QTextStreamPrivate::consume(%d)", size);#endif    if (string) {        stringOffset += size;        if (stringOffset > string->size())            stringOffset = string->size();    } else {        readBufferOffset += size;        if (readBufferOffset >= readBuffer.size()) {            readBufferOffset = 0;            readBuffer.clear();            readBufferStartDevicePos = device->pos();#ifndef QT_NO_TEXTCODEC            copyConverterState(&readBufferStartReadConverterState, &readConverterState);#endif            readBufferStartEndOfBufferState = endOfBufferState;        }    }}/*! \internal*/inline bool QTextStreamPrivate::write(const QString &data){    if (string) {        // ### What about seek()??        string->append(data);    } else {        writeBuffer += data;        if (writeBuffer.size() > QTEXTSTREAM_BUFFERSIZE)            return flushWriteBuffer();    }    return true;}/*! \internal*/inline bool QTextStreamPrivate::getChar(QChar *ch){    if ((string && stringOffset == string->size())        || (device && readBuffer.isEmpty() && !fillReadBuffer())) {        if (ch)            *ch = 0;        return false;    }    if (ch)        *ch = *readPtr();    consume(1);    return true;}/*! \internal*/inline void QTextStreamPrivate::ungetChar(const QChar &ch){    if (string) {        if (stringOffset == 0)            string->prepend(ch);        else            (*string)[--stringOffset] = ch;        return;    }    if (readBufferOffset == 0) {        readBuffer.prepend(ch);        return;    }    readBuffer[--readBufferOffset] = ch;}/*! \internal*/inline bool QTextStreamPrivate::putString(const QString &s){    QString tmp = s;    // handle padding    int padSize = fieldWidth - s.size();    if (padSize > 0) {        QString pad(padSize > 0 ? padSize : 0, padChar);        if (fieldAlignment == QTextStream::AlignLeft) {            tmp.append(QString(padSize, padChar));        } else if (fieldAlignment == QTextStream::AlignRight) {            tmp.prepend(QString(padSize, padChar));        } else if (fieldAlignment == QTextStream::AlignCenter) {            tmp.prepend(QString(padSize/2, padChar));            tmp.append(QString(padSize - padSize/2, padChar));        }    }#if defined (QTEXTSTREAM_DEBUG)    QByteArray a = s.toUtf8();    QByteArray b = tmp.toUtf8();    qDebug("QTextStreamPrivate::putString(\"%s\") calls write(\"%s\")",           qt_prettyDebug(a.constData(), a.size(), qMax(16, a.size())).constData(),           qt_prettyDebug(b.constData(), b.size(), qMax(16, b.size())).constData());#endif    return write(tmp);}/*!    Constructs a QTextStream. Before you can use it for reading or    writing, you must assign a device or a string.    \sa setDevice(), setString()*/QTextStream::QTextStream()    : d_ptr(new QTextStreamPrivate(this)){#if defined (QTEXTSTREAM_DEBUG)    qDebug("QTextStream::QTextStream()");#endif    Q_D(QTextStream);    d->status = Ok;}/*!    Constructs a QTextStream that operates on \a device.*/QTextStream::QTextStream(QIODevice *device)    : d_ptr(new QTextStreamPrivate(this)){#if defined (QTEXTSTREAM_DEBUG)    qDebug("QTextStream::QTextStream(QIODevice *device == *%p)",           device);#endif    Q_D(QTextStream);    d->device = device;#ifndef QT_NO_QOBJECT    d->deviceClosedNotifier.setupDevice(this, d->device);#endif    d->status = Ok;}/*!    Constructs a QTextStream that operates on \a string, using \a    openMode to define the open mode.*/QTextStream::QTextStream(QString *string, QIODevice::OpenMode openMode)    : d_ptr(new QTextStreamPrivate(this)){#if defined (QTEXTSTREAM_DEBUG)    qDebug("QTextStream::QTextStream(QString *string == *%p, openMode = %d)",           string, int(openMode));#endif    Q_D(QTextStream);    d->string = string;    d->stringOpenMode = openMode;    d->status = Ok;}/*!    Constructs a QTextStream that operates on \a array, using \a    openMode to define the open mode. Internally, the array is wrapped    by a QBuffer.*/QTextStream::QTextStream(QByteArray *array, QIODevice::OpenMode openMode)    : d_ptr(new QTextStreamPrivate(this)){#if defined (QTEXTSTREAM_DEBUG)    qDebug("QTextStream::QTextStream(QByteArray *array == *%p, openMode = %d)",           array, int(openMode));#endif    Q_D(QTextStream);    d->device = new QBuffer(array);    d->device->open(openMode);    d->deleteDevice = true;#ifndef QT_NO_QOBJECT

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
五月天一区二区| 精品综合久久久久久8888| 日韩欧美自拍偷拍| 91社区在线播放| 老司机免费视频一区二区三区| 亚洲免费av观看| 国产亚洲精品7777| 欧美一级黄色大片| 欧美日韩国产大片| 色女孩综合影院| 国产99一区视频免费| 日本va欧美va欧美va精品| 亚洲三级在线免费| 国产精品乱人伦| 日韩精品在线一区| 777色狠狠一区二区三区| 91久久精品一区二区| 不卡免费追剧大全电视剧网站| 精品在线观看免费| 人人爽香蕉精品| 一级日本不卡的影视| 亚洲视频狠狠干| 欧美激情综合网| 欧美激情在线一区二区三区| 欧美成人艳星乳罩| 日韩精品中文字幕在线不卡尤物| 欧美日韩激情一区二区| 色综合天天综合在线视频| 成人开心网精品视频| 国产精品一区在线观看乱码| 久久激情五月婷婷| 免费视频一区二区| 日本欧美在线看| 青草国产精品久久久久久| 天堂一区二区在线| 日韩高清欧美激情| 蜜臀久久99精品久久久久宅男| 日日摸夜夜添夜夜添国产精品 | 精品视频资源站| 欧美伊人精品成人久久综合97| av电影在线观看不卡| 91香蕉国产在线观看软件| 97se亚洲国产综合自在线不卡| 99久久er热在这里只有精品66| www.视频一区| 色综合色综合色综合色综合色综合 | 国产精品污www在线观看| 久久久精品蜜桃| 国产精品婷婷午夜在线观看| 中文字幕av不卡| 亚洲视频一区二区在线观看| 一区二区三区在线观看视频| 亚洲观看高清完整版在线观看 | 国产精品少妇自拍| 亚洲男人都懂的| 亚洲h在线观看| 男女男精品视频| 国产精华液一区二区三区| 成人涩涩免费视频| 在线欧美一区二区| 欧洲一区二区av| 精品少妇一区二区三区免费观看| 国产欧美1区2区3区| 综合分类小说区另类春色亚洲小说欧美| 亚洲免费色视频| 蜜臀av性久久久久蜜臀av麻豆| 福利一区福利二区| 色综合一个色综合亚洲| 91精品国产一区二区| 久久在线观看免费| 国产精品久久久久三级| 亚洲一二三区视频在线观看| 久久精品国产第一区二区三区| 国产福利一区二区三区| 色先锋aa成人| 久久亚洲综合av| 一区二区三区中文在线观看| 另类小说综合欧美亚洲| eeuss鲁一区二区三区| 欧美日韩不卡一区二区| 国产亚洲欧美在线| 亚洲成人7777| 成人精品视频网站| 91精品国产一区二区三区香蕉 | 狂野欧美性猛交blacked| 99久久国产综合色|国产精品| 欧美一级日韩免费不卡| 国产精品久久久久久久岛一牛影视 | 国产无遮挡一区二区三区毛片日本| 亚洲色图欧美偷拍| 国产精品一区在线观看你懂的| 欧美日韩在线播放一区| 国产欧美一区二区三区沐欲| 亚洲第一av色| 91原创在线视频| 久久久99免费| 男男gaygay亚洲| 日本乱码高清不卡字幕| 日本一区免费视频| 免费欧美在线视频| 欧美日韩在线播放三区四区| 国产精品视频在线看| 激情图区综合网| 欧美夫妻性生活| 亚洲自拍偷拍麻豆| 99久久精品一区二区| 2024国产精品视频| 美腿丝袜亚洲一区| 欧美三级一区二区| 一区二区三区小说| 成人18精品视频| 国产亚洲美州欧州综合国| 免费观看在线色综合| 欧美色男人天堂| 一区二区三区在线视频观看58| 成人福利视频在线看| 久久精品日产第一区二区三区高清版| 日韩黄色免费电影| 欧美日韩一区三区四区| 亚洲午夜av在线| 欧美午夜精品免费| 亚洲欧美日韩一区| 色婷婷久久久久swag精品| 成人欧美一区二区三区小说| 不卡电影免费在线播放一区| 中文字幕va一区二区三区| 粉嫩高潮美女一区二区三区| 国产欧美日韩在线| 国产精品1区2区| 国产女人18毛片水真多成人如厕| 国产真实乱偷精品视频免| 精品美女一区二区| 国产一区不卡在线| 国产视频亚洲色图| 成人精品高清在线| 日韩一区中文字幕| 在线亚洲高清视频| 亚洲妇女屁股眼交7| 欧美日韩国产成人在线91| 午夜av一区二区三区| 3atv一区二区三区| 美腿丝袜亚洲三区| 久久久久久久久久久99999| 国产成人精品在线看| 国产精品久久久久久久久动漫 | 精品久久久久久久久久久久久久久久久 | 欧美在线不卡一区| 一区二区三区在线视频观看58 | 国产免费成人在线视频| 成人免费毛片a| 尤物视频一区二区| 欧美电影一区二区| 国产精品99久久久久久宅男| 国产精品人妖ts系列视频| 在线精品视频免费观看| 丝袜亚洲精品中文字幕一区| 精品日韩欧美在线| 丁香婷婷综合激情五月色| 亚洲三级在线免费| 91精品午夜视频| 国产精品99久久久久久似苏梦涵| 中文字幕一区不卡| 4438x亚洲最大成人网| 国产宾馆实践打屁股91| **欧美大码日韩| 欧美另类变人与禽xxxxx| 国产精品一区二区x88av| 亚洲欧美一区二区三区久本道91| 欧美精品aⅴ在线视频| 国产成人在线影院| 亚洲国产精品人人做人人爽| 精品日产卡一卡二卡麻豆| 99久久精品国产毛片| 日韩精品高清不卡| 中文字幕在线观看一区二区| 欧美日韩国产中文| 国产成a人亚洲| 天天影视网天天综合色在线播放| 国产视频一区二区在线观看| 欧美日韩一级黄| 成人小视频免费观看| 五月婷婷综合激情| 国产精品国产三级国产aⅴ中文| 制服丝袜亚洲色图| 成人av资源站| 久久国产精品99久久人人澡| 亚洲激情中文1区| 国产日韩欧美精品一区| 欧美福利视频导航| 99精品欧美一区二区蜜桃免费 | 国产清纯美女被跳蛋高潮一区二区久久w| 91麻豆产精品久久久久久| 久久99精品国产91久久来源| 亚洲一级片在线观看| 久久精品一区二区三区四区| 777a∨成人精品桃花网| 91浏览器在线视频| 成人午夜碰碰视频| 国产在线播放一区| 日韩精品成人一区二区三区|