Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: include/AdblockPlus/FileSystem.h

Issue 10296001: Implement File API (Closed)
Left Patch Set: Don't pass a blog to _fileSystem.write Created April 12, 2013, 12:10 p.m.
Right Patch Set: Addressed the new issues Created April 16, 2013, 1:37 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « include/AdblockPlus/FileReader.h ('k') | include/AdblockPlus/FilterEngine.h » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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>
Wladimir Palant 2013/04/12 16:10:35 I guess the reason for not returning std::string h
Felix Dahlke 2013/04/15 03:43:34 It's probably not really needed, as the whole stri
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
LEFTRIGHT

Powered by Google App Engine
This is Rietveld