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

Unified Diff: include/AdblockPlus/FileSystem.h

Issue 10296001: Implement File API (Closed)
Patch Set: Created April 12, 2013, 10:10 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/AdblockPlus.h ('k') | include/AdblockPlus/JsEngine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/FileSystem.h
===================================================================
rename from include/AdblockPlus/FileReader.h
rename to include/AdblockPlus/FileSystem.h
--- a/include/AdblockPlus/FileReader.h
+++ b/include/AdblockPlus/FileSystem.h
@@ -1,5 +1,5 @@
-#ifndef ADBLOCKPLUS_FILE_READER_H
-#define ADBLOCKPLUS_FILE_READER_H
+#ifndef ADBLOCKPLUS_FILE_SYSTEM_H
+#define ADBLOCKPLUS_FILE_SYSTEM_H
#include <istream>
#include <string>
@@ -7,11 +7,24 @@
namespace AdblockPlus
{
- class FileReader
+ class FileSystem
{
public:
- virtual ~FileReader();
+ struct StatResult
+ {
+ bool exists;
+ bool isDirectory;
+ bool isFile;
+ int lastModified;
+ };
+
+ virtual ~FileSystem() {}
virtual std::auto_ptr<std::istream> Read(const std::string& path) const = 0;
+ virtual void Write(const std::string& path, const std::string& content) = 0;
+ virtual void Move(const std::string& fromPath,
+ const std::string& toPath) = 0;
+ virtual void Remove(const std::string& path) = 0;
+ virtual StatResult Stat(const std::string& path) const = 0;
};
}
« no previous file with comments | « include/AdblockPlus.h ('k') | include/AdblockPlus/JsEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld