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

Unified Diff: include/AdblockPlus/DefaultFileSystem.h

Issue 29508624: Issue 5473 - Update to use libadblockplus revision b4d6e55f2116 (Closed)
Patch Set: Created Aug. 7, 2017, 12:41 p.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 | « android_x86/libv8_snapshot.a ('k') | include/AdblockPlus/FileSystem.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/DefaultFileSystem.h
diff --git a/include/AdblockPlus/DefaultFileSystem.h b/include/AdblockPlus/DefaultFileSystem.h
index 497daef94bef8eac987d61c90379097c4e3a1a8a..75ad13030b30759f5df448a7a313a58228e49b3f 100644
--- a/include/AdblockPlus/DefaultFileSystem.h
+++ b/include/AdblockPlus/DefaultFileSystem.h
@@ -34,14 +34,14 @@ namespace AdblockPlus
* All paths are considered relative to the base path, or to the current
* working directory if no base path is set (see `SetBasePath()`).
*/
- class DefaultFileSystem : public FileSystem
+ class DefaultFileSystemSync : public FileSystem
{
public:
- std::shared_ptr<std::istream> Read(const std::string& path) const;
- void Write(const std::string& path, std::istream& data);
+ IFileSystem::IOBuffer Read(const std::string& path) const;
+ void Write(const std::string& path, const IFileSystem::IOBuffer& data);
void Move(const std::string& fromPath, const std::string& toPath);
void Remove(const std::string& path);
- StatResult Stat(const std::string& path) const;
+ IFileSystem::StatResult Stat(const std::string& path) const;
std::string Resolve(const std::string& path) const;
/**
@@ -53,6 +53,27 @@ namespace AdblockPlus
protected:
std::string basePath;
};
+
+ class DefaultFileSystem : public IFileSystem
+ {
+ public:
+ explicit DefaultFileSystem(const FileSystemSyncPtr& syncImpl);
+ void Read(const std::string& path,
+ const ReadCallback& callback) const;
+ void Write(const std::string& path,
+ const IOBuffer& data,
+ const Callback& callback);
+ void Move(const std::string& fromPath,
+ const std::string& toPath,
+ const Callback& callback);
+ void Remove(const std::string& path, const Callback& callback);
+ void Stat(const std::string& path,
+ const StatCallback& callback) const;
+
+ std::string Resolve(const std::string& path) const;
+ private:
+ FileSystemSyncPtr syncImpl;
+ };
}
#endif
« no previous file with comments | « android_x86/libv8_snapshot.a ('k') | include/AdblockPlus/FileSystem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld