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

Side by Side Diff: include/AdblockPlus/FileSystem.h

Issue 10296001: Implement File API (Closed)
Patch Set: Address issues Created April 15, 2013, 1:42 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 #ifndef ADBLOCKPLUS_FILE_READER_H 1 #ifndef ADBLOCKPLUS_FILE_SYSTEM_H
2 #define ADBLOCKPLUS_FILE_READER_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 #include <memory>
7 7
8 namespace AdblockPlus 8 namespace AdblockPlus
9 { 9 {
10 class FileReader 10 class FileSystem
11 { 11 {
12 public: 12 public:
13 virtual ~FileReader(); 13 struct StatResult
14 {
15 bool exists;
16 bool isDirectory;
17 bool isFile;
18 int64_t lastModified;
19 };
20
21 virtual ~FileSystem() {}
14 virtual std::auto_ptr<std::istream> Read(const std::string& path) const = 0; 22 virtual std::auto_ptr<std::istream> Read(const std::string& path) const = 0;
23 virtual void Write(const std::string& path, const std::string& content) = 0;
24 virtual void Move(const std::string& fromPath,
25 const std::string& toPath) = 0;
26 virtual void Remove(const std::string& path) = 0;
27 virtual StatResult Stat(const std::string& path) const = 0;
15 }; 28 };
16 } 29 }
17 30
18 #endif 31 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld