OLD | NEW |
(Empty) | |
| 1 #ifndef ADBLOCKPLUS_FILE_SYSTEM_H |
| 2 #define ADBLOCKPLUS_FILE_SYSTEM_H |
| 3 |
| 4 #include <istream> |
| 5 #include <string> |
| 6 |
| 7 #include "tr1_memory.h" |
| 8 |
| 9 namespace AdblockPlus |
| 10 { |
| 11 class FileSystem |
| 12 { |
| 13 public: |
| 14 struct StatResult |
| 15 { |
| 16 bool exists; |
| 17 bool isDirectory; |
| 18 bool isFile; |
| 19 int64_t lastModified; |
| 20 }; |
| 21 |
| 22 virtual ~FileSystem() {} |
| 23 virtual std::tr1::shared_ptr<std::istream> |
| 24 Read(const std::string& path) const = 0; |
| 25 virtual void Write(const std::string& path, |
| 26 std::tr1::shared_ptr<std::ostream> data) = 0; |
| 27 virtual void Move(const std::string& fromPath, |
| 28 const std::string& toPath) = 0; |
| 29 virtual void Remove(const std::string& path) = 0; |
| 30 virtual StatResult Stat(const std::string& path) const = 0; |
| 31 }; |
| 32 } |
| 33 |
| 34 #endif |
OLD | NEW |