Database implementation mostly complete.

This commit is contained in:
2024-04-09 01:44:15 -07:00
parent beba947c69
commit d13fe81ac5
20 changed files with 768 additions and 106 deletions

9
src/io/BaseDirectory.cpp Normal file
View File

@@ -0,0 +1,9 @@
#include "ehs/io/BaseDirectory.h"
namespace ehs
{
Array<Str_8> BaseDirectory::GetAllFiles(const Str_8& dir)
{
return {};
}
}

28
src/io/Directory_LNX.cpp Normal file
View File

@@ -0,0 +1,28 @@
#include "ehs/io/Directory_LNX.h"
#include "ehs/Log.h"
#include <dirent.h>
namespace ehs
{
Array<Str_8> Directory::GetAllFiles(const Str_8& dir)
{
Array<Str_8> result;
DIR* hdl = opendir(dir);
if (!dir)
{
EHS_LOG_INT("Error", 0, "Failed to open directory, \"" + dir + "\".");
return result;
}
dirent* entry;
while ((entry = readdir(hdl)))
if (entry->d_type == DT_REG)
result.Push(entry->d_name);
closedir(hdl);
return result;
}
}