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

Unified Diff: include/AdblockPlus/FileSystem.h

Issue 29481704: Noissue - Use buffer for FileSystem IO (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created July 6, 2017, 9:19 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
Index: include/AdblockPlus/FileSystem.h
===================================================================
--- a/include/AdblockPlus/FileSystem.h
+++ b/include/AdblockPlus/FileSystem.h
@@ -60,33 +60,35 @@
bool isFile;
/**
* POSIX time of the last modification.
*/
int64_t lastModified;
};
+ typedef std::vector<uint8_t> IOBuffer;
+
virtual ~FileSystem() {}
/**
* Reads from a file.
* @param path File path.
- * @return Input stream with the file's contents.
+ * @return Buffer with the file content.
*/
- virtual std::shared_ptr<std::istream>
+ virtual IOBuffer
Read(const std::string& path) const = 0;
sergei 2017/07/07 07:27:36 I think it should be one line
hub 2017/07/07 12:51:00 Acknowledged.
/**
* Writes to a file.
* @param path File path.
- * @param data Input stream with the data to write.
+ * @param data Buffer with the data to write.
*/
virtual void Write(const std::string& path,
- std::istream& data) = 0;
+ const IOBuffer& data) = 0;
/**
* Moves a file (i.e.\ renames it).
* @param fromPath Current path to the file.
* @param toPath New path to the file.
*/
virtual void Move(const std::string& fromPath,
const std::string& toPath) = 0;

Powered by Google App Engine
This is Rietveld