summaryrefslogtreecommitdiffstats
path: root/base/file_util.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-30 18:23:50 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-30 18:23:50 +0000
commit82f84b91a10f513cd59b8382a7ab00ed0f179bd5 (patch)
tree125081aff715fbe6815e8bb81889d4d49f887cf3 /base/file_util.cc
parent88a8115978d75161674d97cde0761cbdba73daed (diff)
downloadchromium_src-82f84b91a10f513cd59b8382a7ab00ed0f179bd5.zip
chromium_src-82f84b91a10f513cd59b8382a7ab00ed0f179bd5.tar.gz
chromium_src-82f84b91a10f513cd59b8382a7ab00ed0f179bd5.tar.bz2
Move ReadFileToString to the base namespace.
BUG= Review URL: https://codereview.chromium.org/19579005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220612 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util.cc')
-rw-r--r--base/file_util.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/base/file_util.cc b/base/file_util.cc
index 2623b64..e980676 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -130,21 +130,10 @@ bool TextContentsEqual(const FilePath& filename1, const FilePath& filename2) {
return true;
}
-} // namespace base
-
-// -----------------------------------------------------------------------------
-
-namespace file_util {
-
-using base::FileEnumerator;
-using base::FilePath;
-using base::kExtensionSeparator;
-using base::kMaxUniqueFiles;
-
bool ReadFileToString(const FilePath& path, std::string* contents) {
if (path.ReferencesParent())
return false;
- FILE* file = OpenFile(path, "rb");
+ FILE* file = file_util::OpenFile(path, "rb");
if (!file) {
return false;
}
@@ -155,11 +144,22 @@ bool ReadFileToString(const FilePath& path, std::string* contents) {
if (contents)
contents->append(buf, len);
}
- CloseFile(file);
+ file_util::CloseFile(file);
return true;
}
+} // namespace base
+
+// -----------------------------------------------------------------------------
+
+namespace file_util {
+
+using base::FileEnumerator;
+using base::FilePath;
+using base::kExtensionSeparator;
+using base::kMaxUniqueFiles;
+
bool IsDirectoryEmpty(const FilePath& dir_path) {
FileEnumerator files(dir_path, false,
FileEnumerator::FILES | FileEnumerator::DIRECTORIES);