From c20a3823a2eafdb40a9db3519e503269689bac14 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Thu, 25 Apr 2019 15:45:12 +0200 Subject: C# bindings generator cleanup - Normal log messages are no longer warnings. - BindingsGenerator is no longer a singleton. - Added a log function. --- modules/mono/editor/bindings_generator.h | 33 +++++++++++++------------------- 1 file changed, 13 insertions(+), 20 deletions(-) (limited to 'modules/mono/editor/bindings_generator.h') diff --git a/modules/mono/editor/bindings_generator.h b/modules/mono/editor/bindings_generator.h index a073c09910..7599c6edee 100644 --- a/modules/mono/editor/bindings_generator.h +++ b/modules/mono/editor/bindings_generator.h @@ -164,7 +164,6 @@ class BindingsGenerator { } MethodInterface() { - return_type.cname = BindingsGenerator::get_singleton()->name_cache.type_void; is_vararg = false; is_virtual = false; requires_object_call = false; @@ -469,7 +468,7 @@ class BindingsGenerator { } }; - static bool verbose_output; + bool log_print_enabled; OrderedHashMap obj_types; @@ -515,6 +514,7 @@ class BindingsGenerator { enum_Error = StaticCString::create("Error"); } + private: NameCache(const NameCache &); NameCache &operator=(const NameCache &); }; @@ -578,33 +578,26 @@ class BindingsGenerator { Error _save_file(const String &p_path, const StringBuilder &p_content); - BindingsGenerator() {} - - BindingsGenerator(const BindingsGenerator &); - BindingsGenerator &operator=(const BindingsGenerator &); + void _log(const char *p_format, ...) _PRINTF_FORMAT_ATTRIBUTE_2_3; - friend class CSharpLanguage; - static BindingsGenerator *singleton; + void _initialize(); public: - Error generate_cs_core_project(const String &p_solution_dir, DotNetSolution &r_solution, bool p_verbose_output = true); - Error generate_cs_editor_project(const String &p_solution_dir, DotNetSolution &r_solution, bool p_verbose_output = true); - Error generate_cs_api(const String &p_output_dir, bool p_verbose_output = true); + Error generate_cs_core_project(const String &p_solution_dir, DotNetSolution &r_solution); + Error generate_cs_editor_project(const String &p_solution_dir, DotNetSolution &r_solution); + Error generate_cs_api(const String &p_output_dir); Error generate_glue(const String &p_output_dir); + void set_log_print_enabled(bool p_enabled) { log_print_enabled = p_enabled; } + static uint32_t get_version(); - void initialize(); + static void handle_cmdline_args(const List &p_cmdline_args); - _FORCE_INLINE_ static BindingsGenerator *get_singleton() { - if (!singleton) { - singleton = memnew(BindingsGenerator); - singleton->initialize(); - } - return singleton; + BindingsGenerator() : + log_print_enabled(true) { + _initialize(); } - - static void handle_cmdline_args(const List &p_cmdline_args); }; #endif -- cgit v1.2.3