Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/Common/File/DirListing.h
5676 views
1
#pragma once
2
3
#include <string>
4
#include <string_view>
5
#include <vector>
6
#include <cstdio>
7
#include <cstdint>
8
9
#include "Common/File/Path.h"
10
11
namespace File {
12
13
struct FileInfo {
14
std::string name;
15
Path fullName;
16
bool exists = false;
17
bool isDirectory = false;
18
bool isWritable = false;
19
uint64_t size = 0;
20
21
22
uint64_t atime = 0;
23
uint64_t mtime = 0;
24
uint64_t ctime = 0;
25
uint32_t access = 0; // st_mode & 0x1ff
26
27
bool operator <(const FileInfo &other) const;
28
};
29
30
bool GetFileInfo(const Path &path, FileInfo *fileInfo);
31
32
enum {
33
GETFILES_GETHIDDEN = 1,
34
GETFILES_GET_NAVIGATION_ENTRIES = 2, // If you don't set this, "." and ".." will be skipped.
35
};
36
37
// Note: extensionFilter is ignored for directories, so you can recurse.
38
bool GetFilesInDir(const Path &directory, std::vector<FileInfo> *files, const char *extensionFilter = nullptr, int flags = 0, std::string_view prefix = std::string_view());
39
std::vector<File::FileInfo> ApplyFilter(std::vector<File::FileInfo> files, const char *extensionFilter, std::string_view prefix);
40
41
#ifdef _WIN32
42
std::vector<std::string> GetWindowsDrives();
43
#endif
44
45
} // namespace File
46
47