diff options
Diffstat (limited to 'src/google/protobuf/testing/file.cc')
-rw-r--r-- | src/google/protobuf/testing/file.cc | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/google/protobuf/testing/file.cc b/src/google/protobuf/testing/file.cc index 20e01a1..e224781 100644 --- a/src/google/protobuf/testing/file.cc +++ b/src/google/protobuf/testing/file.cc @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ +// http://code.google.com/p/protobuf/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -82,24 +82,6 @@ void File::ReadFileToStringOrDie(const string& name, string* output) { GOOGLE_CHECK(ReadFileToString(name, output)) << "Could not read: " << name; } -bool File::WriteStringToFile(const string& contents, const string& name) { - FILE* file = fopen(name.c_str(), "wb"); - if (file == NULL) { - GOOGLE_LOG(ERROR) << "fopen(" << name << ", \"wb\"): " << strerror(errno); - return false; - } - - if (fwrite(contents.data(), 1, contents.size(), file) != contents.size()) { - GOOGLE_LOG(ERROR) << "fwrite(" << name << "): " << strerror(errno); - return false; - } - - if (fclose(file) != 0) { - return false; - } - return true; -} - void File::WriteStringToFileOrDie(const string& contents, const string& name) { FILE* file = fopen(name.c_str(), "wb"); GOOGLE_CHECK(file != NULL) |