7 #ifndef MEDIA_FILE_MEDIA_FILE_H_
8 #define MEDIA_FILE_MEDIA_FILE_H_
14 #include <packager/file.h>
15 #include <packager/macros/classes.h>
23 MemoryFile(
const std::string& file_name,
const std::string& mode);
27 bool Close()
override;
28 int64_t Read(
void* buffer, uint64_t length)
override;
29 int64_t Write(
const void* buffer, uint64_t length)
override;
30 void CloseForWriting()
override;
31 int64_t Size()
override;
32 bool Flush()
override;
33 bool Seek(uint64_t position)
override;
34 bool Tell(uint64_t* position)
override;
43 static void Delete(
const std::string& file_name);
51 std::vector<uint8_t>* file_;
static void Delete(const std::string &file_name)
All the methods that are virtual are virtual for mocking.