Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: base/file_util.h

Issue 9167004: Match whole path components in DevicePathToDriveLetterPath(). Add tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rev Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file contains utility functions for dealing with the local 5 // This file contains utility functions for dealing with the local
6 // filesystem. 6 // filesystem.
7 7
8 #ifndef BASE_FILE_UTIL_H_ 8 #ifndef BASE_FILE_UTIL_H_
9 #define BASE_FILE_UTIL_H_ 9 #define BASE_FILE_UTIL_H_
10 #pragma once 10 #pragma once
11 11
(...skipping 23 matching lines...) Expand all
35 #if defined(OS_POSIX) 35 #if defined(OS_POSIX)
36 #include "base/eintr_wrapper.h" 36 #include "base/eintr_wrapper.h"
37 #include "base/file_descriptor_posix.h" 37 #include "base/file_descriptor_posix.h"
38 #include "base/logging.h" 38 #include "base/logging.h"
39 #endif 39 #endif
40 40
41 namespace base { 41 namespace base {
42 class Time; 42 class Time;
43 } 43 }
44 44
45 #if defined (OS_WIN)
46 namespace base {
47 namespace win {
48 class WinApiInterface;
49 }
50 }
51 #endif // defined (OS_WIN)
52
45 namespace file_util { 53 namespace file_util {
46 54
55 #if defined (OS_WIN)
56 bool DevicePathToDriveLetterPath(base::win::WinApiInterface& win_api,
rvargas (doing something else) 2012/01/11 22:26:26 If we put it here so that it has to be accessed by
57 const FilePath& device_path,
58 FilePath* out_drive_letter_path);
59 #endif
60
47 //----------------------------------------------------------------------------- 61 //-----------------------------------------------------------------------------
48 // Functions that operate purely on a path string w/o touching the filesystem: 62 // Functions that operate purely on a path string w/o touching the filesystem:
49 63
50 // Returns true if the given path ends with a path separator character. 64 // Returns true if the given path ends with a path separator character.
51 BASE_EXPORT bool EndsWithSeparator(const FilePath& path); 65 BASE_EXPORT bool EndsWithSeparator(const FilePath& path);
52 66
53 // Makes sure that |path| ends with a separator IFF path is a directory that 67 // Makes sure that |path| ends with a separator IFF path is a directory that
54 // exists. Returns true if |path| is an existing directory, false otherwise. 68 // exists. Returns true if |path| is an existing directory, false otherwise.
55 BASE_EXPORT bool EnsureEndsWithSeparator(FilePath* path); 69 BASE_EXPORT bool EnsureEndsWithSeparator(FilePath* path);
56 70
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 BASE_EXPORT bool GetFileSystemType(const FilePath& path, FileSystemType* type); 645 BASE_EXPORT bool GetFileSystemType(const FilePath& path, FileSystemType* type);
632 #endif 646 #endif
633 647
634 } // namespace file_util 648 } // namespace file_util
635 649
636 // Deprecated functions have been moved to this separate header file, 650 // Deprecated functions have been moved to this separate header file,
637 // which must be included last after all the above definitions. 651 // which must be included last after all the above definitions.
638 #include "base/file_util_deprecated.h" 652 #include "base/file_util_deprecated.h"
639 653
640 #endif // BASE_FILE_UTIL_H_ 654 #endif // BASE_FILE_UTIL_H_
OLDNEW
« no previous file with comments | « base/base.gypi ('k') | base/file_util_unittest.cc » ('j') | base/file_util_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698