• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 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_COMAND_FORMAT_H_
6 #define TOOLS_GN_COMAND_FORMAT_H_
7 
8 #include <string>
9 
10 class Setup;
11 class SourceFile;
12 
13 namespace commands {
14 
15 enum class TreeDumpMode {
16   // Normal operation mode. Format the input file.
17   kInactive,
18 
19   // Output the token tree with indented plain text. For debugging.
20   kPlainText,
21 
22   // Output the token tree in JSON format. Used for exporting a tree to another
23   // program.
24   kJSON
25 };
26 
27 bool FormatJsonToString(const std::string& input, std::string* output);
28 
29 bool FormatStringToString(const std::string& input,
30                           TreeDumpMode dump_tree,
31                           std::string* output,
32                           std::string* dump_output);
33 
34 }  // namespace commands
35 
36 #endif  // TOOLS_GN_COMAND_FORMAT_H_
37