aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Filesystem/je_asset_database.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-11-18 23:44:40 +0800
committerchai <chaifix@163.com>2018-11-18 23:44:40 +0800
commit8cb74178c2b8e5883a1181af687fa8cfc0c6e5da (patch)
treef56c536a029148df35bd4e82034a9b563a2381df /src/libjin/Filesystem/je_asset_database.cpp
parentf0f340dec7821cee103ab9267ef941a917ef4dc4 (diff)
*修改目录为小写
Diffstat (limited to 'src/libjin/Filesystem/je_asset_database.cpp')
-rw-r--r--src/libjin/Filesystem/je_asset_database.cpp85
1 files changed, 0 insertions, 85 deletions
diff --git a/src/libjin/Filesystem/je_asset_database.cpp b/src/libjin/Filesystem/je_asset_database.cpp
deleted file mode 100644
index a8524c5..0000000
--- a/src/libjin/Filesystem/je_asset_database.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-#include "../core/je_configuration.h"
-#if defined(jin_filesystem)
-
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h> /* defines FILENAME_MAX */
-
-#include "../common/je_exception.h"
-
-#include "je_asset_database.h"
-
-namespace JinEngine
-{
- namespace Filesystem
- {
-
- AssetDatabase* AssetDatabase::mAssetDatabase = 0;
-
- AssetDatabase::AssetDatabase()
- {
- mSmt = smtnewshared();
- }
-
- AssetDatabase* AssetDatabase::get()
- {
- return mAssetDatabase ? mAssetDatabase : (mAssetDatabase = new AssetDatabase());
- }
-
- void AssetDatabase::mount(const char * path)
- {
- int err = smtmount(mSmt, path);
- if (err)
- {
- printf("%s mounted path %s", smterrstr(err), path);
- exit(1);
- }
- }
-
- void AssetDatabase::read(const char* path, Buffer& buffer)
- {
- size_t size;
- byte* data = (byte*)smtread(mSmt, path, &size);
- if (data == nullptr)
- throw Exception("Could not read file %s.", path);
- buffer.bind(data, size);
- }
-
- Buffer* read(const char* path)
- {
- return nullptr;
- }
-
- void* AssetDatabase::read(const char* path, unsigned int* len)
- {
- return smtread(mSmt, path, len);
- }
-
- const char* AssetDatabase::getFull(const char* path)
- {
- return smtfullpath(mSmt, path);
- }
-
- bool AssetDatabase::isDir(const char* path)
- {
- return smtisdir(mSmt, path);
- }
-
- bool AssetDatabase::isFile(const char* path)
- {
- return smtisreg(mSmt, path);
- }
-
- bool AssetDatabase::exists(const char* path)
- {
- return smtexists(mSmt, path) == 0;
- }
-/*
- std::vector<std::string> AssetDatabase::getFiles(const char* path, bool recursive)
- {
- }
-*/
- } // namespace Filesystem
-} // namespace JinEngine
-
-#endif // jin_filesystem \ No newline at end of file