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