summaryrefslogtreecommitdiffstats
path: root/base/file_util.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-04 20:46:06 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-04 20:46:06 +0000
commitceeb87e90224c8743995b999661eede7c31b6346 (patch)
tree459f0698b022e42ead17cb742be9ff7f9d1b441f /base/file_util.h
parentf3208bd4c625527d854c3bf49908352199488c48 (diff)
downloadchromium_src-ceeb87e90224c8743995b999661eede7c31b6346.zip
chromium_src-ceeb87e90224c8743995b999661eede7c31b6346.tar.gz
chromium_src-ceeb87e90224c8743995b999661eede7c31b6346.tar.bz2
Get rid of kPathSeparator on windows. Port some wstring function to take FilePaths. Re-enable relevant posix unit tests.
Review URL: http://codereview.chromium.org/12893 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6387 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util.h')
-rw-r--r--base/file_util.h22
1 files changed, 8 insertions, 14 deletions
diff --git a/base/file_util.h b/base/file_util.h
index eebf3af..41bc70b 100644
--- a/base/file_util.h
+++ b/base/file_util.h
@@ -29,16 +29,6 @@
namespace file_util {
//-----------------------------------------------------------------------------
-// Constants
-
-#if defined(OS_WIN)
-// The use of this constant is deprecated. Instead use file_util or FilePath
-// functions (Append, TrimTrailingSeparator, etc.), or use
-// FilePath::kSeparator[0].
-extern const wchar_t kPathSeparator;
-#endif
-
-//-----------------------------------------------------------------------------
// Functions that operate purely on a path string w/o touching the filesystem:
// Returns a vector of all of the components of the provided path.
@@ -80,6 +70,7 @@ void UpOneDirectoryOrEmpty(std::wstring* dir);
void TrimFilename(std::wstring* path);
// Returns the filename portion of 'path', without any leading \'s or /'s.
+// Deprecated. Use FilePath::BaseName instead.
std::wstring GetFilenameFromPath(const std::wstring& path);
// Returns "jpg" for path "C:\pics\jojo.jpg", or an empty string if
@@ -109,9 +100,6 @@ bool AbsolutePath(FilePath* path);
// Deprecated temporary compatibility function.
bool AbsolutePath(std::wstring* path);
-// TODO(port): create FilePath versions of these functions, and remove this
-// platform define.
-#if defined(OS_WIN)
// Inserts |suffix| after the file name portion of |path| but before the
// extension.
// Examples:
@@ -119,11 +107,17 @@ bool AbsolutePath(std::wstring* path);
// 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)"
-void InsertBeforeExtension(std::wstring* path, const std::wstring& suffix);
+void InsertBeforeExtension(FilePath* path, const FilePath::StringType& suffix);
// 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|.
+void ReplaceExtension(FilePath* file_name,
+ const FilePath::StringType& extension);
+
+#if defined(OS_WIN)
+// Deprecated temporary compatibility functions.
+void InsertBeforeExtension(std::wstring* path, const std::wstring& suffix);
void ReplaceExtension(std::wstring* file_name, const std::wstring& extension);
#endif