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

Unified Diff: shell/src/Main.cpp

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 | « libadblockplus.gyp ('k') | src/FileReader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/src/Main.cpp
===================================================================
--- a/shell/src/Main.cpp
+++ b/shell/src/Main.cpp
@@ -11,7 +11,7 @@
namespace
{
- class LibFileReader : public AdblockPlus::FileReader
+ class LibFileSystem : public AdblockPlus::FileSystem
{
public:
std::auto_ptr<std::istream> Read(const std::string& path) const
@@ -20,6 +20,26 @@
file->open(("lib/" + path).c_str());
return std::auto_ptr<std::istream>(file);
}
+
+ void Write(const std::string& path, const std::string& content)
+ {
+ throw std::runtime_error("Write is not implemented");
+ }
+
+ void Move(const std::string& fromPath, const std::string& toPath)
+ {
+ throw std::runtime_error("Move is not implemented");
+ }
+
+ void Remove(const std::string& path)
+ {
+ throw std::runtime_error("Remove is not implemented");
+ }
+
+ StatResult Stat(const std::string& path) const
+ {
+ throw std::runtime_error("Stat is not implemented");
+ }
};
class CerrErrorCallback : public AdblockPlus::ErrorCallback
@@ -58,10 +78,10 @@
{
try
{
- LibFileReader fileReader;
+ LibFileSystem fileSystem;
AdblockPlus::DefaultWebRequest webRequest;
CerrErrorCallback errorCallback;
- AdblockPlus::JsEngine jsEngine(&fileReader, &webRequest, &errorCallback);
+ AdblockPlus::JsEngine jsEngine(&fileSystem, &webRequest, &errorCallback);
AdblockPlus::FilterEngine filterEngine(jsEngine);
CommandMap commands;
« no previous file with comments | « libadblockplus.gyp ('k') | src/FileReader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld