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