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

Unified Diff: tools/gn/path_output.cc

Issue 406453002: Hook up symbol files to the Windows GN build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/path_output.h ('k') | tools/gn/path_output_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/path_output.cc
diff --git a/tools/gn/path_output.cc b/tools/gn/path_output.cc
index 7e739b6edc433d03268d6f1fb8accab3d891ac3a..dc142b7ed918aa805e4fc98d0f48e4cc6516006b 100644
--- a/tools/gn/path_output.cc
+++ b/tools/gn/path_output.cc
@@ -75,6 +75,32 @@ void PathOutput::WriteFile(std::ostream& out, const OutputFile& file) const {
EscapeStringToStream(out, file.value(), options_);
}
+void PathOutput::WriteDir(std::ostream& out,
+ const OutputFile& file,
+ DirSlashEnding slash_ending) const {
+ DCHECK(file.value().empty() ||
+ file.value()[file.value().size() - 1] == '/');
+
+ switch (slash_ending) {
+ case DIR_INCLUDE_LAST_SLASH:
+ EscapeStringToStream(out, file.value(), options_);
+ break;
+ case DIR_NO_LAST_SLASH:
+ if (!file.value().empty() &&
+ file.value()[file.value().size() - 1] == '/') {
+ // Trim trailing slash.
+ EscapeStringToStream(
+ out,
+ base::StringPiece(file.value().data(), file.value().size() - 1),
+ options_);
+ } else {
+ // Doesn't end with a slash, write the whole thing.
+ EscapeStringToStream(out, file.value(), options_);
+ }
+ break;
+ }
+}
+
void PathOutput::WriteFile(std::ostream& out,
const base::FilePath& file) const {
// Assume native file paths are always absolute.
« no previous file with comments | « tools/gn/path_output.h ('k') | tools/gn/path_output_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698