Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/Common/File/VFS/DirectoryReader.h
5667 views
1
#pragma once
2
3
#include "Common/File/VFS/VFS.h"
4
#include "Common/File/FileUtil.h"
5
#include "Common/File/Path.h"
6
7
class DirectoryReader : public VFSBackend {
8
public:
9
explicit DirectoryReader(const Path &path);
10
// use delete[] on the returned value.
11
uint8_t *ReadFile(std::string_view path, size_t *size) override;
12
13
VFSFileReference *GetFile(std::string_view path) override;
14
bool GetFileInfo(VFSFileReference *vfsReference, File::FileInfo *fileInfo) override;
15
void ReleaseFile(VFSFileReference *vfsReference) override;
16
17
VFSOpenFile *OpenFileForRead(VFSFileReference *vfsReference, size_t *size) override;
18
void Rewind(VFSOpenFile *vfsOpenFile) override;
19
size_t Read(VFSOpenFile *vfsOpenFile, void *buffer, size_t length) override;
20
void CloseFile(VFSOpenFile *vfsOpenFile) override;
21
22
bool GetFileListing(std::string_view path, std::vector<File::FileInfo> *listing, const char *filter) override;
23
bool GetFileInfo(std::string_view path, File::FileInfo *info) override;
24
bool Exists(std::string_view path) override;
25
std::string toString() const override {
26
return path_.ToString();
27
}
28
29
private:
30
Path path_;
31
};
32
33