summaryrefslogtreecommitdiff
path: root/platform/android/file_access_jandroid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/file_access_jandroid.cpp')
-rw-r--r--platform/android/file_access_jandroid.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/platform/android/file_access_jandroid.cpp b/platform/android/file_access_jandroid.cpp
index 5b8cf01138..d4c2a23aa0 100644
--- a/platform/android/file_access_jandroid.cpp
+++ b/platform/android/file_access_jandroid.cpp
@@ -94,13 +94,13 @@ void FileAccessJAndroid::seek(size_t p_position) {
JNIEnv *env = ThreadAndroid::get_env();
- ERR_FAIL_COND(!is_open());
+ ERR_FAIL_COND_MSG(!is_open(), "File must be opened before use.");
env->CallVoidMethod(io, _file_seek, id, p_position);
}
void FileAccessJAndroid::seek_end(int64_t p_position) {
- ERR_FAIL_COND(!is_open());
+ ERR_FAIL_COND_MSG(!is_open(), "File must be opened before use.");
seek(get_len());
}
@@ -108,34 +108,34 @@ void FileAccessJAndroid::seek_end(int64_t p_position) {
size_t FileAccessJAndroid::get_position() const {
JNIEnv *env = ThreadAndroid::get_env();
- ERR_FAIL_COND_V(!is_open(), 0);
+ ERR_FAIL_COND_V_MSG(!is_open(), 0, "File must be opened before use.");
return env->CallIntMethod(io, _file_tell, id);
}
size_t FileAccessJAndroid::get_len() const {
JNIEnv *env = ThreadAndroid::get_env();
- ERR_FAIL_COND_V(!is_open(), 0);
+ ERR_FAIL_COND_V_MSG(!is_open(), 0, "File must be opened before use.");
return env->CallIntMethod(io, _file_get_size, id);
}
bool FileAccessJAndroid::eof_reached() const {
JNIEnv *env = ThreadAndroid::get_env();
- ERR_FAIL_COND_V(!is_open(), 0);
+ ERR_FAIL_COND_V_MSG(!is_open(), 0, "File must be opened before use.");
return env->CallIntMethod(io, _file_eof, id);
}
uint8_t FileAccessJAndroid::get_8() const {
- ERR_FAIL_COND_V(!is_open(), 0);
+ ERR_FAIL_COND_V_MSG(!is_open(), 0, "File must be opened before use.");
uint8_t byte;
get_buffer(&byte, 1);
return byte;
}
int FileAccessJAndroid::get_buffer(uint8_t *p_dst, int p_length) const {
- ERR_FAIL_COND_V(!is_open(), 0);
+ ERR_FAIL_COND_V_MSG(!is_open(), 0, "File must be opened before use.");
if (p_length == 0)
return 0;
JNIEnv *env = ThreadAndroid::get_env();