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

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

?? qresource.cpp

?? QT 開發環境里面一個很重要的文件
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
/******************************************************************************** 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 "qresource.h"#include "qresource_p.h"#include "qset.h"#include "qhash.h"#include "qmutex.h"#include "qdebug.h"#include "qlocale.h"#include "qglobal.h"#include "qvector.h"#include "qdatetime.h"#include "qbytearray.h"#include "qstringlist.h"#include <qshareddata.h>#include <qplatformdefs.h>#include "private/qabstractfileengine_p.h"//resource glueclass QResourceRoot{    enum Flags    {        Compressed = 0x01,        Directory = 0x02    };    const uchar *tree, *names, *payloads;    inline int findOffset(int node) const { return node * 14; } //sizeof each tree element    int hash(int node) const;    QString name(int node) const;    short flags(int node) const;public:    mutable QAtomic ref;    inline QResourceRoot(): tree(0), names(0), payloads(0) {}    inline QResourceRoot(const uchar *t, const uchar *n, const uchar *d) { setSource(t, n, d); }    virtual ~QResourceRoot() { }    int findNode(const QString &path, const QLocale &locale=QLocale()) const;    inline bool isContainer(int node) const { return flags(node) & Directory; }    inline bool isCompressed(int node) const { return flags(node) & Compressed; }    const uchar *data(int node, qint64 *size) const;    QStringList children(int node) const;    virtual QString mappingRoot() const { return QString(); }    bool mappingRootSubdir(const QString &path, QString *match=0) const;    inline bool operator==(const QResourceRoot &other) const    { return tree == other.tree && names == other.names && payloads == other.payloads; }    inline bool operator!=(const QResourceRoot &other) const    { return !operator==(other); }    virtual bool isDynamicRoot() const { return false; }protected:    inline void setSource(const uchar *t, const uchar *n, const uchar *d) {        tree = t;        names = n;        payloads = d;    }};Q_DECLARE_TYPEINFO(QResourceRoot, Q_MOVABLE_TYPE);Q_GLOBAL_STATIC_WITH_ARGS(QMutex, resourceMutex, (QMutex::Recursive))typedef QList<QResourceRoot*> ResourceList;Q_GLOBAL_STATIC(ResourceList, resourceList)Q_GLOBAL_STATIC(QStringList, resourceSearchPaths)/*!    \class QResource    \brief The QResource class provides an interface for reading directly from resources.    \ingroup io    \mainclass    \reentrant    \since 4.2    QResource is an object that represents a set of data (and possibly    children) relating to a single resource entity. QResource gives direct    access to the bytes in their raw format. In this way direct access    allows reading data without buffer copying or indirection. Indirection    is often useful when interacting with the resource entity as if it is a    file, this can be achieved with QFile. The data and children behind a    QResource are normally compiled into an application/library, but it is    also possible to load a resource at runtime. When loaded at run time    the resource file will be loaded as one big set of data and then given    out in pieces via references into the resource tree.    A QResource can either be loaded with an absolute path, either treated    as a file system rooted with a \c{/} character, or in resource notation    rooted with a \c{:} character. A relative resource can also be opened    which will be found through the searchPaths().    A QResource that is representing a file will have data backing it, this    data can possibly be compressed, in which case qUncompress() must be    used to access the real data; this happens implicitly when accessed    through a QFile. A QResource that is representing a directory will have    only children and no data.    \section1 Dynamic Resource Loading    A resource can be left out of an application's binary and loaded when    it is needed at run-time by using the registerResource() function. The    resource file passed into registerResource() must be a binary resource    as created by rcc. Further information about binary resources can be    found in {The Qt Resource System} documentation.    This can often be useful when loading a large set of application icons    that may change based on a setting, or that can be edited by a user and    later recreated. The resource is immediately loaded into memory, either    as a result of a single file read operation, or as a memory mapped file.    This approach can prove to be a significant performance gain as only a    single file will be loaded, and pieces of data will be given out via the    path requested in setFileName().    The unregisterResource() function removes a reference to a particular    file. If there are QResources that currently reference resources related    to the unregistered file, they will continue to be valid but the resource    file itself will be removed from the resource roots, and thus no further    QResource can be created pointing into this resource data. The resource    itself will be unmapped from memory when the last QResource points into it.    \sa {The Qt Resource System}, QFile, QDir, QFileInfo*/class QResourcePrivate {public:    inline QResourcePrivate(QResource *_q) : q_ptr(_q) { clear(); }    inline ~QResourcePrivate() { clear(); }    void ensureInitialized() const;    void ensureChildren() const;    bool load(const QString &file);    void clear();    QLocale locale;    QString fileName, absoluteFilePath;    QList<QResourceRoot*> related;    uint container : 1;    mutable uint compressed : 1;    mutable qint64 size;    mutable const uchar *data;    mutable QStringList children;    QResource *q_ptr;    Q_DECLARE_PUBLIC(QResource)};voidQResourcePrivate::clear(){    absoluteFilePath.clear();    compressed = 0;    data = 0;    size = 0;    children.clear();    container = 0;    for(int i = 0; i < related.size(); ++i) {        QResourceRoot *root = related.at(i);        if(!root->ref.deref())            delete root;    }    related.clear();}boolQResourcePrivate::load(const QString &file){    related.clear();    QMutexLocker lock(resourceMutex());    const ResourceList *list = resourceList();    for(int i = 0; i < list->size(); ++i) {        QResourceRoot *res = list->at(i);        const int node = res->findNode(file);        if(node != -1) {            if(related.isEmpty()) {                container = res->isContainer(node);                if(!container) {                    data = res->data(node, &size);                    compressed = res->isCompressed(node);                } else {                    data = 0;                    size = 0;                    compressed = 0;                }            } else if(res->isContainer(node) != container) {                qWarning("QResourceInfo: Resource [%s] has both data and children!", file.toLatin1().constData());            }            res->ref.ref();            related.append(res);        } else if(res->mappingRootSubdir(file)) {            container = true;            data = 0;            size = 0;            compressed = 0;            res->ref.ref();            related.append(res);        }    }    return !related.isEmpty();}voidQResourcePrivate::ensureInitialized() const{    if(!related.isEmpty())        return;    QResourcePrivate *that = const_cast<QResourcePrivate *>(this);    if(fileName == QLatin1String(":"))        that->fileName += QLatin1Char('/');    that->absoluteFilePath = fileName;    if(!that->absoluteFilePath.startsWith(QLatin1Char(':')))        that->absoluteFilePath.prepend(QLatin1Char(':'));    QString path = fileName;    if(path.startsWith(QLatin1Char(':')))        path = path.mid(1);    bool found = false;    if(path.startsWith(QLatin1Char('/'))) {        found = that->load(path);    } else {        QMutexLocker lock(resourceMutex());        QStringList searchPaths = *resourceSearchPaths();        searchPaths << QLatin1String("");        for(int i = 0; i < searchPaths.size(); ++i) {            const QString searchPath(searchPaths.at(i) + QLatin1Char('/') + path);            if(that->load(searchPath)) {                found = true;                that->absoluteFilePath = QLatin1Char(':') + searchPath;                break;            }        }    }}voidQResourcePrivate::ensureChildren() const{    ensureInitialized();    if(!children.isEmpty() || !container || related.isEmpty())        return;    QString path = absoluteFilePath, k;    if(path.startsWith(QLatin1Char(':')))        path = path.mid(1);    QSet<QString> kids;    for(int i = 0; i < related.size(); ++i) {        QResourceRoot *res = related.at(i);        if(res->mappingRootSubdir(path, &k) && !k.isEmpty()) {            if(!kids.contains(k)) {                children += k;                kids.insert(k);            }        } else {            const int node = res->findNode(path);            if(node != -1) {                QStringList related_children = res->children(node);                for(int kid = 0; kid < related_children.size(); ++kid) {                    k = related_children.at(kid);                    if(!kids.contains(k)) {                        children += k;                        kids.insert(k);                    }                }            }        }    }}/*!    Constructs a QResource pointing to \a file. \a locale is used to    load a specific localization of a resource data.    \sa QFileInfo, searchPaths(), setFileName(), setLocale()*/QResource::QResource(const QString &file, const QLocale &locale) : d_ptr(new QResourcePrivate(this)){    Q_D(QResource);    d->fileName = file;    d->locale = locale;}/*!    Releases the resources of the QResource object.*/QResource::~QResource(){    delete d_ptr;}/*!    Sets a QResource to only load the localization of resource to for \a    locale. If a resource for the specific locale is not found then the    C locale is used.    \sa setFileName()*/void QResource::setLocale(const QLocale &locale){    Q_D(QResource);    d->clear();    d->locale = locale;}/*!    Returns the locale used to locate the data for the QResource.*/QLocale QResource::locale() const{    Q_D(const QResource);    return d->locale;}/*!    Sets a QResource to point to \a file. \a file can either be absolute,    in which case it is opened directly, if relative then the file will be    tried to be found in searchPaths().    \sa absoluteFilePath()*/void QResource::setFileName(const QString &file){    Q_D(QResource);    d->clear();    d->fileName = file;}/*!    Returns the full path to the file that this QResource represents as it    was passed.    \sa absoluteFilePath()*/QString QResource::fileName() const{    Q_D(const QResource);    d->ensureInitialized();    return d->fileName;}/*!    Returns the real path that this QResource represents, if the resource    was found via the searchPaths() it will be indicated in the path.    \sa fileName()*/QString QResource::absoluteFilePath() const{    Q_D(const QResource);    d->ensureInitialized();    return d->absoluteFilePath;}/*!    Returns true if the resource really exists in the resource heirarchy,    false otherwise.*/bool QResource::isValid() const{    Q_D(const QResource);    d->ensureInitialized();    return !d->related.isEmpty();}/*!    \fn bool QResource::isFile() const    Returns true if the resource represents a file and thus has data    backing it, false if it represents a directory.    \sa isDir()*//*!    Returns true if the resource represents a file and the data backing it    is in a compressed format, false otherwise.    \sa data(), isFile()*/bool QResource::isCompressed() const{    Q_D(const QResource);    d->ensureInitialized();    return d->compressed;}/*!    Returns the size of the data backing the resource.    \sa data(), isFile()*/qint64 QResource::size() const{    Q_D(const QResource);    d->ensureInitialized();    return d->size;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品三级视频| 亚洲精品中文字幕在线观看| 欧美精品一卡二卡| 欧美性欧美巨大黑白大战| 91视频.com| 色狠狠av一区二区三区| 色999日韩国产欧美一区二区| 成人性生交大片免费看视频在线 | jlzzjlzz国产精品久久| 国产精品正在播放| 成人毛片老司机大片| 成人美女在线视频| 色综合久久中文综合久久牛| 97精品久久久午夜一区二区三区 | 午夜视频在线观看一区二区| 亚洲观看高清完整版在线观看 | 国产一区二区0| 国产资源在线一区| 成熟亚洲日本毛茸茸凸凹| 成人手机在线视频| 成人禁用看黄a在线| 97久久超碰国产精品| 欧美日韩dvd在线观看| 欧美v国产在线一区二区三区| 久久久久青草大香线综合精品| 久久久久国产精品麻豆| 亚洲少妇中出一区| 免费高清在线一区| 99久久精品国产毛片| 538prom精品视频线放| 日韩欧美卡一卡二| 中文字幕在线不卡视频| 天堂资源在线中文精品| 日韩专区在线视频| 国产乱色国产精品免费视频| 99久久精品国产一区| 91精品国产高清一区二区三区 | 日韩一区二区免费电影| 久久久久九九视频| 亚洲综合在线电影| 国产伦精品一区二区三区免费| av高清不卡在线| 欧美电影免费观看高清完整版 | 精彩视频一区二区三区| 99精品视频在线免费观看| 欧美美女喷水视频| 国产精品久久久久久久岛一牛影视 | 欧美综合在线视频| 欧美精品一区在线观看| 亚洲国产日产av| 国产成人精品免费看| 色av一区二区| 国产精品入口麻豆原神| 日本色综合中文字幕| 97se亚洲国产综合自在线| 精品国产乱码久久久久久老虎 | 欧美成人三级电影在线| 一区二区高清视频在线观看| 国产成人久久精品77777最新版本| 欧美午夜一区二区三区| 最新热久久免费视频| 国产一区日韩二区欧美三区| 5566中文字幕一区二区电影| 亚洲福中文字幕伊人影院| 国产91综合网| 国产亚洲欧洲997久久综合| 美女视频一区在线观看| 欧美视频一区二区三区四区 | 国产精品久久久久久久第一福利 | 久久99精品网久久| 欧美日本视频在线| 一区二区三区日韩欧美精品 | 欧美一级精品大片| 亚洲一区二区三区四区在线免费观看| 懂色av中文字幕一区二区三区| 欧美精品一区二区三区在线 | 中文字幕精品三区| 精品午夜久久福利影院| 久久综合给合久久狠狠狠97色69| 日韩av网站在线观看| 日韩一二三区视频| 日本欧美韩国一区三区| 欧美顶级少妇做爰| 免费欧美日韩国产三级电影| 欧美一级生活片| 精品一区二区在线看| 精品成人免费观看| 国产成人av一区二区三区在线观看| 久久日韩精品一区二区五区| 成人一区二区三区| 自拍偷自拍亚洲精品播放| 欧美亚洲国产一区二区三区va| 亚洲线精品一区二区三区| 欧美乱妇23p| 激情另类小说区图片区视频区| 久久综合精品国产一区二区三区| 国产成人午夜精品5599| 亚洲精品高清视频在线观看| 欧美精选午夜久久久乱码6080| 蜜臀av国产精品久久久久| 精品少妇一区二区三区在线播放| 国产麻豆9l精品三级站| 亚洲欧美色图小说| 欧美日韩国产bt| 精品亚洲免费视频| 中文字幕佐山爱一区二区免费| 欧美在线综合视频| 另类小说图片综合网| 国产精品网曝门| 欧美日韩一级二级| 国产精品一区二区视频| 一区二区三区在线视频播放| 日韩欧美三级在线| 色丁香久综合在线久综合在线观看| 午夜精品久久久久久久久| www成人在线观看| 欧美日韩在线观看一区二区 | 欧美怡红院视频| 久久精品免费观看| 亚洲色图在线看| 日韩视频一区二区| 在线免费观看一区| 国产成人精品免费一区二区| 日韩国产一区二| 亚洲乱码国产乱码精品精可以看| 日韩视频免费观看高清完整版在线观看 | 大胆亚洲人体视频| 日本美女一区二区三区| 亚洲女人的天堂| 久久久噜噜噜久久人人看 | 69堂国产成人免费视频| 97精品视频在线观看自产线路二 | 国产精品免费视频一区| 欧美一区二区观看视频| 91久久精品一区二区| 成人国产在线观看| 国产精品一区二区在线观看不卡| 美洲天堂一区二卡三卡四卡视频| 亚洲图片一区二区| 亚洲欧美日韩在线不卡| 国产精品污www在线观看| 精品国产乱码久久久久久影片| 欧美精品日韩精品| 欧美日韩一二三区| 欧美在线小视频| 在线免费观看日本欧美| 一本色道久久综合亚洲精品按摩| 懂色av中文字幕一区二区三区| 国产真实精品久久二三区| 美女一区二区在线观看| 老汉av免费一区二区三区| 青青草97国产精品免费观看无弹窗版 | 亚洲国产成人私人影院tom| 久久色在线观看| 久久久美女艺术照精彩视频福利播放| 日韩欧美电影一二三| 日韩午夜激情免费电影| 欧美精品一区二区久久婷婷| 欧美日韩亚洲综合一区二区三区| 91黄色免费网站| 欧美日韩一区二区三区四区| 欧美日韩美少妇| 6080国产精品一区二区| 日韩欧美不卡在线观看视频| 欧美xxxxx牲另类人与| 久久噜噜亚洲综合| 亚洲国产高清在线| 玉米视频成人免费看| 天堂久久一区二区三区| 国内精品在线播放| 国产91色综合久久免费分享| 99视频国产精品| 欧美日韩精品一区二区三区四区 | 日韩一区欧美小说| 亚洲乱码国产乱码精品精98午夜| 亚洲一二三四区| 偷拍一区二区三区| 日本免费新一区视频| 国产精品一区二区黑丝| jlzzjlzz亚洲女人18| 欧美日韩日日摸| 久久一留热品黄| 日韩美女精品在线| 亚洲va欧美va天堂v国产综合| 日本不卡的三区四区五区| 国产成人综合网站| 在线视频你懂得一区| 精品久久人人做人人爰| 中文字幕中文字幕在线一区| 一区二区三区中文免费| 久久99国产精品免费网站| 不卡av电影在线播放| 欧美一级精品在线| 中文字幕在线播放不卡一区| 亚洲国产视频网站| 丁香亚洲综合激情啪啪综合| 欧美日韩激情一区二区三区| 久久久国产一区二区三区四区小说| 亚洲欧美另类小说| 丁香婷婷综合五月|