|
@@ -1664,6 +1664,50 @@ typedef void (*GDExtensionInterfaceStringOperatorPlusEqC32str)(GDExtensionString
|
|
|
*/
|
|
|
typedef GDExtensionInt (*GDExtensionInterfaceStringResize)(GDExtensionStringPtr p_self, GDExtensionInt p_resize);
|
|
|
|
|
|
+/* INTERFACE: StringName Utilities */
|
|
|
+
|
|
|
+/**
|
|
|
+ * @name string_name_new_with_latin1_chars
|
|
|
+ * @since 4.2
|
|
|
+ *
|
|
|
+ * Creates a StringName from a Latin-1 encoded C string.
|
|
|
+ *
|
|
|
+ * If `p_is_static` is true, then:
|
|
|
+ * - The StringName will reuse the `p_contents` buffer instead of copying it.
|
|
|
+ * You must guarantee that the buffer remains valid for the duration of the application (e.g. string literal).
|
|
|
+ * - You must not call a destructor for this StringName. Incrementing the initial reference once should achieve this.
|
|
|
+ *
|
|
|
+ * `p_is_static` is purely an optimization and can easily introduce undefined behavior if used wrong. In case of doubt, set it to false.
|
|
|
+ *
|
|
|
+ * @param r_dest A pointer to uninitialized storage, into which the newly created StringName is constructed.
|
|
|
+ * @param p_contents A pointer to a C string (null terminated and Latin-1 or ASCII encoded).
|
|
|
+ * @param p_is_static Whether the StringName reuses the buffer directly (see above).
|
|
|
+ */
|
|
|
+typedef void (*GDExtensionInterfaceStringNameNewWithLatin1Chars)(GDExtensionUninitializedStringNamePtr r_dest, const char *p_contents, GDExtensionBool p_is_static);
|
|
|
+
|
|
|
+/**
|
|
|
+ * @name string_name_new_with_utf8_chars
|
|
|
+ * @since 4.2
|
|
|
+ *
|
|
|
+ * Creates a StringName from a UTF-8 encoded C string.
|
|
|
+ *
|
|
|
+ * @param r_dest A pointer to uninitialized storage, into which the newly created StringName is constructed.
|
|
|
+ * @param p_contents A pointer to a C string (null terminated and UTF-8 encoded).
|
|
|
+ */
|
|
|
+typedef void (*GDExtensionInterfaceStringNameNewWithUtf8Chars)(GDExtensionUninitializedStringNamePtr r_dest, const char *p_contents);
|
|
|
+
|
|
|
+/**
|
|
|
+ * @name string_name_new_with_utf8_chars_and_len
|
|
|
+ * @since 4.2
|
|
|
+ *
|
|
|
+ * Creates a StringName from a UTF-8 encoded string with a given number of characters.
|
|
|
+ *
|
|
|
+ * @param r_dest A pointer to uninitialized storage, into which the newly created StringName is constructed.
|
|
|
+ * @param p_contents A pointer to a C string (null terminated and UTF-8 encoded).
|
|
|
+ * @param p_size The number of bytes (not UTF-8 code points).
|
|
|
+ */
|
|
|
+typedef void (*GDExtensionInterfaceStringNameNewWithUtf8CharsAndLen)(GDExtensionUninitializedStringNamePtr r_dest, const char *p_contents, GDExtensionInt p_size);
|
|
|
+
|
|
|
/* INTERFACE: XMLParser Utilities */
|
|
|
|
|
|
/**
|