@@ -475,21 +475,21 @@ { } - (void)dealloc { - @throw [OFNotImplementedException exceptionWithClass: isa + @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; [super dealloc]; /* Get rid of a stupid warning */ } @end @implementation OFString + (void)initialize { if (self == [OFString class]) - placeholder.isa = [OFString_placeholder class]; + object_setClass((id)&placeholder, [OFString_placeholder class]); } + alloc { if (self == [OFString class]) @@ -643,12 +643,12 @@ encoding: encoding] autorelease]; } - init { - if (isa == [OFString class]) { - Class c = isa; + if (object_getClass(self) == [OFString class]) { + Class c = [self class]; [self release]; @throw [OFNotImplementedException exceptionWithClass: c selector: _cmd]; } @@ -680,19 +680,19 @@ - initWithCString: (const char*)cString encoding: (of_string_encoding_t)encoding length: (size_t)cStringLength { - Class c = isa; + Class c = [self class]; [self release]; @throw [OFNotImplementedException exceptionWithClass: c selector: _cmd]; } - initWithString: (OFString*)string { - Class c = isa; + Class c = [self class]; [self release]; @throw [OFNotImplementedException exceptionWithClass: c selector: _cmd]; } @@ -721,11 +721,11 @@ - initWithUnicodeString: (const of_unichar_t*)string byteOrder: (of_endianess_t)byteOrder length: (size_t)length { - Class c = isa; + Class c = [self class]; [self release]; @throw [OFNotImplementedException exceptionWithClass: c selector: _cmd]; } @@ -754,11 +754,11 @@ - initWithUTF16String: (const uint16_t*)string byteOrder: (of_endianess_t)byteOrder length: (size_t)length { - Class c = isa; + Class c = [self class]; [self release]; @throw [OFNotImplementedException exceptionWithClass: c selector: _cmd]; } @@ -776,11 +776,11 @@ } - initWithFormat: (OFConstantString*)format arguments: (va_list)arguments { - Class c = isa; + Class c = [self class]; [self release]; @throw [OFNotImplementedException exceptionWithClass: c selector: _cmd]; } @@ -798,11 +798,11 @@ } - initWithPath: (OFString*)firstComponent arguments: (va_list)arguments { - Class c = isa; + Class c = [self class]; [self release]; @throw [OFNotImplementedException exceptionWithClass: c selector: _cmd]; } @@ -822,16 +822,17 @@ OFFile *file; if (stat([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE], &st) == -1) @throw [OFOpenFileFailedException - exceptionWithClass: isa + exceptionWithClass: [self class] path: path mode: @"rb"]; if (st.st_size > SIZE_MAX) - @throw [OFOutOfRangeException exceptionWithClass: isa]; + @throw [OFOutOfRangeException + exceptionWithClass: [self class]]; file = [[OFFile alloc] initWithPath: path mode: @"rb"]; @try { @@ -868,11 +869,11 @@ OFHTTPRequest *request; OFHTTPRequestResult *result; OFString *contentType; Class c; - c = isa; + c = [self class]; [self release]; pool = [[OFAutoreleasePool alloc] init]; if ([[URL scheme] isEqual: @"file"]) { @@ -924,22 +925,22 @@ @try { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; if (![[element namespace] isEqual: OF_SERIALIZATION_NS]) @throw [OFInvalidArgumentException - exceptionWithClass: isa + exceptionWithClass: [self class] selector: _cmd]; if ([self isKindOfClass: [OFMutableString class]]) { if (![[element name] isEqual: @"OFMutableString"]) @throw [OFInvalidArgumentException - exceptionWithClass: isa + exceptionWithClass: [self class] selector: _cmd]; } else { if (![[element name] isEqual: @"OFString"]) @throw [OFInvalidArgumentException - exceptionWithClass: isa + exceptionWithClass: [self class] selector: _cmd]; } self = [self initWithString: [element stringValue]]; @@ -993,11 +994,11 @@ j += 4; break; default: @throw [OFInvalidEncodingException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; } } UTF8String[j] = '\0'; @@ -1015,17 +1016,17 @@ { if (encoding == OF_STRING_ENCODING_UTF_8) return [self UTF8String]; /* TODO: Implement! */ - @throw [OFNotImplementedException exceptionWithClass: isa + @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; } - (size_t)length { - @throw [OFNotImplementedException exceptionWithClass: isa + @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; } - (size_t)UTF8StringLength { @@ -1038,11 +1039,11 @@ size_t characterLen = of_string_unicode_to_utf8( unicodeString[i], buffer); if (characterLen == 0) @throw [OFInvalidEncodingException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; UTF8StringLength += characterLen; } return UTF8StringLength; @@ -1052,17 +1053,17 @@ { if (encoding == OF_STRING_ENCODING_UTF_8) return [self UTF8StringLength]; /* TODO: Implement! */ - @throw [OFNotImplementedException exceptionWithClass: isa + @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; } - (of_unichar_t)characterAtIndex: (size_t)index { - @throw [OFNotImplementedException exceptionWithClass: isa + @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; } - (void)getCharacters: (of_unichar_t*)buffer inRange: (of_range_t)range @@ -1127,12 +1128,13 @@ if (object == self) return OF_ORDERED_SAME; if (![object isKindOfClass: [OFString class]]) - @throw [OFInvalidArgumentException exceptionWithClass: isa - selector: _cmd]; + @throw [OFInvalidArgumentException + exceptionWithClass: [self class] + selector: _cmd]; otherString = object; minimumLength = ([self length] > [otherString length] ? [otherString length] : [self length]); @@ -1393,11 +1395,12 @@ { OFAutoreleasePool *pool; OFString *ret; if (range.start + range.length > [self length]) - @throw [OFOutOfRangeException exceptionWithClass: isa]; + @throw [OFOutOfRangeException + exceptionWithClass: [self class]]; pool = [[OFAutoreleasePool alloc] init]; ret = [[OFString alloc] initWithUnicodeString: [self unicodeString] + range.start length: range.length]; @@ -1815,28 +1818,28 @@ if (expectWhitespace) { if (string[i] != ' ' && string[i] != '\t' && string[i] != '\n' && string[i] != '\r' && string[i] != '\f') @throw [OFInvalidFormatException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; continue; } if (string[i] >= '0' && string[i] <= '9') { if (INTMAX_MAX / 10 < value || INTMAX_MAX - value * 10 < string[i] - '0') @throw [OFOutOfRangeException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; value = (value * 10) + (string[i] - '0'); } else if (string[i] == ' ' || string[i] == '\t' || string[i] == '\n' || string[i] == '\r' || string[i] == '\f') expectWhitespace = YES; else @throw [OFInvalidFormatException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; } if (string[0] == '-') value *= -1; @@ -1876,11 +1879,11 @@ if (expectWhitespace) { if (string[i] != ' ' && string[i] != '\t' && string[i] != '\n' && string[i] != '\r' && string[i] != '\f') @throw [OFInvalidFormatException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; continue; } if (string[i] >= '0' && string[i] <= '9') { newValue = (value << 4) | (string[i] - '0'); @@ -1896,20 +1899,22 @@ string[i] == '\r' || string[i] == '\f') { expectWhitespace = YES; continue; } else @throw [OFInvalidFormatException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; if (newValue < value) - @throw [OFOutOfRangeException exceptionWithClass: isa]; + @throw [OFOutOfRangeException + exceptionWithClass: [self class]]; value = newValue; } if (!foundValue) - @throw [OFInvalidFormatException exceptionWithClass: isa]; + @throw [OFInvalidFormatException + exceptionWithClass: [self class]]; [pool release]; return value; } @@ -1932,11 +1937,11 @@ for (; *endPointer != '\0'; endPointer++) if (*endPointer != ' ' && *endPointer != '\t' && *endPointer != '\n' && *endPointer != '\r' && *endPointer != '\f') @throw [OFInvalidFormatException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; [pool release]; return value; } @@ -1959,11 +1964,11 @@ for (; *endPointer != '\0'; endPointer++) if (*endPointer != ' ' && *endPointer != '\t' && *endPointer != '\n' && *endPointer != '\r' && *endPointer != '\f') @throw [OFInvalidFormatException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; [pool release]; return value; } @@ -2001,11 +2006,11 @@ for (i = 0; i < length; i++) { of_unichar_t c = unicodeString[i]; if (c > 0x10FFFF) @throw [OFInvalidEncodingException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; if (c > 0xFFFF) { c -= 0x10000; ret[j++] = of_bswap16_if_le(0xD800 | (c >> 10)); ret[j++] = of_bswap16_if_le(0xDC00 | (c & 0x3FF));