diff options
author | chai <chaifix@163.com> | 2018-12-14 14:55:42 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-12-14 14:55:42 +0800 |
commit | 870fcdae66edc680cac55defb149e1434e865f37 (patch) | |
tree | bb0b45627b98ec4c782466b3bb57daf63c44e460 /src/libjin/filesystem/je_asset_database.cpp | |
parent | eb8ca083c9be574acd27cf0de41d1f69146cad7a (diff) |
*格式化代码
Diffstat (limited to 'src/libjin/filesystem/je_asset_database.cpp')
-rw-r--r-- | src/libjin/filesystem/je_asset_database.cpp | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/src/libjin/filesystem/je_asset_database.cpp b/src/libjin/filesystem/je_asset_database.cpp index a8524c5..1203643 100644 --- a/src/libjin/filesystem/je_asset_database.cpp +++ b/src/libjin/filesystem/je_asset_database.cpp @@ -11,75 +11,75 @@ namespace JinEngine { - namespace Filesystem - { + namespace Filesystem + { - AssetDatabase* AssetDatabase::mAssetDatabase = 0; + AssetDatabase* AssetDatabase::mAssetDatabase = 0; - AssetDatabase::AssetDatabase() - { + 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) - { + } + + 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; - } + 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 Filesystem } // namespace JinEngine #endif // jin_filesystem
\ No newline at end of file |