File indexing completed on 2024-05-19 05:00:40

0001 /*
0002  * SPDX-FileCopyrightText: 2014 Daniel Vrátil <dvratil@redhat.com>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-or-later
0005  *
0006  */
0007 
0008 #ifndef PATHCACHE_H
0009 #define PATHCACHE_H
0010 
0011 #include <QHash>
0012 #include <QStringList>
0013 
0014 class PathCache
0015 {
0016 public:
0017     PathCache();
0018     ~PathCache();
0019 
0020     void insertPath(const QString &path, const QString &fileId);
0021 
0022     QString idForPath(const QString &path) const;
0023     QStringList descendants(const QString &path) const;
0024     void removePath(const QString &path);
0025 
0026     void dump();
0027 
0028 private:
0029     QHash<QString /* path */, QString> m_pathIdMap;
0030 };
0031 
0032 #endif // PATHCACHE_H