OLD | NEW |
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_MACOSX) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> |
| 9 #elif defined(OS_MACOSX) |
8 #include <CoreServices/CoreServices.h> | 10 #include <CoreServices/CoreServices.h> |
9 #endif | 11 #endif |
10 | 12 |
11 #include "base/logging.h" | 13 #include "base/logging.h" |
12 #include "base/pickle.h" | 14 #include "base/pickle.h" |
13 | 15 |
14 // These includes are just for the *Hack functions, and should be removed | 16 // These includes are just for the *Hack functions, and should be removed |
15 // when those functions are removed. | 17 // when those functions are removed. |
16 #include "base/string_piece.h" | 18 #include "base/string_piece.h" |
17 #include "base/string_util.h" | 19 #include "base/string_util.h" |
18 #include "base/sys_string_conversions.h" | 20 #include "base/sys_string_conversions.h" |
19 #include "base/utf_string_conversions.h" | 21 #include "base/utf_string_conversions.h" |
20 | 22 |
21 #if defined(OS_MACOSX) | 23 #if defined(OS_MACOSX) |
22 #include "base/scoped_cftyperef.h" | 24 #include "base/scoped_cftyperef.h" |
23 #include "base/third_party/icu/icu_utf.h" | 25 #include "base/third_party/icu/icu_utf.h" |
24 #endif | 26 #endif |
25 #if defined(OS_WIN) | |
26 #include "base/win_util.h" | |
27 #endif | |
28 | 27 |
29 #if defined(FILE_PATH_USES_WIN_SEPARATORS) | 28 #if defined(FILE_PATH_USES_WIN_SEPARATORS) |
30 const FilePath::CharType FilePath::kSeparators[] = FILE_PATH_LITERAL("\\/"); | 29 const FilePath::CharType FilePath::kSeparators[] = FILE_PATH_LITERAL("\\/"); |
31 #else // FILE_PATH_USES_WIN_SEPARATORS | 30 #else // FILE_PATH_USES_WIN_SEPARATORS |
32 const FilePath::CharType FilePath::kSeparators[] = FILE_PATH_LITERAL("/"); | 31 const FilePath::CharType FilePath::kSeparators[] = FILE_PATH_LITERAL("/"); |
33 #endif // FILE_PATH_USES_WIN_SEPARATORS | 32 #endif // FILE_PATH_USES_WIN_SEPARATORS |
34 | 33 |
35 const FilePath::CharType FilePath::kCurrentDirectory[] = FILE_PATH_LITERAL("."); | 34 const FilePath::CharType FilePath::kCurrentDirectory[] = FILE_PATH_LITERAL("."); |
36 const FilePath::CharType FilePath::kParentDirectory[] = FILE_PATH_LITERAL(".."); | 35 const FilePath::CharType FilePath::kParentDirectory[] = FILE_PATH_LITERAL(".."); |
37 | 36 |
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1184 | 1183 |
1185 #if defined(FILE_PATH_USES_WIN_SEPARATORS) | 1184 #if defined(FILE_PATH_USES_WIN_SEPARATORS) |
1186 FilePath FilePath::NormalizeWindowsPathSeparators() const { | 1185 FilePath FilePath::NormalizeWindowsPathSeparators() const { |
1187 StringType copy = path_; | 1186 StringType copy = path_; |
1188 for (size_t i = 1; i < arraysize(kSeparators); ++i) { | 1187 for (size_t i = 1; i < arraysize(kSeparators); ++i) { |
1189 std::replace(copy.begin(), copy.end(), kSeparators[i], kSeparators[0]); | 1188 std::replace(copy.begin(), copy.end(), kSeparators[i], kSeparators[0]); |
1190 } | 1189 } |
1191 return FilePath(copy); | 1190 return FilePath(copy); |
1192 } | 1191 } |
1193 #endif | 1192 #endif |
OLD | NEW |