Refactor the folder structure which only had 2 'real' modules, now it's more real, no need for splitting into folders beside the external one
This commit is contained in:
49
src/basic_os.h
Normal file
49
src/basic_os.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
struct FileIter {
|
||||
bool is_valid;
|
||||
bool is_directory;
|
||||
String absolute_path;
|
||||
String relative_path;
|
||||
String filename;
|
||||
|
||||
String path;
|
||||
Allocator allocator;
|
||||
union {
|
||||
struct Win32_FileIter *w32;
|
||||
void *dir;
|
||||
};
|
||||
};
|
||||
|
||||
String ReadFile(Allocator arena, String path);
|
||||
bool WriteFile(String path, String data);
|
||||
String GetAbsolutePath(Allocator arena, String relative);
|
||||
bool IsValid(const FileIter &it);
|
||||
void Advance(FileIter *it);
|
||||
FileIter IterateFiles(Allocator allocator, String path);
|
||||
void InitOS(void (*error_proc)(const char *, ...));
|
||||
|
||||
bool DeleteFile(String path);
|
||||
String GetExePath(Allocator allocator);
|
||||
String GetExeDir(Allocator allocator);
|
||||
bool FileExists(String path);
|
||||
bool IsDir(String path);
|
||||
bool IsFile(String path);
|
||||
String GetWorkingDir(Allocator arena);
|
||||
bool IsAbsolute(String path);
|
||||
int64_t GetFileModTime(String file);
|
||||
String WriteTempFile(Allocator allocator, String data);
|
||||
|
||||
|
||||
|
||||
|
||||
double GetTimeMicros(void);
|
||||
|
||||
enum MakeDirResult {
|
||||
MakeDirResult_Success,
|
||||
MakeDirResult_Exists,
|
||||
MakeDirResult_NotFound,
|
||||
MakeDirResult_ErrorOther,
|
||||
};
|
||||
|
||||
MakeDirResult MakeDir(String path);
|
||||
Reference in New Issue
Block a user