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

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

Issue 26561005: GYP generator for GN (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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/command_gyp.cc ('k') | tools/gn/escape.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 #ifndef TOOLS_GN_ESCAPE_H_ 5 #ifndef TOOLS_GN_ESCAPE_H_
6 #define TOOLS_GN_ESCAPE_H_ 6 #define TOOLS_GN_ESCAPE_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "base/strings/string_piece.h" 10 #include "base/strings/string_piece.h"
11 11
12 enum EscapingMode { 12 enum EscapingMode {
13 // No escaping. 13 // No escaping.
14 ESCAPE_NONE, 14 ESCAPE_NONE,
15 15
16 // Ninja string escaping. 16 // Ninja string escaping.
17 ESCAPE_NINJA = 1, 17 ESCAPE_NINJA = 1,
18 18
19 // Shell string escaping. 19 // Shell string escaping.
20 ESCAPE_SHELL = 2, 20 ESCAPE_SHELL = 2,
21 21
22 // For writing shell commands to ninja files. 22 // For writing shell commands to ninja files.
23 ESCAPE_NINJA_SHELL = ESCAPE_NINJA | ESCAPE_SHELL 23 ESCAPE_NINJA_SHELL = ESCAPE_NINJA | ESCAPE_SHELL,
24
25 ESCAPE_JSON = 4,
24 }; 26 };
25 27
26 struct EscapeOptions { 28 struct EscapeOptions {
27 EscapeOptions() 29 EscapeOptions()
28 : mode(ESCAPE_NONE), 30 : mode(ESCAPE_NONE),
29 convert_slashes(false), 31 convert_slashes(false),
30 inhibit_quoting(false) { 32 inhibit_quoting(false) {
31 } 33 }
32 34
33 EscapingMode mode; 35 EscapingMode mode;
(...skipping 20 matching lines...) Expand all
54 const EscapeOptions& options, 56 const EscapeOptions& options,
55 bool* needed_quoting); 57 bool* needed_quoting);
56 58
57 // Same as EscapeString but writes the results to the given stream, saving a 59 // Same as EscapeString but writes the results to the given stream, saving a
58 // copy. 60 // copy.
59 void EscapeStringToStream(std::ostream& out, 61 void EscapeStringToStream(std::ostream& out,
60 const base::StringPiece& str, 62 const base::StringPiece& str,
61 const EscapeOptions& options); 63 const EscapeOptions& options);
62 64
63 #endif // TOOLS_GN_ESCAPE_H_ 65 #endif // TOOLS_GN_ESCAPE_H_
OLDNEW
« no previous file with comments | « tools/gn/command_gyp.cc ('k') | tools/gn/escape.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698