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

Unified Diff: base/file_path.h

Issue 10067002: Add an AddExtension() method in FilePath (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Simplified special case checking Created 8 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
« no previous file with comments | « no previous file | base/file_path.cc » ('j') | base/file_path.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_path.h
diff --git a/base/file_path.h b/base/file_path.h
index 4d763eb394c1cca1eb11225a753a185f05e0c947..b90056b9abe7635a7bae431a58296f3225b18cef 100644
--- a/base/file_path.h
+++ b/base/file_path.h
@@ -242,8 +242,13 @@ class BASE_EXPORT FilePath {
FilePath InsertBeforeExtensionASCII(
const base::StringPiece& suffix) const WARN_UNUSED_RESULT;
+ // Adds |extension| to |file_name|. Returns the current FilePath if
+ // |extension| is empty. Returns "" if BaseName() == "." or "..".
+ FilePath AddExtension(
+ const StringType& extension) const WARN_UNUSED_RESULT;
+
// Replaces the extension of |file_name| with |extension|. If |file_name|
- // does not have an extension, them |extension| is added. If |extension| is
+ // does not have an extension, then |extension| is added. If |extension| is
// empty, then the extension is removed from |file_name|.
// Returns "" if BaseName() == "." or "..".
FilePath ReplaceExtension(
« no previous file with comments | « no previous file | base/file_path.cc » ('j') | base/file_path.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698