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

Side by Side Diff: base/file_path.cc

Issue 6759017: iwyu: Cleanup in the following files: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Copyright again. Created 9 years, 8 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
« no previous file with comments | « base/file_path.h ('k') | chrome/common/switch_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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"
6
7 #include <string.h>
5 #include <algorithm> 8 #include <algorithm>
6 9
7 #include "base/file_path.h" 10 #include "base/basictypes.h"
8
9 #if defined(OS_WIN)
10 #include <windows.h>
11 #elif defined(OS_MACOSX)
12 #include <CoreFoundation/CoreFoundation.h>
13 #endif
14
15 #include "base/logging.h" 11 #include "base/logging.h"
16 #include "base/pickle.h" 12 #include "base/pickle.h"
17 13
18 // These includes are just for the *Hack functions, and should be removed 14 // These includes are just for the *Hack functions, and should be removed
19 // when those functions are removed. 15 // when those functions are removed.
20 #include "base/string_piece.h" 16 #include "base/string_piece.h"
21 #include "base/string_util.h" 17 #include "base/string_util.h"
22 #include "base/sys_string_conversions.h" 18 #include "base/sys_string_conversions.h"
23 #include "base/utf_string_conversions.h" 19 #include "base/utf_string_conversions.h"
24 20
25 #if defined(OS_MACOSX) 21 #if defined(OS_MACOSX)
26 #include "base/mac/scoped_cftyperef.h" 22 #include "base/mac/scoped_cftyperef.h"
27 #include "base/third_party/icu/icu_utf.h" 23 #include "base/third_party/icu/icu_utf.h"
28 #endif 24 #endif
29 25
26 #if defined(OS_WIN)
27 #include <windows.h>
28 #elif defined(OS_MACOSX)
29 #include <CoreFoundation/CoreFoundation.h>
30 #endif
31
30 #if defined(FILE_PATH_USES_WIN_SEPARATORS) 32 #if defined(FILE_PATH_USES_WIN_SEPARATORS)
31 const FilePath::CharType FilePath::kSeparators[] = FILE_PATH_LITERAL("\\/"); 33 const FilePath::CharType FilePath::kSeparators[] = FILE_PATH_LITERAL("\\/");
32 #else // FILE_PATH_USES_WIN_SEPARATORS 34 #else // FILE_PATH_USES_WIN_SEPARATORS
33 const FilePath::CharType FilePath::kSeparators[] = FILE_PATH_LITERAL("/"); 35 const FilePath::CharType FilePath::kSeparators[] = FILE_PATH_LITERAL("/");
34 #endif // FILE_PATH_USES_WIN_SEPARATORS 36 #endif // FILE_PATH_USES_WIN_SEPARATORS
35 37
36 const FilePath::CharType FilePath::kCurrentDirectory[] = FILE_PATH_LITERAL("."); 38 const FilePath::CharType FilePath::kCurrentDirectory[] = FILE_PATH_LITERAL(".");
37 const FilePath::CharType FilePath::kParentDirectory[] = FILE_PATH_LITERAL(".."); 39 const FilePath::CharType FilePath::kParentDirectory[] = FILE_PATH_LITERAL("..");
38 40
39 const FilePath::CharType FilePath::kExtensionSeparator = FILE_PATH_LITERAL('.'); 41 const FilePath::CharType FilePath::kExtensionSeparator = FILE_PATH_LITERAL('.');
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 1202
1201 #if defined(FILE_PATH_USES_WIN_SEPARATORS) 1203 #if defined(FILE_PATH_USES_WIN_SEPARATORS)
1202 FilePath FilePath::NormalizeWindowsPathSeparators() const { 1204 FilePath FilePath::NormalizeWindowsPathSeparators() const {
1203 StringType copy = path_; 1205 StringType copy = path_;
1204 for (size_t i = 1; i < arraysize(kSeparators); ++i) { 1206 for (size_t i = 1; i < arraysize(kSeparators); ++i) {
1205 std::replace(copy.begin(), copy.end(), kSeparators[i], kSeparators[0]); 1207 std::replace(copy.begin(), copy.end(), kSeparators[i], kSeparators[0]);
1206 } 1208 }
1207 return FilePath(copy); 1209 return FilePath(copy);
1208 } 1210 }
1209 #endif 1211 #endif
OLDNEW
« no previous file with comments | « base/file_path.h ('k') | chrome/common/switch_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698