7 #ifndef PACKAGER_FILE_LOCAL_FILE_H_
8 #define PACKAGER_FILE_LOCAL_FILE_H_
13 #include <packager/file.h>
14 #include <packager/macros/classes.h>
24 LocalFile(
const char* file_name,
const char* mode);
28 bool Close()
override;
29 int64_t Read(
void* buffer, uint64_t length)
override;
30 int64_t Write(
const void* buffer, uint64_t length)
override;
31 void CloseForWriting()
override;
32 int64_t Size()
override;
33 bool Flush()
override;
34 bool Seek(uint64_t position)
override;
35 bool Tell(uint64_t* position)
override;
41 static bool Delete(
const char* file_name);
49 std::string file_mode_;
Implement LocalFile which deals with local storage.
LocalFile(const char *file_name, const char *mode)
static bool Delete(const char *file_name)
All the methods that are virtual are virtual for mocking.