00001 #ifndef MEMORY_FILE_H 00002 #define MEMORY_FILE_H 00003 00004 00005 #include "corona.h" 00006 #include "Types.h" 00007 #include "Utility.h" 00008 00009 00010 namespace corona { 00011 00012 class MemoryFile : public DLLImplementation<File> { 00013 public: 00014 MemoryFile(const void* buffer, int size); 00015 ~MemoryFile(); 00016 00017 int COR_CALL read(void* buffer, int size); 00018 int COR_CALL write(const void* buffer, int size); 00019 bool COR_CALL seek(int position, SeekMode mode); 00020 int COR_CALL tell(); 00021 00022 private: 00023 void ensureSize(int min_size); 00024 00025 byte* m_buffer; 00026 int m_position; 00027 int m_size; 00028 00030 int m_capacity; 00031 }; 00032 00033 } 00034 00035 00036 #endif