本文整理汇总了C++中qstringlist::const_iterator::endsWith方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::endsWith方法的具体用法?C++ const_iterator::endsWith怎么用?C++ const_iterator::endsWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qstringlist::const_iterator
的用法示例。
在下文中一共展示了const_iterator::endsWith方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findFile
QFileInfo CppToolsPlugin::findFile(const QDir &dir, const QString &name,
const ProjectExplorer::Project *project) const
{
if (debug)
qDebug() << Q_FUNC_INFO << dir << name;
QFileInfo fileInSameDir(dir, name);
if (project && !fileInSameDir.isFile()) {
QString pattern = QString(1, QLatin1Char('/'));
pattern += name;
const QStringList projectFiles = project->files(ProjectExplorer::Project::AllFiles);
const QStringList::const_iterator pcend = projectFiles.constEnd();
for (QStringList::const_iterator it = projectFiles.constBegin(); it != pcend; ++it)
if (it->endsWith(pattern))
return QFileInfo(*it);
return QFileInfo();
}
return fileInSameDir;
}
示例2: findFilesInProject
static QStringList findFilesInProject(const QString &name,
const ProjectExplorer::Project *project)
{
if (debug)
qDebug() << Q_FUNC_INFO << name << project;
if (!project)
return QStringList();
QString pattern = QString(1, QLatin1Char('/'));
pattern += name;
const QStringList projectFiles = project->files(ProjectExplorer::Project::AllFiles);
const QStringList::const_iterator pcend = projectFiles.constEnd();
QStringList candidateList;
for (QStringList::const_iterator it = projectFiles.constBegin(); it != pcend; ++it) {
if (it->endsWith(pattern))
candidateList.append(*it);
}
return candidateList;
}
示例3: findFilesInProject
static QStringList findFilesInProject(const QString &name,
const ProjectExplorer::Project *project)
{
if (debug)
qDebug() << Q_FUNC_INFO << name << project;
if (!project)
return QStringList();
QString pattern = QString(1, QLatin1Char('/'));
pattern += name;
const QStringList projectFiles
= Utils::transform(project->files(ProjectExplorer::Project::AllFiles), &Utils::FileName::toString);
const QStringList::const_iterator pcend = projectFiles.constEnd();
QStringList candidateList;
for (QStringList::const_iterator it = projectFiles.constBegin(); it != pcend; ++it) {
if (it->endsWith(pattern, Utils::HostOsInfo::fileNameCaseSensitivity()))
candidateList.append(*it);
}
return candidateList;
}