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

Unified Diff: include/AdblockPlus/FileSystem.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 | « include/AdblockPlus/DefaultFileSystem.h ('k') | include/AdblockPlus/FilterEngine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/FileSystem.h
diff --git a/include/AdblockPlus/FileSystem.h b/include/AdblockPlus/FileSystem.h
index 97277a802fa9c1966e868086b22539a1db5a4229..f3ca264b6153150dcef219af487ddbef362de4e2 100644
--- a/include/AdblockPlus/FileSystem.h
+++ b/include/AdblockPlus/FileSystem.h
@@ -23,6 +23,8 @@
#include <string>
#include <memory>
+#include "IFileSystem.h"
+
namespace AdblockPlus
{
/**
@@ -31,57 +33,22 @@ namespace AdblockPlus
class FileSystem
{
public:
- /**
- * Result of a stat operation, i.e.\ information about a file.
- */
- struct StatResult
- {
- StatResult()
- {
- exists = false;
- isDirectory = false;
- isFile = false;
- lastModified = 0;
- }
-
- /**
- * File exists.
- */
- bool exists;
-
- /**
- * File is a directory.
- */
- bool isDirectory;
-
- /**
- * File is a regular file.
- */
- bool isFile;
-
- /**
- * POSIX time of the last modification.
- */
- int64_t lastModified;
- };
-
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>
- Read(const std::string& path) const = 0;
+ virtual IFileSystem::IOBuffer Read(const std::string& path) const = 0;
/**
* 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 IFileSystem::IOBuffer& data) = 0;
/**
* Moves a file (i.e.\ renames it).
@@ -102,7 +69,7 @@ namespace AdblockPlus
* @param path File path.
* @return File information.
*/
- virtual StatResult Stat(const std::string& path) const = 0;
+ virtual IFileSystem::StatResult Stat(const std::string& path) const = 0;
/**
* Returns the absolute path to a file.
@@ -115,7 +82,7 @@ namespace AdblockPlus
/**
* Shared smart pointer to a `FileSystem` instance.
*/
- typedef std::shared_ptr<FileSystem> FileSystemPtr;
+ typedef std::shared_ptr<FileSystem> FileSystemSyncPtr;
}
#endif
« no previous file with comments | « include/AdblockPlus/DefaultFileSystem.h ('k') | include/AdblockPlus/FilterEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld