Differences From Artifact [3fb5b4e15d]:
- File src/OFString.h — part of check-in [7c66260ead] at 2011-07-08 20:13:39 on branch trunk — Rename -[deleteLeadingAndTrailingWhitespaces]. (user: js, size: 21345) [annotate] [blame] [check-ins using]
To Artifact [d7444f1cd5]:
- File
src/OFString.h
— part of check-in
[36e8a94f34]
at
2011-07-09 14:45:44
on branch trunk
— Cache the length of a string.
Also removes -[appendCStringWithoutUTF8Checking:] as it is dangerous and
not compatible with this optimization. (user: js, size: 21371) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
35 36 37 38 39 40 41 | OF_STRING_ENCODING_WINDOWS_1252, OF_STRING_ENCODING_AUTODETECT = 0xFF } of_string_encoding_t; #ifdef __cplusplus extern "C" { #endif | | | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | OF_STRING_ENCODING_WINDOWS_1252, OF_STRING_ENCODING_AUTODETECT = 0xFF } of_string_encoding_t; #ifdef __cplusplus extern "C" { #endif extern int of_string_check_utf8(const char*, size_t, size_t*); extern size_t of_string_unicode_to_utf8(of_unichar_t, char*); extern size_t of_string_utf8_to_unicode(const char*, size_t, of_unichar_t*); extern size_t of_string_position_to_index(const char*, size_t); extern size_t of_string_index_to_position(const char*, size_t, size_t); extern size_t of_unicode_string_length(const of_unichar_t*); extern size_t of_utf16_string_length(const uint16_t*); #ifdef __cplusplus |
︙ | ︙ | |||
74 75 76 77 78 79 80 81 82 83 84 85 86 87 | * struct on the first call to a constant string so we can have more * than those two ivars. */ struct of_string_ivars { char *cString; size_t cStringLength; BOOL isUTF8; } *restrict s; /* * Unused in OFString, however, OFConstantString sets this to SIZE_MAX * once it allocated and initialized the struct. */ size_t initialized; } | > | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | * struct on the first call to a constant string so we can have more * than those two ivars. */ struct of_string_ivars { char *cString; size_t cStringLength; BOOL isUTF8; size_t length; } *restrict s; /* * Unused in OFString, however, OFConstantString sets this to SIZE_MAX * once it allocated and initialized the struct. */ size_t initialized; } |
︙ | ︙ |