-
Notifications
You must be signed in to change notification settings - Fork 0
/
km_os.h
27 lines (18 loc) · 853 Bytes
/
km_os.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once
#include "km_array.h"
#include "km_string.h"
template <typename Allocator>
Array<uint8> LoadEntireFile(const_string filePath, Allocator* allocator);
template <typename Allocator>
void FreeFile(Array<uint8> file, Allocator* allocator);
bool WriteFile(const_string filePath, const Array<uint8>& data, bool append);
bool DeleteFile(const_string filePath, bool errorIfNotFound);
bool FileExists(const_string filePath);
bool FileChangedSinceLastCall(const_string filePath);
bool CreateDirRecursive(const_string dir);
// Traverses all files in the given directory. Returns an array with their names.
template <typename Allocator>
Array<string> ListDir(const_string dir, Allocator* allocator);
template <typename Allocator>
FixedArray<char, PATH_MAX_LENGTH> GetExecutablePath(Allocator* allocator);
bool RunCommand(const_string command);