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

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

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to 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 | « tools/gn/function_write_file.cc ('k') | tools/gn/ninja_target_writer.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/gyp_target_writer.h" 5 #include "tools/gn/gyp_target_writer.h"
6 6
7 #include <iostream> 7 #include <iostream>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 break; 95 break;
96 } 96 }
97 default: 97 default:
98 CHECK(0); 98 CHECK(0);
99 } 99 }
100 } 100 }
101 101
102 file << " ],\n}\n"; 102 file << " ],\n}\n";
103 103
104 std::string contents = file.str(); 104 std::string contents = file.str();
105 file_util::WriteFile(gyp_file_path, contents.c_str(), 105 base::WriteFile(gyp_file_path, contents.c_str(),
106 static_cast<int>(contents.size())); 106 static_cast<int>(contents.size()));
107 } 107 }
108 108
109 std::ostream& GypTargetWriter::Indent(int spaces) { 109 std::ostream& GypTargetWriter::Indent(int spaces) {
110 return Indent(out_, spaces); 110 return Indent(out_, spaces);
111 } 111 }
112 112
113 // static 113 // static
114 std::ostream& GypTargetWriter::Indent(std::ostream& out, int spaces) { 114 std::ostream& GypTargetWriter::Indent(std::ostream& out, int spaces) {
115 const char kSpaces[81] = 115 const char kSpaces[81] =
116 " " 116 " "
117 " "; 117 " ";
118 CHECK(static_cast<size_t>(spaces) <= arraysize(kSpaces) - 1); 118 CHECK(static_cast<size_t>(spaces) <= arraysize(kSpaces) - 1);
119 out.write(kSpaces, spaces); 119 out.write(kSpaces, spaces);
120 return out; 120 return out;
121 } 121 }
OLDNEW
« no previous file with comments | « tools/gn/function_write_file.cc ('k') | tools/gn/ninja_target_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698