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

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

Issue 177923007: Move AppendFile and *CurrentDirectory to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « net/url_request/url_request_unittest.cc ('k') | tools/gn/function_exec_script.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/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 659
660 for (size_t i = initial_path_comp_to_use; i < path_comp.size(); i++) { 660 for (size_t i = initial_path_comp_to_use; i < path_comp.size(); i++) {
661 result_str.append(FilePathToUTF8(path_comp[i])); 661 result_str.append(FilePathToUTF8(path_comp[i]));
662 result_str.push_back('/'); 662 result_str.push_back('/');
663 } 663 }
664 return SourceDir(result_str); 664 return SourceDir(result_str);
665 } 665 }
666 666
667 SourceDir SourceDirForCurrentDirectory(const base::FilePath& source_root) { 667 SourceDir SourceDirForCurrentDirectory(const base::FilePath& source_root) {
668 base::FilePath cd; 668 base::FilePath cd;
669 file_util::GetCurrentDirectory(&cd); 669 base::GetCurrentDirectory(&cd);
670 return SourceDirForPath(source_root, cd); 670 return SourceDirForPath(source_root, cd);
671 } 671 }
672 672
673 SourceDir GetToolchainOutputDir(const Settings* settings) { 673 SourceDir GetToolchainOutputDir(const Settings* settings) {
674 const OutputFile& toolchain_subdir = settings->toolchain_output_subdir(); 674 const OutputFile& toolchain_subdir = settings->toolchain_output_subdir();
675 675
676 std::string result = settings->build_settings()->build_dir().value(); 676 std::string result = settings->build_settings()->build_dir().value();
677 if (!toolchain_subdir.value().empty()) 677 if (!toolchain_subdir.value().empty())
678 result.append(toolchain_subdir.value()); 678 result.append(toolchain_subdir.value());
679 679
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 return GetGenDirForSourceDir(target->settings(), target->label().dir()); 730 return GetGenDirForSourceDir(target->settings(), target->label().dir());
731 } 731 }
732 732
733 SourceDir GetCurrentOutputDir(const Scope* scope) { 733 SourceDir GetCurrentOutputDir(const Scope* scope) {
734 return GetOutputDirForSourceDir(scope->settings(), scope->GetSourceDir()); 734 return GetOutputDirForSourceDir(scope->settings(), scope->GetSourceDir());
735 } 735 }
736 736
737 SourceDir GetCurrentGenDir(const Scope* scope) { 737 SourceDir GetCurrentGenDir(const Scope* scope) {
738 return GetGenDirForSourceDir(scope->settings(), scope->GetSourceDir()); 738 return GetGenDirForSourceDir(scope->settings(), scope->GetSourceDir());
739 } 739 }
OLDNEW
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | tools/gn/function_exec_script.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698