ppsspp/Common/File/DirListing.h
Henrik Rydgård 87a25fd230 Start experimenting with DocumentsContract (the thing DocumentFile wraps)
wip

Some progress towards making the file browser work with DOCUMENT_TREE

More directory browsing progress

More Scoped Storage hackery. Can now browse to a folder and use PPSSPP's game browser to load ISOs from it.

Remove the defunct fdopendir approach. Buildfixes.
2021-06-07 00:24:51 +02:00

44 lines
889 B
C++

#pragma once
#include <string>
#include <vector>
#include <cstdio>
#include <inttypes.h>
#include "Common/File/Path.h"
namespace File {
struct FileInfo {
std::string name;
Path fullName;
bool exists = false;
bool isDirectory = false;
bool isWritable = false;
uint64_t size = 0;
uint64_t atime;
uint64_t mtime;
uint64_t ctime;
uint32_t access; // st_mode & 0x1ff
bool operator <(const FileInfo &other) const;
};
bool GetFileInfo(const Path &path, FileInfo *fileInfo);
enum {
GETFILES_GETHIDDEN = 1,
GETFILES_URIENCODE_ANDROID = 2, // Android shenanigans
};
size_t GetFilesInDir(const Path &directory, std::vector<FileInfo> *files, const char *filter = nullptr, int flags = 0);
int64_t GetDirectoryRecursiveSize(const Path &path, const char *filter = nullptr, int flags = 0);
#ifdef _WIN32
std::vector<std::string> GetWindowsDrives();
#endif
} // namespace File