29 #ifndef FILE_ACCESS_BUFFERED_FA_H 30 #define FILE_ACCESS_BUFFERED_FA_H 32 #include "core/io/file_access_buffered.h" 39 int read_data_block(
int p_offset,
int p_size, uint8_t *p_dest = 0)
const {
41 ERR_FAIL_COND_V( !f.is_open(), -1 );
43 ((T*)&f)->seek(p_offset);
47 f.get_buffer(p_dest, p_size);
52 cache.offset = p_offset;
53 cache.buffer.resize(p_size);
60 f.get_buffer(cache.buffer.ptr(), p_size);
72 virtual void _set_access_type(AccessType p_access) {
73 f._set_access_type(p_access);
74 FileAccessBuffered::_set_access_type(p_access);
87 f.store_buffer(p_src, p_length);
92 return f.file_exists(p_name);
99 Error ret = f._open(p_path, p_mode_flags);
104 file.size = f.get_len();
108 file.access_flags = p_mode_flags;
110 cache.buffer.resize(0);
113 return set_error(OK);
125 cache.buffer.resize(0);
135 virtual uint64_t _get_modified_time(
const String& p_file) {
137 return f._get_modified_time(p_file);
147 #endif // FILE_ACCESS_BUFFERED_FA_H Error _open(const String &p_path, int p_mode_flags)
open a file
Definition: file_access_buffered_fa.h:95
void close()
close a file
Definition: file_access_buffered_fa.h:116
Definition: file_access_buffered_fa.h:35
Definition: file_access_buffered.h:37
void store_8(uint8_t p_dest)
store a byte
Definition: file_access_buffered_fa.h:80
bool file_exists(const String &p_name)
return true if a file exists
Definition: file_access_buffered_fa.h:90
Definition: file_access.h:40
void store_buffer(const uint8_t *p_src, int p_length)
store an array of bytes
Definition: file_access_buffered_fa.h:85