当前位置: 首页>>代码示例>>C++>>正文


C++ ProStringList::contains方法代码示例

本文整理汇总了C++中ProStringList::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ ProStringList::contains方法的具体用法?C++ ProStringList::contains怎么用?C++ ProStringList::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProStringList的用法示例。


在下文中一共展示了ProStringList::contains方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: l

void
Win32MakefileGenerator::processPrlFiles()
{
    const QString libArg = project->first("QMAKE_L_FLAG").toQString();
    QList<QMakeLocalFileName> libdirs;
    static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
    for (int i = 0; lflags[i]; i++) {
        ProStringList &l = project->values(lflags[i]);
        for (int lit = 0; lit < l.size(); ++lit) {
            QString opt = l.at(lit).trimmed().toQString();
            if((opt[0] == '\'' || opt[0] == '"') && opt[(int)opt.length()-1] == opt[0])
                opt = opt.mid(1, opt.length()-2);
            if (opt.startsWith(libArg)) {
                QMakeLocalFileName l(opt.mid(libArg.length()));
                if (!libdirs.contains(l))
                    libdirs.append(l);
            } else if (!opt.startsWith("/")) {
                if (!processPrlFile(opt) && (QDir::isRelativePath(opt) || opt.startsWith("-l"))) {
                    QString tmp;
                    if (opt.startsWith("-l"))
                        tmp = opt.mid(2);
                    else
                        tmp = opt;
                    for(QList<QMakeLocalFileName>::Iterator it = libdirs.begin(); it != libdirs.end(); ++it) {
                        QString prl = (*it).local() + Option::dir_sep + tmp;
                        if (processPrlFile(prl))
                            break;
                    }
                }
            }
            ProStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS");
            for (int prl = 0; prl < prl_libs.size(); ++prl) {
                ProString arg = prl_libs.at(prl);
                if (arg.startsWith(libArg))
                    arg = arg.left(libArg.length()) + escapeFilePath(arg.mid(libArg.length()).toQString());
                else if (!arg.startsWith('/'))
                    arg = escapeFilePath(arg.toQString());
                l.insert(lit + prl + 1, arg);
            }
            prl_libs.clear();
        }

        // Merge them into a logical order
        if (!project->isActiveConfig("no_smart_library_merge") && !project->isActiveConfig("no_lflags_merge")) {
            ProStringList lflags;
            for (int lit = 0; lit < l.size(); ++lit) {
                ProString opt = l.at(lit).trimmed();
                if (opt.startsWith(libArg)) {
                    if (!lflags.contains(opt))
                        lflags.append(opt);
                } else {
                    // Make sure we keep the dependency-order of libraries
                    lflags.removeAll(opt);
                    lflags.append(opt);
                }
            }
            l = lflags;
        }
    }
}
开发者ID:xjohncz,项目名称:qt5,代码行数:60,代码来源:winmakefile.cpp

示例2: writeStubMakefile

bool
NmakeMakefileGenerator::writeMakefile(QTextStream &t)
{
    writeHeader(t);
    if (writeDummyMakefile(t))
        return true;

    if(project->first("TEMPLATE") == "app" ||
       project->first("TEMPLATE") == "lib" ||
       project->first("TEMPLATE") == "aux") {
#if 0
        if(Option::mkfile::do_stub_makefile)
            return MakefileGenerator::writeStubMakefile(t);
#endif
        if (!project->isHostBuild()) {
            const ProValueMap &variables = project->variables();
            if (project->isActiveConfig("wince")) {
                CeSdkHandler sdkhandler;
                sdkhandler.parse();
                const QString sdkName = variables["CE_SDK"].join(' ')
                                        + " (" + variables["CE_ARCH"].join(' ') + ")";
                const QList<CeSdkInfo> sdkList = sdkhandler.listAll();
                CeSdkInfo sdk;
                foreach (const CeSdkInfo &info, sdkList) {
                    if (info.name().compare(sdkName, Qt::CaseInsensitive ) == 0) {
                        sdk = info;
                        break;
                    }
                }
                if (sdk.isValid()) {
                    t << "\nINCLUDE = " << sdk.includePath();
                    t << "\nLIB = " << sdk.libPath();
                    t << "\nPATH = " << sdk.binPath() << "\n";
                } else {
                    QStringList sdkStringList;
                    foreach (const CeSdkInfo &info, sdkList)
                        sdkStringList << info.name();

                    fprintf(stderr, "Failed to find Windows CE SDK matching %s, found: %s\n"
                                    "SDK needs to be specified in mkspec (using: %s/qmake.conf)\n"
                                    "SDK name needs to match the following format: CE_SDK (CE_ARCH)\n",
                            qPrintable(sdkName), qPrintable(sdkStringList.join(", ")),
                            qPrintable(variables["QMAKESPEC"].first().toQString()));
                    return false;
                }
            } else if (project->isActiveConfig(QStringLiteral("winrt"))) {
                QString arch = project->first("VCPROJ_ARCH").toQString().toLower();
                QString compiler;
                QString compilerArch;
                if (arch == QStringLiteral("arm")) {
                    compiler = QStringLiteral("x86_arm");
                    compilerArch = QStringLiteral("arm");
                } else if (arch == QStringLiteral("x64")) {
                    const ProStringList hostArch = project->values("QMAKE_TARGET.arch");
                    if (hostArch.contains("x86_64"))
                        compiler = QStringLiteral("amd64");
                    else
                        compiler = QStringLiteral("x86_amd64");
                    compilerArch = QStringLiteral("amd64");
                } else {
                    arch = QStringLiteral("x86");
                }

                const QString msvcVer = project->first("MSVC_VER").toQString();
                if (msvcVer.isEmpty()) {
                    fprintf(stderr, "Mkspec does not specify MSVC_VER. Cannot continue.\n");
                    return false;
                }
                const QString winsdkVer = project->first("WINSDK_VER").toQString();
                if (winsdkVer.isEmpty()) {
                    fprintf(stderr, "Mkspec does not specify WINSDK_VER. Cannot continue.\n");
                    return false;
                }
                const QString targetVer = project->first("WINTARGET_VER").toQString();
                if (targetVer.isEmpty()) {
                    fprintf(stderr, "Mkspec does not specify WINTARGET_VER. Cannot continue.\n");
                    return false;
                }

                const bool isPhone = project->isActiveConfig(QStringLiteral("winphone"));
#ifdef Q_OS_WIN
                QString regKeyPrefix;
#if !defined(Q_OS_WIN64) && _WIN32_WINNT >= 0x0501
                BOOL isWow64;
                IsWow64Process(GetCurrentProcess(), &isWow64);
                if (!isWow64)
                    regKeyPrefix = QStringLiteral("Software\\");
                else
#endif
                    regKeyPrefix = QStringLiteral("Software\\Wow6432Node\\");

                QString regKey = regKeyPrefix + QStringLiteral("Microsoft\\VisualStudio\\") + msvcVer + ("\\Setup\\VC\\ProductDir");
                const QString vcInstallDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey);
                if (vcInstallDir.isEmpty()) {
                    fprintf(stderr, "Failed to find the Visual Studio installation directory.\n");
                    return false;
                }

                regKey = regKeyPrefix
                        + (isPhone ? QStringLiteral("Microsoft\\Microsoft SDKs\\WindowsPhone\\v")
//.........这里部分代码省略.........
开发者ID:0x163mL,项目名称:phantomjs,代码行数:101,代码来源:msvc_nmake.cpp


注:本文中的ProStringList::contains方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。