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_MACOSX) |
8 #include <CoreServices/CoreServices.h> | 8 #include <CoreServices/CoreServices.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 | 1117 |
1118 std::vector<FilePath::StringType>::const_iterator it = components.begin(); | 1118 std::vector<FilePath::StringType>::const_iterator it = components.begin(); |
1119 for (; it != components.end(); ++it) { | 1119 for (; it != components.end(); ++it) { |
1120 const FilePath::StringType& component = *it; | 1120 const FilePath::StringType& component = *it; |
1121 if (component == kParentDirectory) | 1121 if (component == kParentDirectory) |
1122 return true; | 1122 return true; |
1123 } | 1123 } |
1124 return false; | 1124 return false; |
1125 } | 1125 } |
1126 | 1126 |
| 1127 #if defined(FILE_PATH_USES_WIN_SEPARATORS) |
| 1128 FilePath FilePath::NormalizeWindowsPathSeparators() const { |
| 1129 StringType copy = path_; |
| 1130 for (size_t i = 1; i < arraysize(kSeparators); ++i) { |
| 1131 std::replace(copy.begin(), copy.end(), kSeparators[i], kSeparators[0]); |
| 1132 } |
| 1133 return FilePath(copy); |
| 1134 } |
| 1135 #endif |
OLD | NEW |