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

Unified 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, 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/output_file.h ('k') | tools/gn/parse_tree.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/output_stream.h
diff --git a/tools/gn/output_stream.h b/tools/gn/output_stream.h
new file mode 100644
index 0000000000000000000000000000000000000000..6f39c8666120525d4eb99396d2e8737a15d897c5
--- /dev/null
+++ b/tools/gn/output_stream.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef TOOLS_GN_OUTPUT_STREAM_H_
+#define TOOLS_GN_OUTPUT_STREAM_H_
+
+class OutputStream {
+ public:
+
+
+
+ OutputStream& WriteBuffer(const char* buf, size_t len);
+ OutputStream& WriteInt(int i);
+
+ // Write a literal.
+ // This template expansion prevents having to look for nulls.
+ template<size_t size> OutputStream& Write(const char (&buf)[size]) {
+ return WriteBuffer(buf, size);
+ }
+
+ // Write a literal string.
+ OutputStream& Write(const std::string& str) {
+ return WriteBuffer(str.c_str(), str.size());
+ }
+
+ // Quotes if necessary, and does necessary escaping. If more than one
+ // input is provided, the results will be concatenated together (useful
+ // for constructing paths without a temporary buffer).
+ OutputStream& WritePath(const std::string& s);
+ OutputStream& WritePath(const std::string& s0,
+ const std::string& s1);
+ OutputStream& WritePath(const std::string& s0,
+ const std::string& s1,
+ const std::string& s2);
+
+ OutputStream& EndLine() {
+ return WriteBuffer("\n", 1);
+ }
+};
+
+#endif // TOOLS_GN_OUTPUT_STREAM_H_
« 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