From 5288ff538d75d2ddab257a9e1e40050c9b8fa1cb Mon Sep 17 00:00:00 2001 From: reduz Date: Tue, 10 Nov 2020 18:31:33 -0300 Subject: Create Variant built-in functions. -Moved Expression to use this, removed its own. -Eventually GDScript/VisualScript/GDNative need to be moved to this. -Given the JSON functions were hacked-in, removed them and created a new JSONParser class -Made sure these functions appear properly in documentation, since they will be removed from GDScript --- core/string/ustring.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'core/string') diff --git a/core/string/ustring.h b/core/string/ustring.h index 201b439b12..b46733ab66 100644 --- a/core/string/ustring.h +++ b/core/string/ustring.h @@ -536,4 +536,24 @@ String RTRN(const String &p_text, const String &p_text_plural, int p_n, const St bool is_symbol(char32_t c); bool select_word(const String &p_s, int p_col, int &r_beg, int &r_end); +_FORCE_INLINE_ void sarray_add_str(Vector &arr) { +} + +_FORCE_INLINE_ void sarray_add_str(Vector &arr, const String &p_str) { + arr.push_back(p_str); +} + +template +_FORCE_INLINE_ void sarray_add_str(Vector &arr, const String &p_str, P... p_args) { + arr.push_back(p_str); + sarray_add_str(arr, p_args...); +} + +template +_FORCE_INLINE_ Vector sarray(P... p_args) { + Vector arr; + sarray_add_str(arr, p_args...); + return arr; +} + #endif // USTRING_H -- cgit v1.2.3