summaryrefslogtreecommitdiffstats
path: root/base/file_util.h
diff options
context:
space:
mode:
authorskerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-17 22:44:31 +0000
committerskerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-17 22:44:31 +0000
commit71b7da7dbd4ed7fa4e28e23a796bd203601613aa (patch)
treed365103619c0a86e56d05eb74c2a121fb4424645 /base/file_util.h
parent3a2630d61cbff2fffff994b9f9bcdb7f9fcc1893 (diff)
downloadchromium_src-71b7da7dbd4ed7fa4e28e23a796bd203601613aa.zip
chromium_src-71b7da7dbd4ed7fa4e28e23a796bd203601613aa.tar.gz
chromium_src-71b7da7dbd4ed7fa4e28e23a796bd203601613aa.tar.bz2
Match whole path components in DevicePathToDriveLetterPath(). Add tests.
+rvargas, who understands the code +brettw, who is in OWNERS BUG=109577 TEST=FileUtilTest.DevicePathToDriveLetter Review URL: http://codereview.chromium.org/9167004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117986 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util.h')
-rw-r--r--base/file_util.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/base/file_util.h b/base/file_util.h
index 78827e9..384f394 100644
--- a/base/file_util.h
+++ b/base/file_util.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -324,10 +324,17 @@ BASE_EXPORT bool IsDotDot(const FilePath& path);
BASE_EXPORT bool NormalizeFilePath(const FilePath& path, FilePath* real_path);
#if defined(OS_WIN)
-// Given an existing file in |path|, it returns in |real_path| the path
-// in the native NT format, of the form "\Device\HarddiskVolumeXX\..".
-// Returns false it it fails. Empty files cannot be resolved with this
-// function.
+
+// Given a path in NT native form ("\Device\HarddiskVolumeXX\..."),
+// return in |drive_letter_path| the equivalent path that starts with
+// a drive letter ("C:\..."). Return false if no such path exists.
+BASE_EXPORT bool DevicePathToDriveLetterPath(const FilePath& device_path,
+ FilePath* drive_letter_path);
+
+// Given an existing file in |path|, set |real_path| to the path
+// in native NT format, of the form "\Device\HarddiskVolumeXX\..".
+// Returns false if the path can not be found. Empty files cannot
+// be resolved with this function.
BASE_EXPORT bool NormalizeToNativeFilePath(const FilePath& path,
FilePath* nt_path);
#endif