| 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/path_output.h" | 5 #include "tools/gn/path_output.h" |
| 6 | 6 |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "tools/gn/filesystem_utils.h" | 9 #include "tools/gn/filesystem_utils.h" |
| 10 #include "tools/gn/output_file.h" | 10 #include "tools/gn/output_file.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 } | 76 } |
| 77 | 77 |
| 78 void PathOutput::WriteFiles(std::ostream& out, | 78 void PathOutput::WriteFiles(std::ostream& out, |
| 79 const std::vector<OutputFile>& files) const { | 79 const std::vector<OutputFile>& files) const { |
| 80 for (const auto& file : files) { | 80 for (const auto& file : files) { |
| 81 out << " "; | 81 out << " "; |
| 82 WriteFile(out, file); | 82 WriteFile(out, file); |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 void PathOutput::WriteFiles(std::ostream& out, |
| 87 const UniqueVector<OutputFile>& files) const { |
| 88 for (const auto& file : files) { |
| 89 out << " "; |
| 90 WriteFile(out, file); |
| 91 } |
| 92 } |
| 93 |
| 86 void PathOutput::WriteDir(std::ostream& out, | 94 void PathOutput::WriteDir(std::ostream& out, |
| 87 const OutputFile& file, | 95 const OutputFile& file, |
| 88 DirSlashEnding slash_ending) const { | 96 DirSlashEnding slash_ending) const { |
| 89 DCHECK(file.value().empty() || | 97 DCHECK(file.value().empty() || |
| 90 file.value()[file.value().size() - 1] == '/'); | 98 file.value()[file.value().size() - 1] == '/'); |
| 91 | 99 |
| 92 switch (slash_ending) { | 100 switch (slash_ending) { |
| 93 case DIR_INCLUDE_LAST_SLASH: | 101 case DIR_INCLUDE_LAST_SLASH: |
| 94 EscapeStringToStream(out, file.value(), options_); | 102 EscapeStringToStream(out, file.value(), options_); |
| 95 break; | 103 break; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // it's system-absolute. | 163 // it's system-absolute. |
| 156 #if defined(OS_WIN) | 164 #if defined(OS_WIN) |
| 157 // On Windows, trim the leading slash, since the input for absolute | 165 // On Windows, trim the leading slash, since the input for absolute |
| 158 // paths will look like "/C:/foo/bar.txt". | 166 // paths will look like "/C:/foo/bar.txt". |
| 159 EscapeStringToStream(out, str.substr(1), options_); | 167 EscapeStringToStream(out, str.substr(1), options_); |
| 160 #else | 168 #else |
| 161 EscapeStringToStream(out, str, options_); | 169 EscapeStringToStream(out, str, options_); |
| 162 #endif | 170 #endif |
| 163 } | 171 } |
| 164 } | 172 } |
| OLD | NEW |