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

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

Issue 644433003: Type conversion fixes, tools/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « tools/gn/command_gen.cc ('k') | tools/gn/generate_test_gn_data.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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // Don't use IsSeparator since we always want to allow backslashes. 125 // Don't use IsSeparator since we always want to allow backslashes.
126 if (result[0] == FILE_PATH_LITERAL("/") || 126 if (result[0] == FILE_PATH_LITERAL("/") ||
127 result[0] == FILE_PATH_LITERAL("\\")) 127 result[0] == FILE_PATH_LITERAL("\\"))
128 result.erase(result.begin()); 128 result.erase(result.begin());
129 129
130 #if defined(OS_WIN) 130 #if defined(OS_WIN)
131 // On Windows, GetComponents will give us [ "C:", "/", "foo" ], and we 131 // On Windows, GetComponents will give us [ "C:", "/", "foo" ], and we
132 // don't want the slash in there. This doesn't support input like "C:foo" 132 // don't want the slash in there. This doesn't support input like "C:foo"
133 // which means foo relative to the current directory of the C drive but 133 // which means foo relative to the current directory of the C drive but
134 // that's basically legacy DOS behavior we don't need to support. 134 // that's basically legacy DOS behavior we don't need to support.
135 if (result.size() >= 2 && result[1].size() == 1 && IsSlash(result[1][0])) 135 if (result.size() >= 2 && result[1].size() == 1 &&
136 IsSlash(static_cast<char>(result[1][0])))
136 result.erase(result.begin() + 1); 137 result.erase(result.begin() + 1);
137 #endif 138 #endif
138 139
139 return result; 140 return result;
140 } 141 }
141 142
142 // Provides the equivalent of == for filesystem strings, trying to do 143 // Provides the equivalent of == for filesystem strings, trying to do
143 // approximately the right thing with case. 144 // approximately the right thing with case.
144 bool FilesystemStringsEqual(const base::FilePath::StringType& a, 145 bool FilesystemStringsEqual(const base::FilePath::StringType& a,
145 const base::FilePath::StringType& b) { 146 const base::FilePath::StringType& b) {
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 745
745 SourceDir GetCurrentOutputDir(const Scope* scope) { 746 SourceDir GetCurrentOutputDir(const Scope* scope) {
746 return GetOutputDirForSourceDirAsOutputFile( 747 return GetOutputDirForSourceDirAsOutputFile(
747 scope->settings(), scope->GetSourceDir()).AsSourceDir( 748 scope->settings(), scope->GetSourceDir()).AsSourceDir(
748 scope->settings()->build_settings()); 749 scope->settings()->build_settings());
749 } 750 }
750 751
751 SourceDir GetCurrentGenDir(const Scope* scope) { 752 SourceDir GetCurrentGenDir(const Scope* scope) {
752 return GetGenDirForSourceDir(scope->settings(), scope->GetSourceDir()); 753 return GetGenDirForSourceDir(scope->settings(), scope->GetSourceDir());
753 } 754 }
OLDNEW
« no previous file with comments | « tools/gn/command_gen.cc ('k') | tools/gn/generate_test_gn_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698