CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

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