Esempio n. 1
0
/*!
    \internal
*/
QDirIteratorPrivate::QDirIteratorPrivate(const QFileSystemEntry &entry, const QStringList &nameFilters,
                                         QDir::Filters filters, QDirIterator::IteratorFlags flags, bool resolveEngine)
    : dirEntry(entry)
      , nameFilters(nameFilters.contains(QLatin1String("*")) ? QStringList() : nameFilters)
      , filters(QDir::NoFilter == filters ? QDir::AllEntries : filters)
      , iteratorFlags(flags)
{
#ifndef QT_NO_REGEXP
    nameRegExps.reserve(nameFilters.size());
    for (int i = 0; i < nameFilters.size(); ++i)
        nameRegExps.append(
            QRegExp(nameFilters.at(i),
                    (filters & QDir::CaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive,
                    QRegExp::Wildcard));
#endif
    QFileSystemMetaData metaData;
    if (resolveEngine)
        engine.reset(QFileSystemEngine::resolveEntryAndCreateLegacyEngine(dirEntry, metaData));
    QFileInfo fileInfo(new QFileInfoPrivate(dirEntry, metaData));

    // Populate fields for hasNext() and next()
    pushDirectory(fileInfo);
    advance();
}
Esempio n. 2
0
Path& Path::makeDirectory()
{
    pushDirectory(m_sName);
    m_sName.clear();
    return *this;
}