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.cpp9
-rw-r--r--src/libjin/Filesystem/je_asset_database.h2
2 files changed, 6 insertions, 5 deletions
diff --git a/src/libjin/Filesystem/je_asset_database.cpp b/src/libjin/Filesystem/je_asset_database.cpp
index f2c5681..a8524c5 100644
--- a/src/libjin/Filesystem/je_asset_database.cpp
+++ b/src/libjin/Filesystem/je_asset_database.cpp
@@ -5,6 +5,8 @@
#include <stdlib.h>
#include <stdio.h> /* defines FILENAME_MAX */
+#include "../common/je_exception.h"
+
#include "je_asset_database.h"
namespace JinEngine
@@ -34,14 +36,13 @@ namespace JinEngine
}
}
- bool AssetDatabase::read(const char* path, Buffer& buffer)
+ void AssetDatabase::read(const char* path, Buffer& buffer)
{
size_t size;
byte* data = (byte*)smtread(mSmt, path, &size);
- if (data == nullptr)
- return false;
+ if (data == nullptr)
+ throw Exception("Could not read file %s.", path);
buffer.bind(data, size);
- return true;
}
Buffer* read(const char* path)
diff --git a/src/libjin/Filesystem/je_asset_database.h b/src/libjin/Filesystem/je_asset_database.h
index e61aebf..e8b1bd1 100644
--- a/src/libjin/Filesystem/je_asset_database.h
+++ b/src/libjin/Filesystem/je_asset_database.h
@@ -70,7 +70,7 @@ namespace JinEngine
/// @param buffer Buffer to fill.
/// @return True if read sucessful, otherwise return false.
///
- bool read(const char* path, Buffer& buffer);
+ void read(const char* path, Buffer& buffer);
///
/// Read file and return data content.