From 640517fdd23e08ed95cf129d27457db817ee6124 Mon Sep 17 00:00:00 2001 From: "evanm@google.com" Date: Thu, 30 Oct 2008 23:54:04 +0000 Subject: Begin the first small step towards using FilePath everywhere: - Add some transition APIs. - Start migrating some code to transition APIs. Review URL: http://codereview.chromium.org/8825 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4254 0039d316-1c4b-4281-b951-d872f2087c98 --- base/base_paths.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'base/base_paths.cc') diff --git a/base/base_paths.cc b/base/base_paths.cc index f3b3f98..672bde1 100644 --- a/base/base_paths.cc +++ b/base/base_paths.cc @@ -4,6 +4,7 @@ #include "base/base_paths.h" +#include "base/file_path.h" #include "base/file_util.h" #include "base/path_service.h" @@ -12,15 +13,15 @@ namespace base { bool PathProvider(int key, std::wstring* result) { // NOTE: DIR_CURRENT is a special cased in PathService::Get - std::wstring cur; + FilePath cur; switch (key) { case base::DIR_EXE: PathService::Get(base::FILE_EXE, &cur); - file_util::TrimFilename(&cur); + cur = cur.DirName(); break; case base::DIR_MODULE: PathService::Get(base::FILE_MODULE, &cur); - file_util::TrimFilename(&cur); + cur = cur.DirName(); break; case base::DIR_TEMP: if (!file_util::GetTempDir(&cur)) @@ -30,7 +31,7 @@ bool PathProvider(int key, std::wstring* result) { return false; } - result->swap(cur); + *result = cur.ToWStringHack(); return true; } -- cgit v1.1