aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Filesystem
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Filesystem')
-rw-r--r--src/libjin/Filesystem/je_asset_database.cpp7
-rw-r--r--src/libjin/Filesystem/je_asset_database.h21
-rw-r--r--src/libjin/Filesystem/je_buffer.h7
3 files changed, 25 insertions, 10 deletions
diff --git a/src/libjin/Filesystem/je_asset_database.cpp b/src/libjin/Filesystem/je_asset_database.cpp
index 738b18f..ac547f0 100644
--- a/src/libjin/Filesystem/je_asset_database.cpp
+++ b/src/libjin/Filesystem/je_asset_database.cpp
@@ -46,7 +46,7 @@ namespace JinEngine
Buffer* read(const char* path)
{
-
+ return nullptr;
}
void* AssetDatabase::read(const char* path, unsigned int* len)
@@ -74,6 +74,11 @@ namespace JinEngine
return smtexists(mSmt, path) == 0;
}
+ std::vector<std::string> AssetDatabase::getFiles(const char* path, bool recursive)
+ {
+
+ }
+
} // namespace Filesystem
} // namespace JinEngine
diff --git a/src/libjin/Filesystem/je_asset_database.h b/src/libjin/Filesystem/je_asset_database.h
index 3d47f15..8c30fc1 100644
--- a/src/libjin/Filesystem/je_asset_database.h
+++ b/src/libjin/Filesystem/je_asset_database.h
@@ -4,6 +4,8 @@
#include "../core/je_configuration.h"
#if defined(jin_filesystem)
+#include <vector>
+
#include "../3rdparty/smount/smount.h"
#include "je_buffer.h"
@@ -32,6 +34,13 @@ namespace JinEngine
AssetDatabase();
///
+ /// Set asset root folder.
+ ///
+ /// @param root Root folder of assets.
+ ///
+ void mount(const char* root);
+
+ ///
/// Check if the path is directory.
///
/// @param path Path under asset folder.
@@ -73,11 +82,13 @@ namespace JinEngine
void* read(const char* path, unsigned int* length);
///
- /// Set asset root folder.
- ///
- /// @param root Root folder of assets.
+ /// Get files under given directory.
+ ///
+ /// @param path Path of directory.
+ /// @param recursive Recursivily search folder.
+ /// @return File list under given directory.
///
- void mount(const char* root);
+ std::vector<std::string> getFiles(const char* path, bool recursive);
///
/// Get full path of asset.
@@ -89,7 +100,9 @@ namespace JinEngine
private:
static AssetDatabase* mAssetDatabase;
+#if jin_filesystem == jin_filesystem_smount
smtShared* mSmt;
+#endif
};
diff --git a/src/libjin/Filesystem/je_buffer.h b/src/libjin/Filesystem/je_buffer.h
index a2f4deb..0726e1d 100644
--- a/src/libjin/Filesystem/je_buffer.h
+++ b/src/libjin/Filesystem/je_buffer.h
@@ -7,6 +7,7 @@
#include <string.h>
#include <stdlib.h>
+#include "../common/je_temporary.h"
#include "../common/je_types.h"
namespace JinEngine
@@ -17,7 +18,7 @@ namespace JinEngine
///
/// Data buffer allocated on heap.
///
- class Buffer
+ class Buffer : public Temporary
{
public:
///
@@ -158,10 +159,6 @@ namespace JinEngine
byte* mData;
size_t mSize;
- // diasble new and delete
- void* operator new(size_t t);
- void operator delete(void*);
-
};
} // namespace Filesystem