OLD | NEW |
(Empty) | |
| 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_ECLIPSE_WRITER_H_ |
| 6 #define TOOLS_GN_ECLIPSE_WRITER_H_ |
| 7 |
| 8 #include <iosfwd> |
| 9 #include <map> |
| 10 #include <set> |
| 11 #include <string> |
| 12 #include <vector> |
| 13 |
| 14 #include "base/macros.h" |
| 15 |
| 16 class BuildSettings; |
| 17 class Builder; |
| 18 class Err; |
| 19 class Target; |
| 20 |
| 21 class EclipseWriter { |
| 22 public: |
| 23 static bool RunAndWriteFile(const BuildSettings* build_settings, |
| 24 const Builder* builder, |
| 25 Err* err); |
| 26 |
| 27 private: |
| 28 EclipseWriter(const BuildSettings* build_settings, |
| 29 const Builder* builder, |
| 30 std::ostream& out); |
| 31 ~EclipseWriter(); |
| 32 |
| 33 void Run(); |
| 34 |
| 35 // Populates |include_dirs_| with the include dirs of all the targets for the |
| 36 // default toolchain. |
| 37 void GetAllIncludeDirs(); |
| 38 |
| 39 // Populates |defines_| with the defines of all the targets for the default |
| 40 // toolchain. |
| 41 void GetAllDefines(); |
| 42 |
| 43 // Returns true if |target| uses the default toolchain. |
| 44 bool UsesDefaultToolchain(const Target* target) const; |
| 45 |
| 46 // Writes the XML settings file. |
| 47 void WriteCDTSettings(); |
| 48 |
| 49 const BuildSettings* build_settings_; |
| 50 const Builder* builder_; |
| 51 |
| 52 // The output stream for the settings file. |
| 53 std::ostream& out_; |
| 54 |
| 55 // Eclipse languages for which the include dirs and defines apply. |
| 56 std::vector<std::string> languages_; |
| 57 |
| 58 // The include dirs of all the targets which use the default toolchain. |
| 59 std::set<std::string> include_dirs_; |
| 60 |
| 61 // The defines of all the targets which use the default toolchain. |
| 62 std::map<std::string, std::string> defines_; |
| 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(EclipseWriter); |
| 65 }; |
| 66 |
| 67 #endif // TOOLS_GN_ECLIPSE_WRITER_H_ |
OLD | NEW |