Database implementation mostly complete.
This commit is contained in:
9
src/io/BaseDirectory.cpp
Normal file
9
src/io/BaseDirectory.cpp
Normal 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
28
src/io/Directory_LNX.cpp
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user