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

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

Issue 1200053004: Move more string_util functions to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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_args.cc ('k') | tools/gn/label.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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
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;
97 97
98 // Check colon first, this will generally fail fastest. 98 // Check colon first, this will generally fail fastest.
99 if (path[1] != ':') 99 if (path[1] != ':')
100 return false; 100 return false;
101 101
102 // Check drive letter. 102 // Check drive letter.
103 if (!IsAsciiAlpha(path[0])) 103 if (!base::IsAsciiAlpha(path[0]))
104 return false; 104 return false;
105 105
106 if (!IsSlash(path[2])) 106 if (!IsSlash(path[2]))
107 return false; 107 return false;
108 return true; 108 return true;
109 } 109 }
110 #endif 110 #endif
111 111
112 // A wrapper around FilePath.GetComponents that works the way we need. This is 112 // A wrapper around FilePath.GetComponents that works the way we need. This is
113 // not super efficient since it does some O(n) transformations on the path. If 113 // not super efficient since it does some O(n) transformations on the path. If
(...skipping 699 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 | « tools/gn/command_args.cc ('k') | tools/gn/label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698