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: Addressed all remaining issues Created April 16, 2013, 11:55 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
Index: shell/src/Main.cpp
===================================================================
--- a/shell/src/Main.cpp
+++ b/shell/src/Main.cpp
@@ -1,5 +1,4 @@
#include <AdblockPlus.h>
-#include <fstream>
#include <iostream>
#include <sstream>
@@ -11,17 +10,6 @@
namespace
{
- class LibFileReader : public AdblockPlus::FileReader
- {
- public:
- std::auto_ptr<std::istream> Read(const std::string& path) const
- {
- std::ifstream* file = new std::ifstream;
- file->open(("lib/" + path).c_str());
- return std::auto_ptr<std::istream>(file);
- }
- };
-
class CerrErrorCallback : public AdblockPlus::ErrorCallback
{
public:
@@ -58,10 +46,10 @@
{
try
{
- LibFileReader fileReader;
+ AdblockPlus::DefaultFileSystem 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/DefaultFileSystem.cpp » ('j') | src/DefaultFileSystem.cpp » ('J')

Powered by Google App Engine
This is Rietveld