@@ -78,17 +78,17 @@ #if defined(HAVE_STRTOF_L) || defined(HAVE_STRTOD_L) static locale_t cLocale; #endif @interface OFString () -- (size_t)OF_getCString: (char *)cString +- (size_t)of_getCString: (char *)cString maxLength: (size_t)maxLength encoding: (of_string_encoding_t)encoding lossy: (bool)lossy; -- (const char *)OF_cStringWithEncoding: (of_string_encoding_t)encoding +- (const char *)of_cStringWithEncoding: (of_string_encoding_t)encoding lossy: (bool)lossy; -- (OFString *)OF_JSONRepresentationWithOptions: (int)options +- (OFString *)of_JSONRepresentationWithOptions: (int)options depth: (size_t)depth; @end extern bool of_unicode_to_iso_8859_2(const of_unichar_t *, unsigned char *, size_t, bool); @@ -369,11 +369,11 @@ length = strlen(UTF8String); string = of_alloc_object([OFString_UTF8 class], length + 1, 1, &storage); - return (id)[string OF_initWithUTF8String: UTF8String + return (id)[string of_initWithUTF8String: UTF8String length: length storage: storage]; } - initWithUTF8String: (const char *)UTF8String @@ -383,11 +383,11 @@ void *storage; string = of_alloc_object([OFString_UTF8 class], UTF8StringLength + 1, 1, &storage); - return (id)[string OF_initWithUTF8String: UTF8String + return (id)[string of_initWithUTF8String: UTF8String length: UTF8StringLength storage: storage]; } - initWithUTF8StringNoCopy: (char *)UTF8String @@ -408,11 +408,11 @@ length = strlen(cString); string = of_alloc_object([OFString_UTF8 class], length + 1, 1, &storage); - return (id)[string OF_initWithUTF8String: cString + return (id)[string of_initWithUTF8String: cString length: length storage: storage]; } return (id)[[OFString_UTF8 alloc] initWithCString: cString @@ -428,11 +428,11 @@ void *storage; string = of_alloc_object([OFString_UTF8 class], cStringLength + 1, 1, &storage); - return (id)[string OF_initWithUTF8String: cString + return (id)[string of_initWithUTF8String: cString length: cStringLength storage: storage]; } return (id)[[OFString_UTF8 alloc] initWithCString: cString @@ -1046,11 +1046,11 @@ } return self; } -- (size_t)OF_getCString: (char *)cString +- (size_t)of_getCString: (char *)cString maxLength: (size_t)maxLength encoding: (of_string_encoding_t)encoding lossy: (bool)lossy { const of_unichar_t *characters = [self characters]; @@ -1281,27 +1281,27 @@ - (size_t)getCString: (char *)cString maxLength: (size_t)maxLength encoding: (of_string_encoding_t)encoding { - return [self OF_getCString: cString + return [self of_getCString: cString maxLength: maxLength encoding: encoding lossy: false]; } - (size_t)getLossyCString: (char *)cString maxLength: (size_t)maxLength encoding: (of_string_encoding_t)encoding { - return [self OF_getCString: cString + return [self of_getCString: cString maxLength: maxLength encoding: encoding lossy: true]; } -- (const char *)OF_cStringWithEncoding: (of_string_encoding_t)encoding +- (const char *)of_cStringWithEncoding: (of_string_encoding_t)encoding lossy: (bool)lossy { OFObject *object = [[[OFObject alloc] init] autorelease]; size_t length = [self length]; char *cString; @@ -1310,11 +1310,11 @@ case OF_STRING_ENCODING_UTF_8:; size_t cStringLength; cString = [object allocMemoryWithSize: (length * 4) + 1]; - cStringLength = [self OF_getCString: cString + cStringLength = [self of_getCString: cString maxLength: (length * 4) + 1 encoding: OF_STRING_ENCODING_UTF_8 lossy: lossy]; @try { @@ -1338,11 +1338,11 @@ case OF_STRING_ENCODING_MAC_ROMAN: case OF_STRING_ENCODING_KOI8_R: case OF_STRING_ENCODING_KOI8_U: cString = [object allocMemoryWithSize: length + 1]; - [self OF_getCString: cString + [self of_getCString: cString maxLength: length + 1 encoding: encoding lossy: lossy]; break; @@ -1353,17 +1353,17 @@ return cString; } - (const char *)cStringWithEncoding: (of_string_encoding_t)encoding { - return [self OF_cStringWithEncoding: encoding + return [self of_cStringWithEncoding: encoding lossy: false]; } - (const char *)lossyCStringWithEncoding: (of_string_encoding_t)encoding { - return [self OF_cStringWithEncoding: encoding + return [self of_cStringWithEncoding: encoding lossy: true]; } - (const char *)UTF8String { @@ -1630,21 +1630,21 @@ return [element autorelease]; } - (OFString *)JSONRepresentation { - return [self OF_JSONRepresentationWithOptions: 0 + return [self of_JSONRepresentationWithOptions: 0 depth: 0]; } - (OFString *)JSONRepresentationWithOptions: (int)options { - return [self OF_JSONRepresentationWithOptions: options + return [self of_JSONRepresentationWithOptions: options depth: 0]; } -- (OFString *)OF_JSONRepresentationWithOptions: (int)options +- (OFString *)of_JSONRepresentationWithOptions: (int)options depth: (size_t)depth { OFMutableString *JSON = [[self mutableCopy] autorelease]; /* FIXME: This is slow! Write it in pure C! */