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

Side by Side Diff: tools/gn/output_stream.h

Issue 21114002: Add initial prototype for the GN meta-buildsystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add owners and readme Created 7 years, 4 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/output_file.h ('k') | tools/gn/parse_tree.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef TOOLS_GN_OUTPUT_STREAM_H_
6 #define TOOLS_GN_OUTPUT_STREAM_H_
7
8 class OutputStream {
9 public:
10
11
12
13 OutputStream& WriteBuffer(const char* buf, size_t len);
14 OutputStream& WriteInt(int i);
15
16 // Write a literal.
17 // This template expansion prevents having to look for nulls.
18 template<size_t size> OutputStream& Write(const char (&buf)[size]) {
19 return WriteBuffer(buf, size);
20 }
21
22 // Write a literal string.
23 OutputStream& Write(const std::string& str) {
24 return WriteBuffer(str.c_str(), str.size());
25 }
26
27 // Quotes if necessary, and does necessary escaping. If more than one
28 // input is provided, the results will be concatenated together (useful
29 // for constructing paths without a temporary buffer).
30 OutputStream& WritePath(const std::string& s);
31 OutputStream& WritePath(const std::string& s0,
32 const std::string& s1);
33 OutputStream& WritePath(const std::string& s0,
34 const std::string& s1,
35 const std::string& s2);
36
37 OutputStream& EndLine() {
38 return WriteBuffer("\n", 1);
39 }
40 };
41
42 #endif // TOOLS_GN_OUTPUT_STREAM_H_
OLDNEW
« no previous file with comments | « tools/gn/output_file.h ('k') | tools/gn/parse_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698