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

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

Issue 29449592: Issue 5183 - Provide async interface for FileSystem (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created May 26, 2017, 12:43 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
« no previous file with comments | « no previous file | include/AdblockPlus/FileSystem.h » ('j') | include/AdblockPlus/FileSystem.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 16 matching lines...) Expand all
27 #endif 27 #endif
28 28
29 namespace AdblockPlus 29 namespace AdblockPlus
30 { 30 {
31 /** 31 /**
32 * `FileSystem` implementation that interacts directly with the operating 32 * `FileSystem` implementation that interacts directly with the operating
33 * system's file system. 33 * system's file system.
34 * All paths are considered relative to the base path, or to the current 34 * All paths are considered relative to the base path, or to the current
35 * working directory if no base path is set (see `SetBasePath()`). 35 * working directory if no base path is set (see `SetBasePath()`).
36 */ 36 */
37 class DefaultFileSystem : public FileSystem 37 class DefaultFileSystem : public FileSystem
sergei 2017/05/26 13:32:04 I think that there should be a different class imp
38 { 38 {
39 public: 39 public:
40 std::shared_ptr<std::istream> Read(const std::string& path) const; 40 std::shared_ptr<std::istream> Read(const std::string& path) const;
41 void Read(const std::string& path,
42 const ReadCallback& callback) const;
41 void Write(const std::string& path, std::istream& data); 43 void Write(const std::string& path, std::istream& data);
44 void Write(const std::string& path,
45 std::istream& data,
46 const Callback& callback);
42 void Move(const std::string& fromPath, const std::string& toPath); 47 void Move(const std::string& fromPath, const std::string& toPath);
48 void Move(const std::string& fromPath,
49 const std::string& toPath,
50 const Callback& callback);
43 void Remove(const std::string& path); 51 void Remove(const std::string& path);
52 void Remove(const std::string& path, const Callback& callback);
44 StatResult Stat(const std::string& path) const; 53 StatResult Stat(const std::string& path) const;
54 void Stat(const std::string& path,
55 const StatCallback& callback) const;
45 std::string Resolve(const std::string& path) const; 56 std::string Resolve(const std::string& path) const;
57 void Resolve(const std::string& path,
58 const ResolveCallback& callback) const;
46 59
47 /** 60 /**
48 * Sets the base path, all paths are considered relative to it. 61 * Sets the base path, all paths are considered relative to it.
49 * @param path Base path. 62 * @param path Base path.
50 */ 63 */
51 void SetBasePath(const std::string& path); 64 void SetBasePath(const std::string& path);
52 65
53 protected: 66 protected:
54 std::string basePath; 67 std::string basePath;
55 }; 68 };
56 } 69 }
57 70
58 #endif 71 #endif
OLDNEW
« no previous file with comments | « no previous file | include/AdblockPlus/FileSystem.h » ('j') | include/AdblockPlus/FileSystem.h » ('J')

Powered by Google App Engine
This is Rietveld