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