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

Delta Between Two Patch Sets: include/AdblockPlus/FileSystem.h

Issue 29481704: Noissue - Use buffer for FileSystem IO (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Left Patch Set: Removed Utils::Slurp() we no longer need Created July 6, 2017, 9:32 p.m.
Right Patch Set: Nit addressed Created July 7, 2017, 12:50 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « include/AdblockPlus/DefaultFileSystem.h ('k') | src/DefaultFileSystem.cpp » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 typedef std::vector<uint8_t> IOBuffer; 68 typedef std::vector<uint8_t> IOBuffer;
69 69
70 virtual ~FileSystem() {} 70 virtual ~FileSystem() {}
71 71
72 /** 72 /**
73 * Reads from a file. 73 * Reads from a file.
74 * @param path File path. 74 * @param path File path.
75 * @return Buffer with the file content. 75 * @return Buffer with the file content.
76 */ 76 */
77 virtual IOBuffer 77 virtual IOBuffer Read(const std::string& path) const = 0;
78 Read(const std::string& path) const = 0;
79 78
80 /** 79 /**
81 * Writes to a file. 80 * Writes to a file.
82 * @param path File path. 81 * @param path File path.
83 * @param data Buffer with the data to write. 82 * @param data Buffer with the data to write.
84 */ 83 */
85 virtual void Write(const std::string& path, 84 virtual void Write(const std::string& path,
86 const IOBuffer& data) = 0; 85 const IOBuffer& data) = 0;
87 86
88 /** 87 /**
(...skipping 25 matching lines...) Expand all
114 virtual std::string Resolve(const std::string& path) const = 0; 113 virtual std::string Resolve(const std::string& path) const = 0;
115 }; 114 };
116 115
117 /** 116 /**
118 * Shared smart pointer to a `FileSystem` instance. 117 * Shared smart pointer to a `FileSystem` instance.
119 */ 118 */
120 typedef std::shared_ptr<FileSystem> FileSystemPtr; 119 typedef std::shared_ptr<FileSystem> FileSystemPtr;
121 } 120 }
122 121
123 #endif 122 #endif
LEFTRIGHT

Powered by Google App Engine
This is Rietveld