diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-05-31 01:59:42 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-05-31 02:00:18 -0300 |
commit | d5348eebdc7228f7836582cd9bd4ed4f5fd59348 (patch) | |
tree | f4ba57671543fcdb588026733321bab845c9f500 /core/io | |
parent | f62961aba3d9e11d4741649a591217796151a46c (diff) |
work in progress, resource previews
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/file_access_memory.cpp | 8 | ||||
-rw-r--r-- | core/io/file_access_memory.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/core/io/file_access_memory.cpp b/core/io/file_access_memory.cpp index 2880c4ebda..83da55fc61 100644 --- a/core/io/file_access_memory.cpp +++ b/core/io/file_access_memory.cpp @@ -74,6 +74,14 @@ bool FileAccessMemory::file_exists(const String& p_name) { } +Error FileAccessMemory::open_custom(const uint8_t* p_data, int p_len) { + + data=(uint8_t*)p_data; + length=p_len; + pos=0; + return OK; +} + Error FileAccessMemory::_open(const String& p_path, int p_mode_flags) { ERR_FAIL_COND_V(!files, ERR_FILE_NOT_FOUND); diff --git a/core/io/file_access_memory.h b/core/io/file_access_memory.h index 5a9ec2b3c6..8c58a8a8ce 100644 --- a/core/io/file_access_memory.h +++ b/core/io/file_access_memory.h @@ -44,6 +44,7 @@ public: static void register_file(String p_name, Vector<uint8_t> p_data); static void cleanup(); + virtual Error open_custom(const uint8_t* p_data, int p_len); ///< open a file virtual Error _open(const String& p_path, int p_mode_flags); ///< open a file virtual void close(); ///< close a file virtual bool is_open() const; ///< true when file is open |