| OLD | NEW |
| 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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 std::string Resolve(const std::string& fileName) const; | 47 std::string Resolve(const std::string& fileName) const; |
| 48 protected: | 48 protected: |
| 49 std::string basePath; | 49 std::string basePath; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 class DefaultFileSystem : public IFileSystem | 52 class DefaultFileSystem : public IFileSystem |
| 53 { | 53 { |
| 54 public: | 54 public: |
| 55 explicit DefaultFileSystem(const Scheduler& scheduler, std::unique_ptr<Defau
ltFileSystemSync> syncImpl); | 55 explicit DefaultFileSystem(const Scheduler& scheduler, std::unique_ptr<Defau
ltFileSystemSync> syncImpl); |
| 56 void Read(const std::string& fileName, | 56 void Read(const std::string& fileName, |
| 57 const ReadCallback& callback) const override; | 57 const ReadCallback& doneCallback, |
| 58 const Callback& errorCallback) const override; |
| 58 void Write(const std::string& fileName, | 59 void Write(const std::string& fileName, |
| 59 const IOBuffer& data, | 60 const IOBuffer& data, |
| 60 const Callback& callback) override; | 61 const Callback& callback) override; |
| 61 void Move(const std::string& fromFileName, | 62 void Move(const std::string& fromFileName, |
| 62 const std::string& toFileName, | 63 const std::string& toFileName, |
| 63 const Callback& callback) override; | 64 const Callback& callback) override; |
| 64 void Remove(const std::string& fileName, const Callback& callback) override; | 65 void Remove(const std::string& fileName, const Callback& callback) override; |
| 65 void Stat(const std::string& fileName, | 66 void Stat(const std::string& fileName, |
| 66 const StatCallback& callback) const override; | 67 const StatCallback& callback) const override; |
| 67 | 68 |
| 68 private: | 69 private: |
| 69 // Returns the absolute path to a file. | 70 // Returns the absolute path to a file. |
| 70 std::string Resolve(const std::string& fileName) const; | 71 std::string Resolve(const std::string& fileName) const; |
| 71 Scheduler scheduler; | 72 Scheduler scheduler; |
| 72 std::unique_ptr<DefaultFileSystemSync> syncImpl; | 73 std::unique_ptr<DefaultFileSystemSync> syncImpl; |
| 73 }; | 74 }; |
| 74 } | 75 } |
| 75 | 76 |
| 76 #endif | 77 #endif |
| OLD | NEW |