summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-13 00:26:58 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-13 00:26:58 +0000
commit73e2348a1539ca2c18980817474a8cc4235b8be5 (patch)
treea056d32b521a2a9567df058eb55161a65fa27151 /base
parent97341c93880e3e3299d81affcb9eecf5f0b3c520 (diff)
downloadchromium_src-73e2348a1539ca2c18980817474a8cc4235b8be5.zip
chromium_src-73e2348a1539ca2c18980817474a8cc4235b8be5.tar.gz
chromium_src-73e2348a1539ca2c18980817474a8cc4235b8be5.tar.bz2
Reliability test porting: stringy stuff.
No functional change. This gets things compiling on linux, but it still needs some work before it can be run on linux. BUG=19085 Review URL: http://codereview.chromium.org/164352 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23272 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/file_path.cc9
-rw-r--r--base/file_path.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/base/file_path.cc b/base/file_path.cc
index fa93b2a..6134f2b 100644
--- a/base/file_path.cc
+++ b/base/file_path.cc
@@ -310,6 +310,15 @@ FilePath FilePath::InsertBeforeExtension(const StringType& suffix) const {
return FilePath(ret);
}
+FilePath FilePath::InsertBeforeExtensionASCII(const StringPiece& suffix) const {
+ DCHECK(IsStringASCII(suffix));
+#if defined(OS_WIN)
+ return InsertBeforeExtension(ASCIIToWide(suffix));
+#elif defined(OS_POSIX)
+ return InsertBeforeExtension(suffix.as_string());
+#endif
+}
+
FilePath FilePath::ReplaceExtension(const StringType& extension) const {
if (path_.empty())
return FilePath();
diff --git a/base/file_path.h b/base/file_path.h
index 17653d1..3d19c01 100644
--- a/base/file_path.h
+++ b/base/file_path.h
@@ -186,6 +186,7 @@ class FilePath {
// 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 StringPiece& suffix) const;
// Replaces the extension of |file_name| with |extension|. If |file_name|
// does not have an extension, them |extension| is added. If |extension| is