OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |