1 // Copyright 2019 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_GENERAL_TOOL_H_ 6 #define TOOLS_GN_GENERAL_TOOL_H_ 7 8 #include <string> 9 10 #include "base/logging.h" 11 #include "base/macros.h" 12 #include "gn/label.h" 13 #include "gn/label_ptr.h" 14 #include "gn/substitution_list.h" 15 #include "gn/substitution_pattern.h" 16 #include "gn/tool.h" 17 18 class GeneralTool : public Tool { 19 public: 20 // General tools 21 static const char* kGeneralToolStamp; 22 static const char* kGeneralToolCopy; 23 static const char* kGeneralToolAction; 24 25 // Platform-specific tools 26 static const char* kGeneralToolCopyBundleData; 27 static const char* kGeneralToolCompileXCAssets; 28 29 GeneralTool(const char* n); 30 ~GeneralTool(); 31 32 // Manual RTTI and required functions --------------------------------------- 33 34 bool InitTool(Scope* block_scope, Toolchain* toolchain, Err* err); 35 bool ValidateName(const char* name) const override; 36 void SetComplete() override; 37 bool ValidateSubstitution(const Substitution* sub_type) const override; 38 39 GeneralTool* AsGeneral() override; 40 const GeneralTool* AsGeneral() const override; 41 42 private: 43 DISALLOW_COPY_AND_ASSIGN(GeneralTool); 44 }; 45 46 #endif // TOOLS_GN_GENERAL_TOOL_H_ 47