1 module godot.charstring;
2 
3 import std.traits;
4 import std.exception : assumeWontThrow;
5 import godot.builtins;
6 import godot.poolarrays;
7 import godot.abi;
8 import godot.abi.gdextension;
9 import godot.stringname;
10 
11 import godot.variant;
12 
13 struct CharString {
14     const(char)* data;
15     int length;
16 
17     ~this() {
18         if (data)
19             _godot_api.mem_free(cast(void*) data);
20         data = null;
21         length = 0;
22     }
23 }
24 
25 struct Char16String {
26     const(char16_t)* data;
27     int length;
28 
29     ~this() {
30         if (data)
31             _godot_api.mem_free(cast(void*) data);
32         data = null;
33         length = 0;
34     }
35 }
36 
37 struct Char32String {
38     const(char32_t)* data;
39     int length;
40 
41     ~this() {
42         if (data)
43             _godot_api.mem_free(cast(void*) data);
44         data = null;
45         length = 0;
46     }
47 }
48 
49 struct CharWideString {
50     const(wchar_t)* data;
51     int length;
52 
53     ~this() {
54         if (data)
55             _godot_api.mem_free(cast(void*) data);
56         data = null;
57         length = 0;
58     }
59 }