aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Filesystem/je_asset_database.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Filesystem/je_asset_database.h')
-rw-r--r--src/libjin/Filesystem/je_asset_database.h71
1 files changed, 65 insertions, 6 deletions
diff --git a/src/libjin/Filesystem/je_asset_database.h b/src/libjin/Filesystem/je_asset_database.h
index b8f96f6..81cce64 100644
--- a/src/libjin/Filesystem/je_asset_database.h
+++ b/src/libjin/Filesystem/je_asset_database.h
@@ -8,25 +8,84 @@ namespace JinEngine
{
namespace Filesystem
{
- /* Դ */
- class AssetDatabase
+
+ ///
+ /// Assets managment.
+ ///
+ class AssetDatabase
{
public:
+ ///
+ /// Get asset database singleton.
+ ///
+ /// @param Singleton of asset database.
+ ///
static AssetDatabase* get();
+ ///
+ /// Asset database constructor.
+ ///
AssetDatabase();
+ ///
+ /// Check if the path is directory.
+ ///
+ /// @param path Path under asset folder.
+ /// @return True if the given path is directory, otherwise return false.
+ ///
bool isDir(const char* path);
+
+ ///
+ /// Check if the path is file.
+ ///
+ /// @param path Path under asset folder.
+ /// @return True if the given path is file, otherwise return false.
+ ///
bool isFile(const char* path);
+
+ ///
+ /// Check if the path exists.
+ /// @param path Given path.
+ /// @return True if path exists, otherwise return false.
+ ///
bool exists(const char* path);
- int read(const char* path, Buffer* buffer);
- void* read(const char* path, unsigned int* len);
+
+ ///
+ /// Read file into a buffer.
+ ///
+ /// @param path Path of file.
+ /// @param buffer Buffer to fill.
+ /// @return True if read sucessful, otherwise return false.
+ ///
+ bool read(const char* path, Buffer& buffer);
+
+ ///
+ /// Read file and return data content.
+ ///
+ /// @param path Path of file.
+ /// @param length Length of data.
+ /// @return Data if read sucessful, otherwise return null.
+ ///
+ void* read(const char* path, unsigned int* length);
+
+ ///
+ /// Set asset root folder.
+ ///
+ /// @param root Root folder of assets.
+ ///
void mount(const char* root);
+
+ ///
+ /// Get full path of asset.
+ ///
+ /// @param path Path of asset.
+ /// @return Full path of asset.
+ ///
const char* getFull(const char* path);
private:
- static AssetDatabase* fs;
- smtShared* S;
+ static AssetDatabase* mAssetDatabase;
+ smtShared* mSmt;
};