| 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
|
|
|