7 #ifndef PACKAGER_FILE_LOCAL_FILE_H_
8 #define PACKAGER_FILE_LOCAL_FILE_H_
14 #include "packager/base/compiler_specific.h"
15 #include "packager/file/file.h"
29 bool Close()
override;
30 int64_t
Read(
void* buffer, uint64_t length)
override;
31 int64_t
Write(
const void* buffer, uint64_t length)
override;
32 int64_t
Size()
override;
33 bool Flush()
override;
34 bool Seek(uint64_t position)
override;
35 bool Tell(uint64_t* position)
override;
49 std::string file_mode_;
Define an abstract file interface.
const std::string & file_name() const
Implement LocalFile which deals with local storage.
bool Seek(uint64_t position) override
int64_t Read(void *buffer, uint64_t length) override
LocalFile(const char *file_name, const char *mode)
static bool Delete(const char *file_name)
bool Open() override
Internal open. Should not be used directly.
int64_t Write(const void *buffer, uint64_t length) override
bool Tell(uint64_t *position) override
All the methods that are virtual are virtual for mocking.