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/file_path.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'base/file_path.h') diff --git a/base/file_path.h b/base/file_path.h index cb46f36..7dd2a71 100644 --- a/base/file_path.h +++ b/base/file_path.h @@ -145,6 +145,20 @@ class FilePath { // platforms, an absolute path begins with a separator character. bool IsAbsolute() const; + // Older Chromium code assumes that paths are always wstrings. + // This function converts a wstring to a FilePath, and is useful to smooth + // porting that old code to the FilePath API. + // It has "Hack" in its name so people feel bad about using it. + // TODO(port): remove these functions. + static FilePath FromWStringHack(const std::wstring& wstring); + + // Older Chromium code assumes that paths are always wstrings. + // This function produces a wstring from a FilePath, and is useful to smooth + // porting that old code to the FilePath API. + // It has "Hack" in its name so people feel bad about using it. + // TODO(port): remove these functions. + std::wstring ToWStringHack() const; + private: // If this FilePath contains a drive letter specification, returns the // position of the last character of the drive letter specification, -- cgit v1.1