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

Side by Side Diff: tools/gn/filesystem_utils.cc

Issue 1224553010: Replace base::str[n]casecmp with helper functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « sql/connection.cc ('k') | ui/base/l10n/l10n_util.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "tools/gn/filesystem_utils.h" 5 #include "tools/gn/filesystem_utils.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 // Attempts to do a case and slash-insensitive comparison of two 8-bit Windows 78 // Attempts to do a case and slash-insensitive comparison of two 8-bit Windows
79 // paths. 79 // paths.
80 bool AreAbsoluteWindowsPathsEqual(const base::StringPiece& a, 80 bool AreAbsoluteWindowsPathsEqual(const base::StringPiece& a,
81 const base::StringPiece& b) { 81 const base::StringPiece& b) {
82 if (a.size() != b.size()) 82 if (a.size() != b.size())
83 return false; 83 return false;
84 84
85 // For now, just do a case-insensitive ASCII comparison. We could convert to 85 // For now, just do a case-insensitive ASCII comparison. We could convert to
86 // UTF-16 and use ICU if necessary. Or maybe base::strcasecmp is good enough? 86 // UTF-16 and use ICU if necessary.
87 for (size_t i = 0; i < a.size(); i++) { 87 for (size_t i = 0; i < a.size(); i++) {
88 if (NormalizeWindowsPathChar(a[i]) != NormalizeWindowsPathChar(b[i])) 88 if (NormalizeWindowsPathChar(a[i]) != NormalizeWindowsPathChar(b[i]))
89 return false; 89 return false;
90 } 90 }
91 return true; 91 return true;
92 } 92 }
93 93
94 bool DoesBeginWindowsDriveLetter(const base::StringPiece& path) { 94 bool DoesBeginWindowsDriveLetter(const base::StringPiece& path) {
95 if (path.size() < 3) 95 if (path.size() < 3)
96 return false; 96 return false;
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 813
814 SourceDir GetCurrentOutputDir(const Scope* scope) { 814 SourceDir GetCurrentOutputDir(const Scope* scope) {
815 return GetOutputDirForSourceDirAsOutputFile( 815 return GetOutputDirForSourceDirAsOutputFile(
816 scope->settings(), scope->GetSourceDir()).AsSourceDir( 816 scope->settings(), scope->GetSourceDir()).AsSourceDir(
817 scope->settings()->build_settings()); 817 scope->settings()->build_settings());
818 } 818 }
819 819
820 SourceDir GetCurrentGenDir(const Scope* scope) { 820 SourceDir GetCurrentGenDir(const Scope* scope) {
821 return GetGenDirForSourceDir(scope->settings(), scope->GetSourceDir()); 821 return GetGenDirForSourceDir(scope->settings(), scope->GetSourceDir());
822 } 822 }
OLDNEW
« no previous file with comments | « sql/connection.cc ('k') | ui/base/l10n/l10n_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698