OLD | NEW |
1 // Copyright (c) 2012 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 #include "base/file_path.h" | 5 #include "base/file_path.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "base/mac/scoped_cftyperef.h" | 22 #include "base/mac/scoped_cftyperef.h" |
23 #include "base/third_party/icu/icu_utf.h" | 23 #include "base/third_party/icu/icu_utf.h" |
24 #endif | 24 #endif |
25 | 25 |
26 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
27 #include <windows.h> | 27 #include <windows.h> |
28 #elif defined(OS_MACOSX) | 28 #elif defined(OS_MACOSX) |
29 #include <CoreFoundation/CoreFoundation.h> | 29 #include <CoreFoundation/CoreFoundation.h> |
30 #endif | 30 #endif |
31 | 31 |
32 namespace base { | |
33 | |
34 #if defined(FILE_PATH_USES_WIN_SEPARATORS) | 32 #if defined(FILE_PATH_USES_WIN_SEPARATORS) |
35 const FilePath::CharType FilePath::kSeparators[] = FILE_PATH_LITERAL("\\/"); | 33 const FilePath::CharType FilePath::kSeparators[] = FILE_PATH_LITERAL("\\/"); |
36 #else // FILE_PATH_USES_WIN_SEPARATORS | 34 #else // FILE_PATH_USES_WIN_SEPARATORS |
37 const FilePath::CharType FilePath::kSeparators[] = FILE_PATH_LITERAL("/"); | 35 const FilePath::CharType FilePath::kSeparators[] = FILE_PATH_LITERAL("/"); |
38 #endif // FILE_PATH_USES_WIN_SEPARATORS | 36 #endif // FILE_PATH_USES_WIN_SEPARATORS |
39 | 37 |
40 const FilePath::CharType FilePath::kCurrentDirectory[] = FILE_PATH_LITERAL("."); | 38 const FilePath::CharType FilePath::kCurrentDirectory[] = FILE_PATH_LITERAL("."); |
41 const FilePath::CharType FilePath::kParentDirectory[] = FILE_PATH_LITERAL(".."); | 39 const FilePath::CharType FilePath::kParentDirectory[] = FILE_PATH_LITERAL(".."); |
42 | 40 |
43 const FilePath::CharType FilePath::kExtensionSeparator = FILE_PATH_LITERAL('.'); | 41 const FilePath::CharType FilePath::kExtensionSeparator = FILE_PATH_LITERAL('.'); |
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 } | 1247 } |
1250 return FilePath(copy); | 1248 return FilePath(copy); |
1251 #else | 1249 #else |
1252 return *this; | 1250 return *this; |
1253 #endif | 1251 #endif |
1254 } | 1252 } |
1255 | 1253 |
1256 void PrintTo(const FilePath& path, std::ostream* out) { | 1254 void PrintTo(const FilePath& path, std::ostream* out) { |
1257 *out << path.value(); | 1255 *out << path.value(); |
1258 } | 1256 } |
1259 | |
1260 } // namespace base | |
OLD | NEW |