Files
ppsspp/Common/File/DirListing.h

43 lines
934 B
C
Raw Permalink Normal View History

2012-03-24 23:39:19 +01:00
#pragma once
#include <string>
#include <vector>
#include <cstdio>
2023-03-06 14:37:11 +01:00
#include <cstdint>
2014-04-08 15:26:47 +02:00
#include "Common/File/Path.h"
namespace File {
struct FileInfo {
2012-10-31 13:23:16 +01:00
std::string name;
Path fullName;
bool exists = false;
bool isDirectory = false;
bool isWritable = false;
uint64_t size = 0;
2012-11-01 09:45:27 +01:00
2021-07-18 16:00:07 +02:00
uint64_t atime = 0;
uint64_t mtime = 0;
uint64_t ctime = 0;
uint32_t access = 0; // st_mode & 0x1ff
bool operator <(const FileInfo &other) const;
};
bool GetFileInfo(const Path &path, FileInfo *fileInfo);
enum {
GETFILES_GETHIDDEN = 1,
GETFILES_GET_NAVIGATION_ENTRIES = 2, // If you don't set this, "." and ".." will be skipped.
};
bool GetFilesInDir(const Path &directory, std::vector<FileInfo> *files, const char *filter = nullptr, int flags = 0);
std::vector<File::FileInfo> ApplyFilter(std::vector<File::FileInfo> files, const char *filter);
#ifdef _WIN32
std::vector<std::string> GetWindowsDrives();
#endif
} // namespace File