diff options
| author | Arslaan Pathan <[email protected]> | 2026-10-04 19:48:30 +1300 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-10-04 19:48:30 +1300 |
| commit | b50119031f1b1b4935a20837ae931f0cc0f1167e (patch) | |
| tree | bd82d26d07e909d4b7463321b07d9fafc1fd6e1a /include/Paradox/String.h | |
| parent | 4c8f79bd52bb9effd00fe8347dd910cbec646e94 (diff) | |
| download | Paradox-b50119031f1b1b4935a20837ae931f0cc0f1167e.tar.xz Paradox-b50119031f1b1b4935a20837ae931f0cc0f1167e.zip | |
Diffstat (limited to 'include/Paradox/String.h')
| -rw-r--r-- | include/Paradox/String.h | 22 |
1 files changed, 19 insertions, 3 deletions
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 <objc/runtime.h> #include <Paradox/Object.h> +#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 |
