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-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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 class ThrowingLogSystem : public AdblockPlus::LogSystem | 97 class ThrowingLogSystem : public AdblockPlus::LogSystem |
98 { | 98 { |
99 public: | 99 public: |
100 void operator()(LogLevel logLevel, const std::string& message, | 100 void operator()(LogLevel logLevel, const std::string& message, |
101 const std::string& source) | 101 const std::string& source) |
102 { | 102 { |
103 throw std::runtime_error("Unexpected error: " + message); | 103 throw std::runtime_error("Unexpected error: " + message); |
104 } | 104 } |
105 }; | 105 }; |
106 | 106 |
107 class ThrowingFileSystem : public AdblockPlus::IFileSystem, public AdblockPlus::
FileSystem | 107 class ThrowingFileSystem : public AdblockPlus::IFileSystem |
108 { | 108 { |
109 public: | 109 public: |
110 IOBuffer Read(const std::string& path) const | 110 void Read(const std::string& path, const ReadCallback& callback) const overrid
e |
111 { | |
112 throw std::runtime_error("Not implemented"); | |
113 } | |
114 void Read(const std::string& path, | |
115 const ReadCallback& callback) const | |
116 { | 111 { |
117 throw std::runtime_error("Not implemented"); | 112 throw std::runtime_error("Not implemented"); |
118 } | 113 } |
119 | 114 |
120 void Write(const std::string& path, const IOBuffer& content) | |
121 { | |
122 throw std::runtime_error("Not implemented"); | |
123 } | |
124 void Write(const std::string& path, const IOBuffer& data, | 115 void Write(const std::string& path, const IOBuffer& data, |
125 const Callback& callback) | 116 const Callback& callback) override |
126 { | 117 { |
127 throw std::runtime_error("Not implemented"); | 118 throw std::runtime_error("Not implemented"); |
128 } | 119 } |
129 | 120 |
130 void Move(const std::string& fromPath, const std::string& toPath) | |
131 { | |
132 throw std::runtime_error("Not implemented"); | |
133 } | |
134 void Move(const std::string& fromPath, const std::string& toPath, | 121 void Move(const std::string& fromPath, const std::string& toPath, |
135 const Callback& callback) | 122 const Callback& callback) override |
136 { | 123 { |
137 throw std::runtime_error("Not implemented"); | 124 throw std::runtime_error("Not implemented"); |
138 } | 125 } |
139 | 126 |
140 void Remove(const std::string& path) | 127 void Remove(const std::string& path, const Callback& callback) override |
141 { | |
142 throw std::runtime_error("Not implemented"); | |
143 } | |
144 void Remove(const std::string& path, const Callback& callback) | |
145 { | 128 { |
146 throw std::runtime_error("Not implemented"); | 129 throw std::runtime_error("Not implemented"); |
147 } | 130 } |
148 | 131 |
149 StatResult Stat(const std::string& path) const | 132 void Stat(const std::string& path, const StatCallback& callback) const overrid
e |
150 { | |
151 throw std::runtime_error("Not implemented"); | |
152 } | |
153 void Stat(const std::string& path, | |
154 const StatCallback& callback) const | |
155 { | 133 { |
156 throw std::runtime_error("Not implemented"); | 134 throw std::runtime_error("Not implemented"); |
157 } | 135 } |
158 | 136 |
159 std::string Resolve(const std::string& path) const | 137 std::string Resolve(const std::string& path) const override |
160 { | 138 { |
161 throw std::runtime_error("Not implemented"); | 139 throw std::runtime_error("Not implemented"); |
162 } | 140 } |
163 }; | 141 }; |
164 | 142 |
165 class ThrowingWebRequest : public AdblockPlus::IWebRequest | 143 class ThrowingWebRequest : public AdblockPlus::IWebRequest |
166 { | 144 { |
167 public: | 145 public: |
168 void GET(const std::string& url, const AdblockPlus::HeaderList& requestHeaders
, const GetCallback&) override | 146 void GET(const std::string& url, const AdblockPlus::HeaderList& requestHeaders
, const GetCallback&) override |
169 { | 147 { |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 protected: | 289 protected: |
312 AdblockPlus::JsEnginePtr jsEngine; | 290 AdblockPlus::JsEnginePtr jsEngine; |
313 | 291 |
314 virtual void SetUp() | 292 virtual void SetUp() |
315 { | 293 { |
316 jsEngine = CreateJsEngine(); | 294 jsEngine = CreateJsEngine(); |
317 } | 295 } |
318 }; | 296 }; |
319 | 297 |
320 #endif | 298 #endif |
OLD | NEW |