diff options
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 |
