2023-08-19 16:11:38 +00:00
|
|
|
#pragma once
|
|
|
|
// Directory searching routines
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
|
2023-08-23 18:36:19 +00:00
|
|
|
namespace FileSys {
|
|
|
|
|
2023-08-19 16:11:38 +00:00
|
|
|
struct FileListEntry
|
|
|
|
{
|
|
|
|
std::string FileName; // file name only
|
|
|
|
std::string FilePath; // full path to file
|
|
|
|
std::string FilePathRel; // path relative to the scanned directory.
|
|
|
|
size_t Length = 0;
|
|
|
|
bool isDirectory = false;
|
|
|
|
bool isReadonly = false;
|
|
|
|
bool isHidden = false;
|
|
|
|
bool isSystem = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
using FileList = std::vector<FileListEntry>;
|
|
|
|
|
|
|
|
struct FCompressedBuffer;
|
|
|
|
bool ScanDirectory(std::vector<FileListEntry>& list, const char* dirpath, const char* match, bool nosubdir = false, bool readhidden = false);
|
|
|
|
bool WriteZip(const char* filename, const FCompressedBuffer* content, size_t contentcount);
|
2023-08-20 00:15:57 +00:00
|
|
|
bool FS_DirEntryExists(const char* pathname, bool* isdir);
|
2023-08-19 16:11:38 +00:00
|
|
|
|
|
|
|
inline void FixPathSeparator(char* path)
|
|
|
|
{
|
|
|
|
while (*path)
|
|
|
|
{
|
|
|
|
if (*path == '\\')
|
|
|
|
*path = '/';
|
|
|
|
path++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-23 18:36:19 +00:00
|
|
|
}
|