Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: third_party/woff2/src/file.h

Issue 1873123002: Update woff2 to 4e698b8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: assert.h Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/woff2/src/file.h
diff --git a/third_party/woff2/src/file.h b/third_party/woff2/src/file.h
index 69a92f8ab91f7947112626cbc2598168438ead05..7afcb315fe8d3a815fb5b0c3ea4e780489e37e4c 100644
--- a/third_party/woff2/src/file.h
+++ b/third_party/woff2/src/file.h
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// File IO helpers
+// File IO helpers.
#ifndef WOFF2_FILE_H_
#define WOFF2_FILE_H_
@@ -22,18 +22,20 @@
namespace woff2 {
-inline std::string GetFileContent(std::string filename) {
+using std::string;
+
+
+inline string GetFileContent(string filename) {
std::ifstream ifs(filename.c_str(), std::ios::binary);
- return std::string(
+ return string(
std::istreambuf_iterator<char>(ifs.rdbuf()),
std::istreambuf_iterator<char>());
}
-inline void SetFileContents(std::string filename, std::string content) {
+inline void SetFileContents(string filename, string::iterator start,
+ string::iterator end) {
std::ofstream ofs(filename.c_str(), std::ios::binary);
- std::copy(content.begin(),
- content.end(),
- std::ostream_iterator<char>(ofs));
+ std::copy(start, end, std::ostream_iterator<char>(ofs));
}
} // namespace woff2

Powered by Google App Engine
This is Rietveld 408576698