Path: blob/master/modules/gdscript/gdscript_utility_functions.h
10277 views
/**************************************************************************/1/* gdscript_utility_functions.h */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#pragma once3132#include "core/string/string_name.h"33#include "core/variant/variant.h"3435template <typename T>36class TypedArray;3738class GDScriptUtilityFunctions {39public:40typedef void (*FunctionPtr)(Variant *r_ret, const Variant **p_args, int p_arg_count, Callable::CallError &r_error);4142static FunctionPtr get_function(const StringName &p_function);43static bool has_function_return_value(const StringName &p_function);44static Variant::Type get_function_return_type(const StringName &p_function);45static StringName get_function_return_class(const StringName &p_function);46static Variant::Type get_function_argument_type(const StringName &p_function, int p_arg);47static int get_function_argument_count(const StringName &p_function);48static bool is_function_vararg(const StringName &p_function);49static bool is_function_constant(const StringName &p_function);5051static bool function_exists(const StringName &p_function);52static void get_function_list(List<StringName> *r_functions);53static MethodInfo get_function_info(const StringName &p_function);5455static void register_functions();56static void unregister_functions();57};585960