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

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

Issue 180743014: Allow the bootstrap binary of GN (the one in TEMPDIR) to build and run on FreeBSD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Submit a clean patch. 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
« no previous file with comments | « tools/gn/bootstrap/bootstrap.py ('k') | tools/gn/filesystem_utils.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 <ostream>
6
5 #include "tools/gn/escape.h" 7 #include "tools/gn/escape.h"
6 8
7 #include "base/containers/stack_container.h" 9 #include "base/containers/stack_container.h"
8 10
9 namespace { 11 namespace {
10 12
11 template<typename DestString> 13 template<typename DestString>
12 void EscapeStringToString(const base::StringPiece& str, 14 void EscapeStringToString(const base::StringPiece& str,
13 const EscapeOptions& options, 15 const EscapeOptions& options,
14 DestString* dest, 16 DestString* dest,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 void EscapeStringToStream(std::ostream& out, 83 void EscapeStringToStream(std::ostream& out,
82 const base::StringPiece& str, 84 const base::StringPiece& str,
83 const EscapeOptions& options) { 85 const EscapeOptions& options) {
84 // Escape to a stack buffer and then write out to the stream. 86 // Escape to a stack buffer and then write out to the stream.
85 base::StackVector<char, 256> result; 87 base::StackVector<char, 256> result;
86 result->reserve(str.size() + 4); // Guess we'll add a couple of extra chars. 88 result->reserve(str.size() + 4); // Guess we'll add a couple of extra chars.
87 EscapeStringToString(str, options, &result.container(), NULL); 89 EscapeStringToString(str, options, &result.container(), NULL);
88 if (!result->empty()) 90 if (!result->empty())
89 out.write(result->data(), result->size()); 91 out.write(result->data(), result->size());
90 } 92 }
OLDNEW
« no previous file with comments | « tools/gn/bootstrap/bootstrap.py ('k') | tools/gn/filesystem_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698