@@ -1,7 +1,7 @@ /* - * Copyright (c) 2008-2022 Jonathan Schleifer + * Copyright (c) 2008-2024 Jonathan Schleifer * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in @@ -50,33 +50,11 @@ + (instancetype)alloc { OF_UNRECOGNIZED_SELECTOR } -- (instancetype)retain -{ - return self; -} - -- (instancetype)autorelease -{ - return self; -} - -- (unsigned int)retainCount -{ - return OFMaxRetainCount; -} - -- (void)release -{ -} - -- (void)dealloc -{ - OF_DEALLOC_UNSUPPORTED -} +OF_SINGLETON_METHODS @end @implementation OFConstantString + (void)load { @@ -133,33 +111,11 @@ + (instancetype)alloc { OF_UNRECOGNIZED_SELECTOR } -- (instancetype)retain -{ - return self; -} - -- (instancetype)autorelease -{ - return self; -} - -- (unsigned int)retainCount -{ - return OFMaxRetainCount; -} - -- (void)release -{ -} - -- (void)dealloc -{ - OF_DEALLOC_UNSUPPORTED -} +OF_SINGLETON_METHODS /* * In all following methods, the constant string is converted to an * OFConstantUTF8String and the message sent again. */ @@ -547,24 +503,10 @@ { [self finishInitialization]; return [self dataWithEncoding: encoding]; } -#ifdef OF_HAVE_UNICODE_TABLES -- (OFString *)decomposedStringWithCanonicalMapping -{ - [self finishInitialization]; - return self.decomposedStringWithCanonicalMapping; -} - -- (OFString *)decomposedStringWithCompatibilityMapping -{ - [self finishInitialization]; - return self.decomposedStringWithCompatibilityMapping; -} -#endif - #ifdef OF_WINDOWS - (OFString *)stringByExpandingWindowsEnvironmentStrings { [self finishInitialization]; return self.stringByExpandingWindowsEnvironmentStrings; @@ -583,20 +525,20 @@ [self finishInitialization]; [self writeToFile: path encoding: encoding]; } #endif -- (void)writeToURI: (OFURI *)URI +- (void)writeToIRI: (OFIRI *)IRI { [self finishInitialization]; - [self writeToURI: URI]; + [self writeToIRI: IRI]; } -- (void)writeToURI: (OFURI *)URI encoding: (OFStringEncoding)encoding +- (void)writeToIRI: (OFIRI *)IRI encoding: (OFStringEncoding)encoding { [self finishInitialization]; - [self writeToURI: URI encoding: encoding]; + [self writeToIRI: IRI encoding: encoding]; } #ifdef OF_HAVE_BLOCKS - (void)enumerateLinesUsingBlock: (OFStringLineEnumerationBlock)block {