1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Remove dependency of variant.h in print_string.h

Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
This commit is contained in:
Yufeng Ying
2025-06-19 18:22:49 +08:00
parent 9dde5688a5
commit 05dae23f18
6 changed files with 25 additions and 26 deletions

View File

@@ -341,6 +341,14 @@ bool is_print_verbose_enabled() {
return OS::get_singleton()->is_stdout_verbose();
}
String stringify_variants(const Variant &p_var) {
return p_var.operator String();
String stringify_variants(const Span<Variant> &p_vars) {
if (p_vars.is_empty()) {
return String();
}
String result = String(p_vars[0]);
for (const Variant &v : Span(p_vars.ptr() + 1, p_vars.size() - 1)) {
result += ' ';
result += v.operator String();
}
return result;
}