diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-05 20:29:23 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-05 20:29:23 +0000 |
commit | ab4d33341ede10a1763ed16a7e4d75f94a163003 (patch) | |
tree | f271475c6965b1d170b8da3bd8a267a4ccbf4a94 /base | |
parent | fde138ba7251782b9f56e7500491e401f5f227c9 (diff) | |
download | chromium_src-ab4d33341ede10a1763ed16a7e4d75f94a163003.zip chromium_src-ab4d33341ede10a1763ed16a7e4d75f94a163003.tar.gz chromium_src-ab4d33341ede10a1763ed16a7e4d75f94a163003.tar.bz2 |
FilePath: Add WARN_UNUSED_RESULT in more places.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6931030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84300 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/file_path.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/base/file_path.h b/base/file_path.h index fd9260c..bdcb03a 100644 --- a/base/file_path.h +++ b/base/file_path.h @@ -205,13 +205,13 @@ class BASE_API FilePath { // only contains one component, returns a FilePath identifying // kCurrentDirectory. If this object already refers to the root directory, // returns a FilePath identifying the root directory. - FilePath DirName() const; + FilePath DirName() const WARN_UNUSED_RESULT; // Returns a FilePath corresponding to the last path component of this // object, either a file or a directory. If this object already refers to // the root directory, returns a FilePath identifying the root directory; // this is the only situation in which BaseName will return an absolute path. - FilePath BaseName() const; + FilePath BaseName() const WARN_UNUSED_RESULT; // Returns ".jpg" for path "C:\pics\jojo.jpg", or an empty string if // the file has no extension. If non-empty, Extension() will always start @@ -226,7 +226,7 @@ class BASE_API FilePath { // Returns "C:\pics\jojo" for path "C:\pics\jojo.jpg" // NOTE: this is slightly different from the similar file_util implementation // which returned simply 'jojo'. - FilePath RemoveExtension() const; + FilePath RemoveExtension() const WARN_UNUSED_RESULT; // Inserts |suffix| after the file name portion of |path| but before the // extension. Returns "" if BaseName() == "." or "..". @@ -235,14 +235,17 @@ class BASE_API FilePath { // path == "jojo.jpg" suffix == " (1)", returns "jojo (1).jpg" // path == "C:\pics\jojo" suffix == " (1)", returns "C:\pics\jojo (1)" // path == "C:\pics.old\jojo" suffix == " (1)", returns "C:\pics.old\jojo (1)" - FilePath InsertBeforeExtension(const StringType& suffix) const; - FilePath InsertBeforeExtensionASCII(const base::StringPiece& suffix) const; + FilePath InsertBeforeExtension( + const StringType& suffix) const WARN_UNUSED_RESULT; + FilePath InsertBeforeExtensionASCII( + const base::StringPiece& suffix) 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 // empty, then the extension is removed from |file_name|. // Returns "" if BaseName() == "." or "..". - FilePath ReplaceExtension(const StringType& extension) const; + FilePath ReplaceExtension( + const StringType& extension) const WARN_UNUSED_RESULT; // Returns true if the file path matches the specified extension. The test is // case insensitive. Don't forget the leading period if appropriate. @@ -274,7 +277,7 @@ class BASE_API FilePath { // Returns a copy of this FilePath that does not end with a trailing // separator. - FilePath StripTrailingSeparators() const; + FilePath StripTrailingSeparators() const WARN_UNUSED_RESULT; // Returns true if this FilePath contains any attempt to reference a parent // directory (i.e. has a path component that is ".." |