本文整理汇总了C++中ProString::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ ProString::clear方法的具体用法?C++ ProString::clear怎么用?C++ ProString::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProString
的用法示例。
在下文中一共展示了ProString::clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: f
bool
UnixMakefileGenerator::findLibraries()
{
ProString libArg = project->first("QMAKE_L_FLAG");
if (libArg == "-L")
libArg.clear();
QList<QMakeLocalFileName> libdirs;
int libidx = 0;
foreach (const ProString &dlib, project->values("QMAKE_DEFAULT_LIBDIRS"))
libdirs.append(QMakeLocalFileName(dlib.toQString()));
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 (ProStringList::Iterator it = l.begin(); it != l.end(); ) {
QString stub, dir, extn, opt = (*it).trimmed().toQString();
if(opt.startsWith("-")) {
if(opt.startsWith("-L")) {
QString lib = opt.mid(2);
QMakeLocalFileName f(lib);
int idx = libdirs.indexOf(f);
if (idx >= 0 && idx < libidx) {
it = l.erase(it);
continue;
}
libdirs.insert(libidx++, f);
if (!libArg.isEmpty())
*it = libArg + lib;
} else if(opt.startsWith("-l")) {
if (project->isActiveConfig("rvct_linker") || project->isActiveConfig("armcc_linker")) {
(*it) = "lib" + opt.mid(2) + ".so";
} else if (project->isActiveConfig("ti_linker")) {
(*it) = opt.mid(2);
} else {
stub = opt.mid(2);
}
} else if (target_mode == TARG_MAC_MODE && opt.startsWith("-framework")) {
if (opt.length() == 10)
++it;
// Skip
}
} else {
extn = dir = "";
stub = opt;
int slsh = opt.lastIndexOf(Option::dir_sep);
if(slsh != -1) {
dir = opt.left(slsh);
stub = opt.mid(slsh+1);
}
QRegExp stub_reg("^.*lib(" + stub + "[^./=]*)\\.(.*)$");
if(stub_reg.exactMatch(stub)) {
stub = stub_reg.cap(1);
extn = stub_reg.cap(2);
}
}
if(!stub.isEmpty()) {
stub += project->first(ProKey("QMAKE_" + stub.toUpper() + "_SUFFIX")).toQString();
bool found = false;
ProStringList extens;
if(!extn.isNull())
extens << extn;
else
extens << project->values("QMAKE_EXTENSION_SHLIB").first() << "a";
for (ProStringList::Iterator extit = extens.begin(); extit != extens.end(); ++extit) {
if(dir.isNull()) {
for(QList<QMakeLocalFileName>::Iterator dep_it = libdirs.begin(); dep_it != libdirs.end(); ++dep_it) {
QString pathToLib = ((*dep_it).local() + Option::dir_sep
+ project->values("QMAKE_PREFIX_SHLIB").first()
+ stub + "." + (*extit));
if(exists(pathToLib)) {
(*it) = "-l" + stub;
found = true;
break;
}
}
} else {
QString lib = dir + project->values("QMAKE_PREFIX_SHLIB").first() + stub + "." + (*extit);
if (exists(lib)) {
(*it) = lib;
found = true;
break;
}
}
}
if(!found && project->isActiveConfig("compile_libtool")) {
for(int dep_i = 0; dep_i < libdirs.size(); ++dep_i) {
if(exists(libdirs[dep_i].local() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + stub + Option::libtool_ext)) {
(*it) = libdirs[dep_i].real() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + stub + Option::libtool_ext;
found = true;
break;
}
}
}
}
++it;
}
}
return false;
}