@@ -84,20 +84,20 @@ int of_string_check_utf8(const char *cString, size_t cStringLength, size_t *length) { size_t i, tmpLength = cStringLength; - int isUTF8 = 0; + int UTF8 = 0; madvise((void*)cString, cStringLength, MADV_SEQUENTIAL); for (i = 0; i < cStringLength; i++) { /* No sign of UTF-8 here */ if (OF_LIKELY(!(cString[i] & 0x80))) continue; - isUTF8 = 1; + UTF8 = 1; /* We're missing a start byte here */ if (OF_UNLIKELY(!(cString[i] & 0x40))) { madvise((void*)cString, cStringLength, MADV_NORMAL); return -1; @@ -160,11 +160,11 @@ madvise((void*)cString, cStringLength, MADV_NORMAL); if (length != NULL) *length = tmpLength; - return isUTF8; + return UTF8; } size_t of_string_unicode_to_utf8(of_unichar_t character, char *buffer) { @@ -498,11 +498,11 @@ case 1: if (encoding == OF_STRING_ENCODING_ASCII) @throw [OFInvalidEncodingException newWithClass: isa]; - s->isUTF8 = YES; + s->UTF8 = YES; break; case -1: @throw [OFInvalidEncodingException newWithClass: isa]; } @@ -524,11 +524,11 @@ if (!(cString[i] & 0x80)) { s->cString[j++] = cString[i]; continue; } - s->isUTF8 = YES; + s->UTF8 = YES; bytes = of_string_unicode_to_utf8( (uint8_t)cString[i], buffer); if (bytes == 0) @throw [OFInvalidEncodingException @@ -573,11 +573,11 @@ if (character == 0xFFFD) @throw [OFInvalidEncodingException newWithClass: isa]; - s->isUTF8 = YES; + s->UTF8 = YES; characterBytes = of_string_unicode_to_utf8(character, buffer); if (characterBytes == 0) @throw [OFInvalidEncodingException @@ -611,11 +611,11 @@ /* * We need one call to make sure it's initialized (in case it's * a constant string). */ s->cStringLength = [string UTF8StringLength]; - s->isUTF8 = string->s->isUTF8; + s->UTF8 = string->s->UTF8; s->length = string->s->length; s->cString = [self allocMemoryWithSize: s->cStringLength + 1]; memcpy(s->cString, string->s->cString, s->cStringLength + 1); } @catch (id e) { @@ -685,27 +685,27 @@ switch (characterLen) { case 1: s->cString[j++] = buffer[0]; break; case 2: - s->isUTF8 = YES; + s->UTF8 = YES; s->cStringLength++; memcpy(s->cString + j, buffer, 2); j += 2; break; case 3: - s->isUTF8 = YES; + s->UTF8 = YES; s->cStringLength += 2; memcpy(s->cString + j, buffer, 3); j += 3; break; case 4: - s->isUTF8 = YES; + s->UTF8 = YES; s->cStringLength += 3; memcpy(s->cString + j, buffer, 4); j += 4; @@ -818,27 +818,27 @@ switch (characterLen) { case 1: s->cString[j++] = buffer[0]; break; case 2: - s->isUTF8 = YES; + s->UTF8 = YES; s->cStringLength++; memcpy(s->cString + j, buffer, 2); j += 2; break; case 3: - s->isUTF8 = YES; + s->UTF8 = YES; s->cStringLength += 2; memcpy(s->cString + j, buffer, 3); j += 3; break; case 4: - s->isUTF8 = YES; + s->UTF8 = YES; s->cStringLength += 3; memcpy(s->cString + j, buffer, 4); j += 4; @@ -902,11 +902,11 @@ @try { switch (of_string_check_utf8(s->cString, cStringLength, &s->length)) { case 1: - s->isUTF8 = YES; + s->UTF8 = YES; break; case -1: @throw [OFInvalidEncodingException newWithClass: isa]; } @@ -952,22 +952,22 @@ /* * First needs to be a call to be sure it is initialized, in * case it's a constant string. */ s->cStringLength = [firstComponent UTF8StringLength]; - s->isUTF8 = firstComponent->s->isUTF8; + s->UTF8 = firstComponent->s->UTF8; s->length = firstComponent->s->length; /* Calculate length and see if we need UTF-8 */ va_copy(argumentsCopy, arguments); while ((component = va_arg(argumentsCopy, OFString*)) != nil) { /* First needs to be a call, see above */ s->cStringLength += 1 + [component UTF8StringLength]; s->length += 1 + component->s->length; - if (component->s->isUTF8) - s->isUTF8 = YES; + if (component->s->UTF8) + s->UTF8 = YES; } s->cString = [self allocMemoryWithSize: s->cStringLength + 1]; cStringLength = [firstComponent UTF8StringLength]; @@ -1141,11 +1141,11 @@ { switch (encoding) { case OF_STRING_ENCODING_UTF_8: return s->cString; case OF_STRING_ENCODING_ASCII: - if (s->isUTF8) + if (s->UTF8) @throw [OFInvalidEncodingException newWithClass: isa]; return s->cString; default: @throw [OFNotImplementedException newWithClass: isa @@ -1167,11 +1167,11 @@ { switch (encoding) { case OF_STRING_ENCODING_UTF_8: return s->cStringLength; case OF_STRING_ENCODING_ASCII: - if (s->isUTF8) + if (s->UTF8) @throw [OFInvalidEncodingException newWithClass: isa]; return s->cStringLength; default: @throw [OFNotImplementedException newWithClass: isa @@ -1249,11 +1249,11 @@ selector: _cmd]; otherCString = [otherString UTF8String]; otherCStringLength = [otherString UTF8StringLength]; - if (!s->isUTF8) { + if (!s->UTF8) { minimumCStringLength = (s->cStringLength > otherCStringLength ? otherCStringLength : s->cStringLength); if ((compare = memcasecmp(s->cString, otherCString, minimumCStringLength)) == 0) { @@ -1362,11 +1362,11 @@ of_unichar_t character; if (index >= s->length) @throw [OFOutOfRangeException newWithClass: isa]; - if (!s->isUTF8) + if (!s->UTF8) return s->cString[index]; index = of_string_index_to_position(s->cString, index, s->cStringLength); @@ -1441,11 +1441,11 @@ size_t end = range.start + range.length; if (end > s->length) @throw [OFOutOfRangeException newWithClass: isa]; - if (s->isUTF8) { + if (s->UTF8) { start = of_string_index_to_position(s->cString, start, s->cStringLength); end = of_string_index_to_position(s->cString, end, s->cStringLength); }