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

Unified Diff: base/file_util.cc

Issue 189333004: Move more file_util functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
« no previous file with comments | « base/file_util.h ('k') | base/file_util_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util.cc
diff --git a/base/file_util.cc b/base/file_util.cc
index 87b9afb9946a31d486a162b67d4064f3e6a33558..c1bf50abc45f720bca415d1bc56d5fb9bf35abda 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -236,18 +236,8 @@ bool TruncateFile(FILE* file) {
return true;
}
-} // namespace base
-
-// -----------------------------------------------------------------------------
-
-namespace file_util {
-
-using base::FilePath;
-using base::kMaxUniqueFiles;
-
-int GetUniquePathNumber(
- const FilePath& path,
- const FilePath::StringType& suffix) {
+int GetUniquePathNumber(const FilePath& path,
+ const FilePath::StringType& suffix) {
bool have_suffix = !suffix.empty();
if (!PathExists(path) &&
(!have_suffix || !PathExists(FilePath(path.value() + suffix)))) {
@@ -256,8 +246,7 @@ int GetUniquePathNumber(
FilePath new_path;
for (int count = 1; count <= kMaxUniqueFiles; ++count) {
- new_path =
- path.InsertBeforeExtensionASCII(base::StringPrintf(" (%d)", count));
+ new_path = path.InsertBeforeExtensionASCII(StringPrintf(" (%d)", count));
if (!PathExists(new_path) &&
(!have_suffix || !PathExists(FilePath(new_path.value() + suffix)))) {
return count;
@@ -267,4 +256,4 @@ int GetUniquePathNumber(
return -1;
}
-} // namespace file_util
+} // namespace base
« no previous file with comments | « base/file_util.h ('k') | base/file_util_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698