You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Added some obvious errors explanations
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user