mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Add utility function to snoop the file cache
This commit is contained in:
1 parent
9373791bc4
commit
8c8dd0f0d0
2 files changed
+8
No files matched your search
@@ -71,6 +71,13 @@ static std::shared_ptr<Request> CreateRequest(RequestMethod method, std::string_
|
||||
}
|
||||
}
|
||||
|
||||
// Compatible with StartDownload
|
||||
// Synchronous (no callback).
|
||||
bool RequestManager::ReadFileFromCache(std::string_view url, std::string *data) {
|
||||
Path cacheFile = UrlToCachePath(url);
|
||||
return File::ReadBinaryFileToString(cacheFile, data);
|
||||
}
|
||||
|
||||
std::shared_ptr<Request> RequestManager::StartDownload(std::string_view url, const Path &outfile, RequestFlags flags, const char *acceptMime, std::string_view name, std::function<void(Request &)> callback) {
|
||||
const bool enableCache = !cacheDir_.empty() && (flags & RequestFlags::Cached24H);
|
||||
|
||||
|
||||
@@ -132,6 +132,7 @@ public:
|
||||
}
|
||||
|
||||
Path UrlToCachePath(const std::string_view url);
|
||||
bool ReadFileFromCache(std::string_view url, std::string *data);
|
||||
|
||||
private:
|
||||
std::vector<std::shared_ptr<Request>> downloads_;
|
||||
|
||||
Reference in new issue
Block a user