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

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

?? qbitarray.cpp

?? QT 開發(fā)環(huán)境里面一個很重要的文件
?? 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一区二区三区免费野_久草精品视频
欧美在线一二三| 一区二区三区四区亚洲| 亚洲色图在线播放| 麻豆精品国产91久久久久久| 成人午夜免费av| 日韩精品一区二区三区三区免费| 亚洲精品视频一区| 国产成人av影院| 日韩视频免费观看高清完整版在线观看 | 国产a久久麻豆| 欧美一级生活片| 日本美女一区二区三区视频| 欧美综合一区二区| 亚洲欧美韩国综合色| 成人午夜免费视频| 久久品道一品道久久精品| 午夜精品福利久久久| 91黄色免费看| 亚洲制服欧美中文字幕中文字幕| 成人做爰69片免费看网站| 久久久久亚洲蜜桃| 国内偷窥港台综合视频在线播放| 欧美日韩成人一区| 午夜精品久久久久久久| 欧美色图第一页| 亚洲高清久久久| 欧美日韩久久久一区| 亚洲成人一二三| 欧美剧在线免费观看网站| 亚洲午夜精品网| 欧美写真视频网站| 亚洲成人免费视频| 欧美美女一区二区三区| 香蕉影视欧美成人| 337p亚洲精品色噜噜| 丝袜脚交一区二区| 日韩一区和二区| 久久精品国产一区二区三| 日韩亚洲欧美高清| 老汉av免费一区二区三区 | 色综合天天性综合| 亚洲免费伊人电影| 精品1区2区3区| 美女脱光内衣内裤视频久久影院| 欧美一级在线免费| 精品亚洲成a人| 亚洲精品精品亚洲| 欧美丰满高潮xxxx喷水动漫| 日韩电影在线观看网站| 精品不卡在线视频| 成人午夜电影久久影院| 亚洲精品视频免费观看| 制服丝袜亚洲色图| 国产成人丝袜美腿| 亚洲乱码中文字幕| 日韩一级大片在线| 成人美女在线观看| 视频一区视频二区中文字幕| 亚洲精品一区在线观看| 99久久国产综合精品女不卡| 亚洲一区二区精品视频| 亚洲精品在线一区二区| 不卡的av电影在线观看| 日韩成人一级大片| 国产精品久久久久久久久免费相片| 日本韩国精品在线| 国产美女一区二区三区| 一级精品视频在线观看宜春院 | 中文字幕亚洲精品在线观看| 在线亚洲人成电影网站色www| 日本亚洲一区二区| 亚洲视频 欧洲视频| 日韩精品一区二区三区中文精品| av资源网一区| 久久99九九99精品| 亚洲第一二三四区| 中文字幕va一区二区三区| 91精品久久久久久久91蜜桃| 国产成人免费xxxxxxxx| 亚洲国产精品久久一线不卡| 国产午夜精品理论片a级大结局| 欧美日韩一级片在线观看| 国产成a人无v码亚洲福利| 秋霞午夜av一区二区三区| 亚洲欧美偷拍卡通变态| 久久亚洲捆绑美女| 欧美一区二区三区成人| 91免费看片在线观看| 国产精品亚洲综合一区在线观看| 精品一区二区三区免费播放| 一区二区不卡在线播放| 久久久久9999亚洲精品| 日韩欧美另类在线| 欧美欧美午夜aⅴ在线观看| 色域天天综合网| 国产·精品毛片| 麻豆精品在线播放| 日韩成人免费在线| 日日欢夜夜爽一区| 一区二区三区在线观看动漫| 中文字幕在线观看不卡| 久久九九久久九九| 久久久久国产免费免费| 欧美一区二区三区免费在线看| 欧美性猛片aaaaaaa做受| 色综合色狠狠天天综合色| 99精品黄色片免费大全| 91同城在线观看| 91香蕉国产在线观看软件| aaa亚洲精品| 成人免费看黄yyy456| 国产福利精品导航| 成人一级片在线观看| 成人免费视频免费观看| 不卡影院免费观看| 91在线视频观看| 日本高清免费不卡视频| 欧美色老头old∨ideo| 欧美精品粉嫩高潮一区二区| 欧美精品第1页| 欧美精品一区二区三区视频| 亚洲精品在线免费播放| 香蕉乱码成人久久天堂爱免费| 亚洲精品第1页| 午夜精品视频在线观看| 秋霞国产午夜精品免费视频| 久久精品国产成人一区二区三区| 精品一二线国产| 国产成人精品免费一区二区| 91网站在线观看视频| 精品视频全国免费看| 欧美一区二区三区人| 国产午夜精品美女毛片视频| 国产精品久久精品日日| 亚洲国产日韩综合久久精品| 免费成人在线网站| 国产成a人无v码亚洲福利| 99在线精品免费| 欧美图片一区二区三区| 日韩视频一区二区三区| 国产精品福利在线播放| 亚洲一区二区欧美激情| 狠狠色丁香婷婷综合| 北岛玲一区二区三区四区| 99精品一区二区| 欧美一区欧美二区| 亚洲国产精华液网站w | 欧美日韩国产电影| 亚洲精品一区二区三区福利| 国产精品久久夜| 秋霞av亚洲一区二区三| a亚洲天堂av| 欧美第一区第二区| 亚洲激情五月婷婷| 精品亚洲aⅴ乱码一区二区三区| 91玉足脚交白嫩脚丫在线播放| 91精品国产综合久久精品| 国产精品免费视频一区| 美国精品在线观看| 91在线观看地址| 久久综合九色综合欧美就去吻| 亚洲精品视频在线观看免费| 国产乱人伦偷精品视频免下载| 欧美无砖专区一中文字| 国产视频不卡一区| 日韩黄色免费网站| 91黄视频在线观看| 中文字幕乱码一区二区免费| 日本亚洲电影天堂| 欧美自拍偷拍午夜视频| 国产精品国产三级国产普通话三级| 奇米亚洲午夜久久精品| 在线免费观看不卡av| 中文字幕中文乱码欧美一区二区| 日日摸夜夜添夜夜添国产精品| 色婷婷久久99综合精品jk白丝| 精品88久久久久88久久久| 日产国产高清一区二区三区| 91成人在线免费观看| 中文字幕一区在线观看视频| 国产成人精品一区二区三区四区 | 亚洲国产成人一区二区三区| 秋霞电影网一区二区| 欧美综合色免费| 亚洲综合av网| 欧美一级专区免费大片| 一区二区三区在线免费视频| 99re这里只有精品6| 国产精品视频免费| 成人中文字幕在线| 中文字幕+乱码+中文字幕一区| 韩国女主播成人在线| 欧美不卡一区二区| 日本中文在线一区| 欧美一区二区观看视频| 免费成人结看片| 久久综合九色综合97_久久久| 美女精品一区二区| 精品久久人人做人人爰| 久久99国产精品久久99果冻传媒|