Exemple #1
0
    void remove(File const &file)
    {
        DENG2_GUARD_WRITE(this);

        if(index.empty())
        {
            return;
        }

        // Look up the ones that might be this file.
        IndexRange range = index.equal_range(indexedName(file));

        for(Index::iterator i = range.first; i != range.second; ++i)
        {
            if(i->second == &file)
            {
                // This is the one to deindex.
                index.erase(i);
                break;
            }
        }
    }
Exemple #2
0
    void findPartialPath(String const &path, FoundFiles &found) const
    {
        String baseName = path.fileName().lower();
        String dir      = path.fileNamePath().lower();

        if(!dir.empty() && !dir.beginsWith("/"))
        {
            // Always begin with a slash. We don't want to match partial folder names.
            dir = "/" + dir;
        }

        DENG2_GUARD_READ(this);

        ConstIndexRange range = index.equal_range(baseName);
        for(Index::const_iterator i = range.first; i != range.second; ++i)
        {
            File *file = i->second;
            if(file->path().fileNamePath().endsWith(dir, Qt::CaseInsensitive))
            {
                found.push_back(file);
            }
        }
    }