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

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

?? qbytearray.cpp

?? QT 開發環境里面一個很重要的文件
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
/******************************************************************************** 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 "qbytearray.h"#include "qbytearraymatcher.h"#include "qtools_p.h"#include "qstring.h"#include "qlist.h"#include "qlocale.h"#include "qlocale_p.h"#include "qunicodetables_p.h"#ifndef QT_NO_DATASTREAM#include <qdatastream.h>#endif#ifndef QT_NO_COMPRESS#include <zlib.h>#endif#include <ctype.h>#include <limits.h>#include <string.h>int qAllocMore(int alloc, int extra){    const int page = 1<<12;    int nalloc;    alloc += extra;    if (alloc < 1<<6) {        nalloc = (1<<3) + ((alloc >>3) << 3);    } else  {        nalloc = (alloc < page) ? 1<<3 : page;        while (nalloc < alloc)            nalloc *= 2;    }    return nalloc - extra;}/*****************************************************************************  Safe and portable C string functions; extensions to standard string.h *****************************************************************************//*! \relates QByteArray    Returns a duplicate string.    Allocates space for a copy of \a src, copies it, and returns a    pointer to the copy. If \a src is 0, it immediately returns 0.    Ownership is passed to the caller, so the returned string must be    deleted using \c delete[].*/char *qstrdup(const char *src){    if (!src)        return 0;    char *dst = new char[strlen(src) + 1];    return qstrcpy(dst, src);}/*! \relates QByteArray    Copies all the characters up to and including the '\\0' from \a    src into \a dst and returns a pointer to \a dst. If \a src is 0,    it immediately returns 0.    This function assumes that \a dst is large enough to hold the    contents of \a src.    \sa qstrncpy()*/char *qstrcpy(char *dst, const char *src){    if (!src)        return 0;#if defined(_MSC_VER) && _MSC_VER >= 1400    int len = qstrlen(src);	// This is actually not secure!!! It will be fixed	// properly in a later release!    if (len >= 0 && strcpy_s(dst, len+1, src) == 0)	    return dst;    return 0;#else    return strcpy(dst, src);#endif}/*! \relates QByteArray    A safe \c strncpy() function.    Copies at most \a len bytes from \a src (stopping at \a len or the    terminating '\\0' whichever comes first) into \a dst and returns a    pointer to \a dst. Guarantees that \a dst is '\\0'-terminated. If    \a src or \a dst is 0, returns 0 immediately.    This function assumes that \a dst is at least \a len characters    long.    \sa qstrcpy()*/char *qstrncpy(char *dst, const char *src, uint len){    if (!src || !dst)        return 0;#if defined(_MSC_VER) && _MSC_VER >= 1400	strncpy_s(dst, len, src, len-1);#else    strncpy(dst, src, len);#endif    if (len > 0)        dst[len-1] = '\0';    return dst;}/*! \fn uint qstrlen(const char *str)    \relates QByteArray    A safe \c strlen() function.    Returns the number of characters that precede the terminating '\\0',    or 0 if \a str is 0.    \sa qstrnlen()*//*! \fn uint qstrnlen(const char *str, uint maxlen)    \relates QByteArray    \since 4.2    A safe \c strnlen() function.    Returns the number of characters that precede the terminating '\\0', but    at most \a maxlen. If \a str is 0, returns 0.    \sa qstrlen()*//*! \relates QByteArray    A safe \c strcmp() function.    Compares \a str1 and \a str2. Returns a negative value if \a str1    is less than \a str2, 0 if \a str1 is equal to \a str2 or a    positive value if \a str1 is greater than \a str2.    Special case 1: Returns 0 if \a str1 and \a str2 are both 0.    Special case 2: Returns a random non-zero value if \a str1 is 0    or \a str2 is 0 (but not both).    \sa qstrncmp(), qstricmp(), qstrnicmp(), {Note on 8-bit character comparisons}*/int qstrcmp(const char *str1, const char *str2){    return (str1 && str2) ? strcmp(str1, str2)        : (str1 ? 1 : (str2 ? -1 : 0));}/*! \fn int qstrncmp(const char *str1, const char *str2, uint len);    \relates QByteArray    A safe \c strncmp() function.    Compares at most \a len bytes of \a str1 and \a str2.    Returns a negative value if \a str1 is less than \a str2, 0 if \a    str1 is equal to \a str2 or a positive value if \a str1 is greater    than \a str2.    Special case 1: Returns 0 if \a str1 and \a str2 are both 0.    Special case 2: Returns a random non-zero value if \a str1 is 0    or \a str2 is 0 (but not both).    \sa qstrcmp(), qstricmp(), qstrnicmp(),        {Note on 8-bit character comparisons}*//*! \relates QByteArray    A safe \c stricmp() function.    Compares \a str1 and \a str2 ignoring the case of the    characters. The encoding of the strings is assumed to be Latin-1.    Returns a negative value if \a str1 is less than \a str2, 0 if \a    str1 is equal to \a str2 or a positive value if \a str1 is greater    than \a str2.    Special case 1: Returns 0 if \a str1 and \a str2 are both 0.    Special case 2: Returns a random non-zero value if \a str1 is 0    or \a str2 is 0 (but not both).    \sa qstrcmp(), qstrncmp(), qstrnicmp(),        {Note on 8-bit character comparisons}*/int qstricmp(const char *str1, const char *str2){    register const uchar *s1 = reinterpret_cast<const uchar *>(str1);    register const uchar *s2 = reinterpret_cast<const uchar *>(str2);    int res;    uchar c;    if (!s1 || !s2)        return s1 ? 1 : (s2 ? -1 : 0);    for (; !(res = (c = QUnicodeTables::lower(*s1)) - QUnicodeTables::lower(*s2)); s1++, s2++)        if (!c)                                // strings are equal            break;    return res;}/*! \relates QByteArray    A safe \c strnicmp() function.    Compares at most \a len bytes of \a str1 and \a str2 ignoring the    case of the characters. The encoding of the strings is assumed to    be Latin-1.    Returns a negative value if \a str1 is less than \a str2, 0 if \a str1    is equal to \a str2 or a positive value if \a str1 is greater than \a    str2.    Special case 1: Returns 0 if \a str1 and \a str2 are both 0.    Special case 2: Returns a random non-zero value if \a str1 is 0    or \a str2 is 0 (but not both).    \sa qstrcmp(), qstrncmp(), qstricmp(),        {Note on 8-bit character comparisons}*/int qstrnicmp(const char *str1, const char *str2, uint len){    register const uchar *s1 = reinterpret_cast<const uchar *>(str1);    register const uchar *s2 = reinterpret_cast<const uchar *>(str2);    int res;    uchar c;    if (!s1 || !s2)        return s1 ? 1 : (s2 ? -1 : 0);    for (; len--; s1++, s2++) {        if ((res = (c = QUnicodeTables::lower(*s1)) - QUnicodeTables::lower(*s2)))            return res;        if (!c)                                // strings are equal            break;    }    return 0;}// the CRC table below is created by the following piece of code#if 0static void createCRC16Table()                        // build CRC16 lookup table{    register unsigned int i;    register unsigned int j;    unsigned short crc_tbl[16];    unsigned int v0, v1, v2, v3;    for (i = 0; i < 16; i++) {        v0 = i & 1;        v1 = (i >> 1) & 1;        v2 = (i >> 2) & 1;        v3 = (i >> 3) & 1;        j = 0;#undef SET_BIT#define SET_BIT(x, b, v) (x) |= (v) << (b)        SET_BIT(j,  0, v0);        SET_BIT(j,  7, v0);        SET_BIT(j, 12, v0);        SET_BIT(j,  1, v1);        SET_BIT(j,  8, v1);        SET_BIT(j, 13, v1);        SET_BIT(j,  2, v2);        SET_BIT(j,  9, v2);        SET_BIT(j, 14, v2);        SET_BIT(j,  3, v3);        SET_BIT(j, 10, v3);        SET_BIT(j, 15, v3);        crc_tbl[i] = j;    }    printf("static const quint16 crc_tbl[16] = {\n");    for (int i = 0; i < 16; i +=4)        printf("    0x%04x, 0x%04x, 0x%04x, 0x%04x,\n", crc_tbl[i], crc_tbl[i+1], crc_tbl[i+2], crc_tbl[i+3]);    printf("};\n");}#endifstatic const quint16 crc_tbl[16] = {    0x0000, 0x1081, 0x2102, 0x3183,    0x4204, 0x5285, 0x6306, 0x7387,    0x8408, 0x9489, 0xa50a, 0xb58b,    0xc60c, 0xd68d, 0xe70e, 0xf78f};/*! \relates QByteArray    Returns the CRC-16 checksum of the first \a len bytes of \a data.    The checksum is independent of the byte order (endianness).*/quint16 qChecksum(const char *data, uint len){    register quint16 crc = 0xffff;    uchar c;    const uchar *p = reinterpret_cast<const uchar *>(data);    while (len--) {        c = *p++;        crc = ((crc >> 4) & 0x0fff) ^ crc_tbl[((crc ^ c) & 15)];        c >>= 4;        crc = ((crc >> 4) & 0x0fff) ^ crc_tbl[((crc ^ c) & 15)];    }    return ~crc & 0xffff;}/*! \fn QByteArray qCompress(const QByteArray& data, int compressionLevel)    \relates QByteArray    Compresses the \a data byte array and returns the compressed data    in a new byte array.    The \a compressionLevel parameter specifies how much compression    should be used. Valid values are between 0 and 9, with 9    corresponding to the greatest compression (i.e. smaller compressed    data) at the cost of using a slower algorithm. Smaller values (8,    7, ..., 1) provide successively less compression at slightly    faster speeds. The value 0 corresponds to no compression at all.    The default value is -1, which specifies zlib's default    compression.    \sa qUncompress()*//*! \relates QByteArray    \overload    Compresses the first \a nbytes of \a data and returns the    compressed data in a new byte array.*/#ifndef QT_NO_COMPRESSQByteArray qCompress(const uchar* data, int nbytes, int compressionLevel){    if (nbytes == 0) {        return QByteArray(4, '\0');    }    if (!data) {        qWarning("qCompress: Data is null");        return QByteArray();    }    if (compressionLevel < -1 || compressionLevel > 9)        compressionLevel = -1;    ulong len = nbytes + nbytes / 100 + 13;    QByteArray bazip;    int res;    do {        bazip.resize(len + 4);        res = ::compress2((uchar*)bazip.data()+4, &len, (uchar*)data, nbytes, compressionLevel);        switch (res) {        case Z_OK:            bazip.resize(len + 4);            bazip[0] = (nbytes & 0xff000000) >> 24;            bazip[1] = (nbytes & 0x00ff0000) >> 16;            bazip[2] = (nbytes & 0x0000ff00) >> 8;            bazip[3] = (nbytes & 0x000000ff);            break;        case Z_MEM_ERROR:            qWarning("qCompress: Z_MEM_ERROR: Not enough memory");            bazip.resize(0);            break;        case Z_BUF_ERROR:            len *= 2;            break;        }    } while (res == Z_BUF_ERROR);    return bazip;}#endif/*!    \fn QByteArray qUncompress(const QByteArray& data)    \relates QByteArray    Uncompresses the \a data byte array and returns a new byte array    with the uncompressed data.    Returns an empty QByteArray if the input data was corrupt.    This function will uncompress data compressed with qCompress()    from this and any earlier Qt version, back to Qt 3.1 when this    feature was added.    \bold{Note:} If you want to use this function to uncompress external    data compressed using zlib, you first need to prepend four bytes to the    byte array that contain the expected length of the uncompressed data    encoded in big-endian order (most significant byte first).    \sa qCompress()*//*! \relates QByteArray    \overload    Uncompresses the first \a nbytes of \a data and returns a new byte    array with the uncompressed data.*/#ifndef QT_NO_COMPRESSQByteArray qUncompress(const uchar* data, int nbytes){    if (!data) {        qWarning("qUncompress: Data is null");        return QByteArray();    }    if (nbytes <= 4) {        if (nbytes < 4 || (data[0]!=0 || data[1]!=0 || data[2]!=0 || data[3]!=0))            qWarning("qUncompress: Input data is corrupted");        return QByteArray();    }    ulong expectedSize = (data[0] << 24) | (data[1] << 16) |                       (data[2] <<  8) | (data[3]      );    ulong len = qMax(expectedSize, 1ul);    QByteArray baunzip;    int res;    do {        baunzip.resize(len);        res = ::uncompress((uchar*)baunzip.data(), &len,                            (uchar*)data+4, nbytes-4);        switch (res) {        case Z_OK:            if ((int)len != baunzip.size())                baunzip.resize(len);            break;        case Z_MEM_ERROR:            qWarning("qUncompress: Z_MEM_ERROR: Not enough memory");            break;        case Z_BUF_ERROR:            len *= 2;            break;        case Z_DATA_ERROR:            qWarning("qUncompress: Z_DATA_ERROR: Input data is corrupted");            break;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆精品国产传媒mv男同| 欧美日韩一二三区| 91精品国产91综合久久蜜臀| 欧美国产乱子伦 | 99精品欧美一区二区蜜桃免费| 色婷婷国产精品综合在线观看| 久久综合999| 奇米精品一区二区三区在线观看| 91成人在线精品| 国产精品理伦片| 国产一区二区三区在线观看精品 | 日韩精品一二三区| 99久久99久久综合| 亚洲国产精品成人综合色在线婷婷| 日韩精品视频网| 91麻豆精品国产91| 亚洲精品乱码久久久久久久久| 国产成人午夜高潮毛片| 日韩精品一区二区三区中文精品| 亚洲在线视频网站| 色国产综合视频| 亚洲欧美日本韩国| 91网站最新地址| 中文字幕亚洲不卡| 97久久超碰国产精品| 国产精品无圣光一区二区| 国产经典欧美精品| 日本一区免费视频| 成人中文字幕在线| 国产精品电影院| 成人av综合一区| 国产精品乱码久久久久久| 丁香天五香天堂综合| 亚洲国产精品精华液2区45| 国产精品一区二区不卡| 久久一日本道色综合| 国产美女视频一区| 日本一区二区综合亚洲| 不卡av在线免费观看| 亚洲男人的天堂在线aⅴ视频| 色综合久久99| 亚洲国产一区二区视频| 777午夜精品视频在线播放| 奇米影视一区二区三区| 精品欧美一区二区在线观看| 国产伦精品一区二区三区免费迷 | 欧美日韩情趣电影| 日本v片在线高清不卡在线观看| 91精品黄色片免费大全| 极品少妇一区二区三区精品视频 | 国产又黄又大久久| 中文字幕高清不卡| 91久久精品一区二区三| 久久精品国产亚洲a| 久久婷婷成人综合色| 99精品视频中文字幕| 天堂va蜜桃一区二区三区| 久久综合丝袜日本网| 99久久99久久精品免费观看| 午夜精品一区二区三区三上悠亚| 精品国产制服丝袜高跟| 97se亚洲国产综合在线| 日韩精品成人一区二区在线| 国产婷婷一区二区| 欧美日韩中文字幕一区二区| 国产一区二区导航在线播放| 亚洲精品久久久蜜桃| 精品久久久久久亚洲综合网| 成人18精品视频| 蜜臀av性久久久久蜜臀av麻豆| 国产日韩欧美麻豆| 欧美老女人在线| www.日韩精品| 欧美aaa在线| 亚洲免费看黄网站| 国产欧美一区二区精品秋霞影院| 欧美色区777第一页| 国产福利一区二区三区视频在线| 亚洲国产成人porn| 国产欧美日产一区| 日韩一级黄色片| 色婷婷久久久综合中文字幕| 久国产精品韩国三级视频| 亚洲精品中文在线影院| 国产日韩欧美激情| 日韩一区二区免费视频| 91久久精品网| 99热99精品| 国产白丝网站精品污在线入口| 日本特黄久久久高潮| 亚洲无人区一区| 中文字幕制服丝袜一区二区三区 | 成人福利视频在线| 久草在线在线精品观看| 日韩激情中文字幕| 一区二区三区四区在线免费观看 | 2020日本不卡一区二区视频| 欧美一区二区在线视频| 久久综合狠狠综合久久综合88 | 日本不卡视频在线| 亚洲激情六月丁香| **欧美大码日韩| 国产精品免费网站在线观看| 亚洲精品一区二区三区蜜桃下载| 日韩欧美一区二区视频| 欧美一区二区三区成人| 欧美日韩国产免费一区二区| 在线一区二区视频| 91国产精品成人| 欧美亚洲一区三区| 一本色道久久加勒比精品| 91美女片黄在线| 色菇凉天天综合网| 欧美日韩一区二区三区高清 | 99免费精品视频| 97精品国产露脸对白| 色哟哟一区二区在线观看 | 国产成人免费视频一区| 国产酒店精品激情| 成人av综合一区| 色欧美片视频在线观看在线视频| 成人av小说网| 色综合久久久网| 91福利视频网站| 欧美日韩你懂得| 日韩欧美高清dvd碟片| 欧美大白屁股肥臀xxxxxx| 日韩精品一区二区三区视频| 亚洲最大的成人av| 午夜精品一区在线观看| 久久精品国产一区二区三| 国产综合久久久久久鬼色| 国产精品538一区二区在线| 99国内精品久久| 欧美日韩三级在线| 欧美成va人片在线观看| 欧美经典一区二区| 一区二区在线观看视频在线观看| 亚洲1区2区3区4区| 国产一区二区主播在线| kk眼镜猥琐国模调教系列一区二区| 91农村精品一区二区在线| 欧美日韩国产经典色站一区二区三区 | 欧美激情在线一区二区三区| 中文字幕中文字幕中文字幕亚洲无线| 夜夜嗨av一区二区三区网页| 麻豆视频一区二区| 99视频精品在线| 日韩欧美在线网站| 国产精品久久久久久亚洲毛片 | 久久精品国产精品亚洲精品| 成人教育av在线| 欧美一区二区三区在线观看| 欧美国产精品久久| 亚洲国产成人av网| 国产成人精品免费| 欧美性淫爽ww久久久久无| 精品国产亚洲在线| 亚洲成人精品影院| 国产盗摄精品一区二区三区在线| 欧美中文字幕亚洲一区二区va在线| 日韩欧美成人一区| 亚洲精品免费电影| 国产伦精品一区二区三区视频青涩| 在线观看成人免费视频| 久久久久久久久久久99999| 亚洲电影一区二区| eeuss鲁一区二区三区| 欧美va在线播放| 亚洲成av人片观看| 92精品国产成人观看免费| 欧美大黄免费观看| 婷婷激情综合网| 色婷婷亚洲婷婷| 中文字幕亚洲不卡| 成人精品免费看| 久久久国产精品麻豆| 男女男精品网站| 欧美视频在线播放| 一区二区三区丝袜| 不卡电影一区二区三区| 日本一区二区三级电影在线观看 | 99re亚洲国产精品| 国产欧美1区2区3区| 精品一区二区三区视频在线观看| 欧美精品在线视频| 一区二区成人在线| 色欧美日韩亚洲| 亚洲精品成人少妇| 色老头久久综合| 亚洲裸体xxx| 不卡电影免费在线播放一区| 国产无一区二区| 国产精品18久久久久久久久久久久 | 国产精品色一区二区三区| 国产精品自拍三区| 26uuu色噜噜精品一区二区| 黄网站免费久久| 久久精品亚洲国产奇米99| 国产一区免费电影|