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

Side by Side Diff: base/file_path.cc

Issue 5754002: Moving away from shell api to support long path names on windows for filesystem. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "base/file_path.h" 5 #include "base/file_path.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #elif defined(OS_MACOSX) 9 #elif defined(OS_MACOSX)
10 #include <CoreFoundation/CoreFoundation.h> 10 #include <CoreFoundation/CoreFoundation.h>
(...skipping 16 matching lines...) Expand all
27 27
28 #if defined(FILE_PATH_USES_WIN_SEPARATORS) 28 #if defined(FILE_PATH_USES_WIN_SEPARATORS)
29 const FilePath::CharType FilePath::kSeparators[] = FILE_PATH_LITERAL("\\/"); 29 const FilePath::CharType FilePath::kSeparators[] = FILE_PATH_LITERAL("\\/");
30 #else // FILE_PATH_USES_WIN_SEPARATORS 30 #else // FILE_PATH_USES_WIN_SEPARATORS
31 const FilePath::CharType FilePath::kSeparators[] = FILE_PATH_LITERAL("/"); 31 const FilePath::CharType FilePath::kSeparators[] = FILE_PATH_LITERAL("/");
32 #endif // FILE_PATH_USES_WIN_SEPARATORS 32 #endif // FILE_PATH_USES_WIN_SEPARATORS
33 33
34 const FilePath::CharType FilePath::kCurrentDirectory[] = FILE_PATH_LITERAL("."); 34 const FilePath::CharType FilePath::kCurrentDirectory[] = FILE_PATH_LITERAL(".");
35 const FilePath::CharType FilePath::kParentDirectory[] = FILE_PATH_LITERAL(".."); 35 const FilePath::CharType FilePath::kParentDirectory[] = FILE_PATH_LITERAL("..");
36 36
37 #if defined(OS_WIN)
38 const FilePath::CharType FilePath::kExtendedPathPrefix[] = FILE_PATH_LITERAL(
39 "\\\\?\\");
Mark Mentovai 2010/12/17 01:58:49 This is wrapped poorly. Wrap after the =, so FILE_
40 #endif
41
37 const FilePath::CharType FilePath::kExtensionSeparator = FILE_PATH_LITERAL('.'); 42 const FilePath::CharType FilePath::kExtensionSeparator = FILE_PATH_LITERAL('.');
38 43
39 typedef FilePath::StringType StringType; 44 typedef FilePath::StringType StringType;
40 45
41 namespace { 46 namespace {
42 47
43 const char* kCommonDoubleExtensions[] = { "gz", "z", "bz2" }; 48 const char* kCommonDoubleExtensions[] = { "gz", "z", "bz2" };
44 49
45 // If this FilePath contains a drive letter specification, returns the 50 // If this FilePath contains a drive letter specification, returns the
46 // position of the last character of the drive letter specification, 51 // position of the last character of the drive letter specification,
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 1188
1184 #if defined(FILE_PATH_USES_WIN_SEPARATORS) 1189 #if defined(FILE_PATH_USES_WIN_SEPARATORS)
1185 FilePath FilePath::NormalizeWindowsPathSeparators() const { 1190 FilePath FilePath::NormalizeWindowsPathSeparators() const {
1186 StringType copy = path_; 1191 StringType copy = path_;
1187 for (size_t i = 1; i < arraysize(kSeparators); ++i) { 1192 for (size_t i = 1; i < arraysize(kSeparators); ++i) {
1188 std::replace(copy.begin(), copy.end(), kSeparators[i], kSeparators[0]); 1193 std::replace(copy.begin(), copy.end(), kSeparators[i], kSeparators[0]);
1189 } 1194 }
1190 return FilePath(copy); 1195 return FilePath(copy);
1191 } 1196 }
1192 #endif 1197 #endif
1198
1199 #if defined(OS_WIN)
1200 bool FilePath::StartsWithExtendedPathPrefix() const {
1201 return StartsWith(path_, kExtendedPathPrefix, false);
1202 }
1203 #endif
OLDNEW
« no previous file with comments | « base/file_path.h ('k') | base/file_path_unittest.cc » ('j') | base/file_util_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698