From b50119031f1b1b4935a20837ae931f0cc0f1167e Mon Sep 17 00:00:00 2001 From: Arslaan Pathan Date: Sun, 4 Oct 2026 19:48:30 +1300 Subject: Match the proper string format for compiler (IT WORKS YEAHHHHHHHHHHHH) --- include/Paradox/String.h | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/Paradox/String.h b/include/Paradox/String.h index ddb2261..1cbc53f 100644 --- a/include/Paradox/String.h +++ b/include/Paradox/String.h @@ -5,9 +5,25 @@ #include #include +#define PXStringFlagOwned 0x00010000 + @interface PXString : PXObject { - char *_bytes; - size_t _length; + /* old declaration did not conform to the API or some shit */ + /*char *_bytes; + size_t _length;*/ + + /* flags. currently only low 2 bits are used for encoding + * values: + * 0. ASCII (utf-8 but 7bit chars) + * 1. UTF-8 + * 2. UTF-16 + * 3. UTF-32 + */ + uint32_t flags; + uint32_t len; // num of UTF-16 code units + uint32_t size; // num of bytes + uint32_t hash; + char *_bytes; // as per ABI it's `const char * const _bytes;` when compiler-generated but too bad } /* init/lifecycle */ @@ -16,7 +32,7 @@ /* getters */ - (const char *)UTF8String; -- (size_t)length; +- (uint32_t)length; - (BOOL)isEqual:(PXString *)string; @end -- cgit v1.2.3