mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-20 11:47:45 +00:00
27 lines
No EOL
552 B
C++
27 lines
No EOL
552 B
C++
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <QHash>
|
|
#include <QMap>
|
|
#include <QMutex>
|
|
#include <QString>
|
|
#include <physis.hpp>
|
|
|
|
struct GameData;
|
|
|
|
class FileCache
|
|
{
|
|
public:
|
|
explicit FileCache(GameData &data);
|
|
|
|
bool fileExists(const QString &path);
|
|
physis_Buffer &lookupFile(const QString &path);
|
|
|
|
private:
|
|
QMap<QString, physis_Buffer> cachedBuffers;
|
|
QHash<QString, bool> cachedExist;
|
|
GameData &data;
|
|
QMutex bufferMutex, existMutex;
|
|
}; |