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

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

?? qbitarray.cpp

?? QT 開發環境里面一個很重要的文件
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/******************************************************************************** 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 "qbitarray.h"#include <qdatastream.h>#include <qdebug.h>#include <string.h>/*!    \class QBitArray    \brief The QBitArray class provides an array of bits.    \ingroup tools    \ingroup shared    \reentrant    A QBitArray is an array that gives access to individual bits and    provides operators (\link operator&() AND\endlink, \link    operator|() OR\endlink, \link operator^() XOR\endlink, and \link    operator~() NOT\endlink) that work on entire arrays of bits. It    uses \l{implicit sharing} (copy-on-write) to reduce memory usage    and to avoid the needless copying of data.    The following code constructs a QBitArray containing 200 bits    initialized to false (0):    \code        QBitArray ba(200);    \endcode    To initialize the bits to true, either pass \c true as second    argument to the constructor, or call fill() later on.    QBitArray uses 0-based indexes, just like C++ arrays. To access    the bit at a particular index position, you can use operator[]().    On non-const bit arrays, operator[]() returns a reference to a    bit that can be used on the left side of an assignment. For    example:    \code        QBitArray ba;        ba.resize(3);        ba[0] = true;        ba[1] = false;        ba[2] = true;    \endcode    For technical reasons, it is more efficient to use testBit() and    setBit() to access bits in the array than operator[](). For    example:    \code        QBitArray ba(3);        ba.setBit(0, true);        ba.setBit(1, false);        ba.setBit(2, true);    \endcode    QBitArray supports \c{&} (\link operator&() AND\endlink), \c{|}    (\link operator|() OR\endlink), \c{^} (\link operator^()    XOR\endlink), \c{~} (\link operator~() NOT\endlink), as well as    \c{&=}, \c{|=}, and \c{^=}. These operators work in the same way    as the built-in C++ bitwise operators of the same name. For    example:    \code        QBitArray x(5);        x.setBit(3, true);        // x: [ 0, 0, 0, 1, 0 ]        QBitArray y(5);        y.setBit(4, true);        // y: [ 0, 0, 0, 0, 1 ]        x |= y;        // x: [ 0, 0, 0, 1, 1 ]    \endcode    For historical reasons, QBitArray distinguishes between a null    bit array and an empty bit array. A \e null bit array is a bit    array that is initialized using QBitArray's default constructor.    An \e empty bit array is any bit array with size 0. A null bit    array is always empty, but an empty bit array isn't necessarily    null:    \code        QBitArray().isNull();           // returns true        QBitArray().isEmpty();          // returns true        QBitArray(0).isNull();          // returns false        QBitArray(0).isEmpty();         // returns true        QBitArray(3).isNull();          // returns false        QBitArray(3).isEmpty();         // returns false    \endcode    All functions except isNull() treat null bit arrays the same as    empty bit arrays; for example, QBitArray() compares equal to    QBitArray(0). We recommend that you always use isEmpty() and    avoid isNull().    \sa QByteArray, QVector*//*! \fn QBitArray::QBitArray()    Constructs an empty bit array.    \sa isEmpty()*//*!    Constructs a bit array containing \a size bits. The bits are    initialized with \a value, which defaults to false (0).*/QBitArray::QBitArray(int size, bool value){    if (!size) {        d.resize(0);        return;    }    d.resize(1 + (size+7)/8);    uchar* c = reinterpret_cast<uchar*>(d.data());    memset(c, value ? 0xff : 0, d.size());    *c = d.size()*8 - size;    if (value && size && size % 8)        *(c+1+size/8) &= (1 << (size%8)) - 1;}/*! \fn int QBitArray::size() const    Returns the number of bits stored in the bit array.    \sa resize()*//*! \fn int QBitArray::count() const    Same as size().*//*!    If \a on is true, this function returns the number of    1-bits stored in the bit array; otherwise the number    of 0-bits is returned.*/int QBitArray::count(bool on) const{    int numBits = 0;    int len = size();#if 0    for (int i = 0; i < len; ++i)        numBits += testBit(i);#else    // See http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel    const quint8 *bits = reinterpret_cast<const quint8 *>(d.data()) + 1;    while (len >= 32) {        quint32 v = quint32(bits[0]) | (quint32(bits[1]) << 8) | (quint32(bits[2]) << 16) | (quint32(bits[3]) << 24);        quint32 c = ((v & 0xfff) * Q_UINT64_C(0x1001001001001) & Q_UINT64_C(0x84210842108421)) % 0x1f;        c += (((v & 0xfff000) >> 12) * Q_UINT64_C(0x1001001001001) & Q_UINT64_C(0x84210842108421)) % 0x1f;        c += ((v >> 24) * Q_UINT64_C(0x1001001001001) & Q_UINT64_C(0x84210842108421)) % 0x1f;        len -= 32;        bits += 4;        numBits += int(c);    }    while (len >= 24) {        quint32 v = quint32(bits[0]) | (quint32(bits[1]) << 8) | (quint32(bits[2]) << 16);        quint32 c =  ((v & 0xfff) * Q_UINT64_C(0x1001001001001) & Q_UINT64_C(0x84210842108421)) % 0x1f;        c += (((v & 0xfff000) >> 12) * Q_UINT64_C(0x1001001001001) & Q_UINT64_C(0x84210842108421)) % 0x1f;            len -= 24;        bits += 3;        numBits += int(c);    }    while (len >= 0) {        if (bits[len / 8] & (1 << ((len - 1) & 7)))            ++numBits;        --len;    }#endif    return on ? numBits : size() - numBits;}/*!    Resizes the bit array to \a size bits.    If \a size is greater than the current size, the bit array is    extended to make it \a size bits with the extra bits added to the    end. The new bits are initialized to false (0).    If \a size is less than the current size, bits are removed from    the end.    \sa size()*/void QBitArray::resize(int size){    if (!size) {        d.resize(0);    } else {        int s = d.size();        d.resize(1 + (size+7)/8);        uchar* c = reinterpret_cast<uchar*>(d.data());        if (size > (s << 3))            memset(c + s, 0, d.size() - s);        *c = d.size()*8 - size;    }}/*! \fn bool QBitArray::isEmpty() const    Returns true if this bit array has size 0; otherwise returns    false.    \sa size()*//*! \fn bool QBitArray::isNull() const    Returns true if this bit array is null; otherwise returns false.    Example:    \code        QBitArray().isNull();           // returns true        QBitArray(0).isNull();          // returns false        QBitArray(3).isNull();          // returns false    \endcode    Qt makes a distinction between null bit arrays and empty bit    arrays for historical reasons. For most applications, what    matters is whether or not a bit array contains any data,    and this can be determined using isEmpty().    \sa isEmpty()*//*! \fn bool QBitArray::fill(bool value, int size = -1)    Sets every bit in the bit array to \a value, returning true if successful;    otherwise returns false. If \a size is different from -1 (the default),    the bit array is resized to \a size beforehand.    Example:    \code        QBitArray ba(8);        ba.fill(true);        // ba: [ 1, 1, 1, 1, 1, 1, 1, 1 ]        ba.fill(false, 2);        // ba: [ 0, 0 ]    \endcode    \sa resize()*//*!    \overload    Sets bits at index positions \a begin up to and excluding \a end    to \a value.    \a begin and \a end must be a valid index position in the bit    array (i.e., 0 <= \a begin <= size() and 0 <= \a end <= size()).*/void QBitArray::fill(bool value, int begin, int end){    while (begin < end && begin & 0x7)        setBit(begin++, value);    int len = end - begin;    if (len <= 0)        return;    int s = len & ~0x7;    uchar *c = reinterpret_cast<uchar*>(d.data());    memset(c + (begin >> 3) + 1, value ? 0xff : 0, s >> 3);    begin += s;    while (begin < end)        setBit(begin++, value);}/*! \fn bool QBitArray::isDetached() const    \internal*//*! \fn void QBitArray::detach()    \internal*//*! \fn void QBitArray::clear()    Clears the contents of the bit array and makes it empty.    \sa resize(), isEmpty()*//*! \fn void QBitArray::truncate(int pos)    Truncates the bit array at index position \a pos.    If \a pos is beyond the end of the array, nothing happens.    \sa resize()*//*! \fn bool QBitArray::toggleBit(int i)    Inverts the value of the bit at index position \a i, returning the    previous value of that bit as either true (if it was set) or false (if    it was unset).    If the previous value was 0, the new value will be 1. If the    previous value was 1, the new value will be 0.    \a i must be a valid index position in the bit array (i.e., 0 <=    \a i < size()).    \sa setBit(), clearBit()*//*! \fn bool QBitArray::testBit(int i) const    Returns true if the bit at index position \a i is 1; otherwise    returns false.    \a i must be a valid index position in the bit array (i.e., 0 <=    \a i < size()).    \sa setBit(), clearBit()*//*! \fn bool QBitArray::setBit(int i)    Sets the bit at index position \a i to 1.    \a i must be a valid index position in the bit array (i.e., 0 <=    \a i < size()).    \sa clearBit(), toggleBit()*//*! \fn void QBitArray::setBit(int i, bool value)    \overload    Sets the bit at index position \a i to \a value.*//*! \fn void QBitArray::clearBit(int i)    Sets the bit at index position \a i to 0.    \a i must be a valid index position in the bit array (i.e., 0 <=    \a i < size()).    \sa setBit(), toggleBit()*//*! \fn bool QBitArray::at(int i) const    Returns the value of the bit at index position \a i.    \a i must be a valid index position in the bit array (i.e., 0 <=    \a i < size()).    \sa operator[]()*//*! \fn QBitRef QBitArray::operator[](int i)    Returns the bit at index position \a i as a modifiable reference.    \a i must be a valid index position in the bit array (i.e., 0 <=    \a i < size()).

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
caoporn国产一区二区| 久久天天做天天爱综合色| 欧美成人一区二区三区| 中文字幕日韩av资源站| 国产一区二区三区| 欧美人成免费网站| 亚洲精品成a人| 国产精品一区久久久久| 91精品国产综合久久久久久| 日韩美女啊v在线免费观看| 经典三级视频一区| 欧美精品在线观看一区二区| 一色屋精品亚洲香蕉网站| 国产综合色产在线精品| 日韩一区二区三区视频| 亚洲电影激情视频网站| 在线观看日产精品| 最新久久zyz资源站| 国产91露脸合集magnet| 久久欧美中文字幕| 精品一区二区三区久久| 欧美一卡2卡3卡4卡| 亚洲成人av福利| 在线精品视频免费观看| 亚洲欧美日韩系列| 91网站视频在线观看| 国产精品你懂的在线欣赏| 韩国在线一区二区| www激情久久| 麻豆91免费观看| 欧美一级二级在线观看| 日本午夜精品一区二区三区电影| 欧美三级三级三级| 午夜精品在线看| 91精品国产综合久久久久久漫画| 日本女优在线视频一区二区| 337p亚洲精品色噜噜狠狠| 亚洲午夜在线电影| 9191久久久久久久久久久| 视频在线观看国产精品| 欧美一区二区精品在线| 蜜桃一区二区三区四区| 亚洲精品一区二区三区在线观看| 国产在线精品视频| 国产精品久久久久影院色老大 | 国产三级一区二区| 丰满白嫩尤物一区二区| 中文字幕亚洲一区二区av在线| 91在线你懂得| 亚洲mv在线观看| 久久综合九色综合97婷婷| 国产成人亚洲精品狼色在线| 亚洲丝袜精品丝袜在线| 欧美电影在哪看比较好| 国产一区二区三区蝌蚪| 亚洲天天做日日做天天谢日日欢 | 国产成人综合精品三级| 中文字幕日本乱码精品影院| 欧美亚洲一区二区三区四区| 久久99精品国产91久久来源| 中文字幕精品三区| 欧美理论片在线| 成人黄色大片在线观看| 亚洲高清免费视频| 久久亚洲一级片| 欧美视频在线不卡| 国产一区二区伦理片| 亚洲人妖av一区二区| 日韩三级伦理片妻子的秘密按摩| 成人手机在线视频| 日本免费在线视频不卡一不卡二| 国产精品乱码久久久久久| 欧美日韩国产片| 国产成人在线观看| 天天色天天爱天天射综合| 国产精品久久777777| 欧美大片日本大片免费观看| av午夜一区麻豆| 韩国v欧美v日本v亚洲v| 一区二区三区中文字幕精品精品 | 亚洲成人动漫在线免费观看| 久久精品人人爽人人爽| 欧美亚洲综合久久| 成人高清免费观看| 国产一区二区主播在线| 一区二区不卡在线播放| 中文字幕av资源一区| 日韩情涩欧美日韩视频| 欧美色综合影院| av电影在线不卡| 国产乱码一区二区三区| 蜜桃视频一区二区三区在线观看| 亚洲色图.com| 中文字幕乱码日本亚洲一区二区| 欧美tickling网站挠脚心| 在线观看国产精品网站| caoporm超碰国产精品| 精品一区二区在线看| 日日嗨av一区二区三区四区| 亚洲免费三区一区二区| 国产精品美女一区二区| 国产欧美一区二区精品秋霞影院| 日韩一区二区免费视频| 欧美日韩精品是欧美日韩精品| 色综合天天天天做夜夜夜夜做| 成人动漫中文字幕| 粉嫩嫩av羞羞动漫久久久 | 中文字幕亚洲欧美在线不卡| 国产日韩精品一区| 国产天堂亚洲国产碰碰| 国产精品天天看| 国产精品天干天干在线综合| 亚洲国产精品ⅴa在线观看| 中文字幕欧美三区| 成人免费视频在线观看| 最新高清无码专区| 亚洲愉拍自拍另类高清精品| 亚洲午夜av在线| 五月激情综合婷婷| 六月婷婷色综合| 国产成人综合视频| 色综合网站在线| 欧美区在线观看| 久久一二三国产| 国产精品二三区| 樱花影视一区二区| 日日嗨av一区二区三区四区| 久久精品99久久久| 国产91精品免费| 在线欧美一区二区| 欧美一级片在线| 国产亚洲精品福利| 自拍偷在线精品自拍偷无码专区 | 欧美日韩亚洲综合在线| 日韩一级片网址| 中文字幕精品在线不卡| 亚洲韩国一区二区三区| 久久国产剧场电影| 91网站最新网址| 日韩精品中文字幕一区| 日本一区二区三区高清不卡| 亚洲欧美偷拍三级| 日日噜噜夜夜狠狠视频欧美人| 国产乱码精品一区二区三区忘忧草 | 亚洲午夜久久久久久久久电影网 | 欧美sm极限捆绑bd| 亚洲欧洲精品一区二区精品久久久| 亚洲免费观看高清在线观看| 日本不卡中文字幕| www.欧美色图| 日韩久久久精品| 亚洲激情五月婷婷| 韩国欧美国产一区| 91福利在线观看| 26uuu久久天堂性欧美| 亚洲精品欧美在线| 国产精品白丝av| 欧美精品丝袜中出| 一区在线观看免费| 韩国三级在线一区| 欧美日韩一本到| 最新不卡av在线| 国产精品香蕉一区二区三区| 欧美私人免费视频| 中文字幕二三区不卡| 久久精品国产澳门| 精品视频在线看| 国产精品成人一区二区三区夜夜夜| 日韩福利电影在线| 色嗨嗨av一区二区三区| 国产女主播视频一区二区| 日本成人在线网站| 欧美午夜寂寞影院| 亚洲人成网站色在线观看| 国产精品原创巨作av| 日韩午夜激情电影| 日韩高清欧美激情| 欧美久久久久久久久中文字幕| 亚洲人成伊人成综合网小说| 成人午夜视频福利| 久久精品亚洲精品国产欧美| 蜜桃av噜噜一区| 欧美理论片在线| 午夜精品久久久久久久久久久| 91麻豆蜜桃一区二区三区| 中文字幕欧美激情一区| 粉嫩aⅴ一区二区三区四区| 精品人在线二区三区| 免费看日韩精品| 欧美久久免费观看| 石原莉奈在线亚洲三区| 欧美精品乱码久久久久久按摩| 亚洲一本大道在线| 欧美日韩国产一级二级| 亚洲成人午夜电影| 91精品国模一区二区三区| 免费视频一区二区| 亚洲精品一区二区三区影院| 国产在线精品不卡| 国产精品麻豆网站|