Index: src/OFDate.h ================================================================== --- src/OFDate.h +++ src/OFDate.h @@ -16,10 +16,11 @@ #import "OFObject.h" #import "OFSerialization.h" @class OFString; +@class OFConstantString; /** * \brief A class for storing, accessing and comparing dates. */ @interface OFDate: OFObject @@ -239,24 +240,24 @@ /** * \brief Creates a string of the date with the specified format. * * See the manpage for strftime for information on the format. * - * \param fmt The format for the date string + * \param format The format for the date string * \return A new, autoreleased OFString */ -- (OFString*)dateStringWithFormat: (OFString*)fmt; +- (OFString*)dateStringWithFormat: (OFConstantString*)format; /** * \brief Creates a string of the local date with the specified format. * * See the manpage for strftime for information on the format. * - * \param fmt The format for the date string + * \param format The format for the date string * \return A new, autoreleased OFString */ -- (OFString*)localDateStringWithFormat: (OFString*)fmt; +- (OFString*)localDateStringWithFormat: (OFConstantString*)format; /** * \brief Returns the earlier of the two dates. * * \param date Another date Index: src/OFDate.m ================================================================== --- src/OFDate.m +++ src/OFDate.m @@ -441,11 +441,11 @@ - (uint16_t)localDayOfYear { LOCALTIME_RET(tm_yday + 1) } -- (OFString*)dateStringWithFormat: (OFString*)format +- (OFString*)dateStringWithFormat: (OFConstantString*)format { OFString *ret; time_t seconds_ = (time_t)seconds; struct tm tm; char *buffer; @@ -487,11 +487,11 @@ } return ret; } -- (OFString*)localDateStringWithFormat: (OFString*)format +- (OFString*)localDateStringWithFormat: (OFConstantString*)format { OFString *ret; time_t seconds_ = (time_t)seconds; struct tm tm; char *buffer; Index: src/OFMutableString.h ================================================================== --- src/OFMutableString.h +++ src/OFMutableString.h @@ -95,21 +95,21 @@ * * See printf for the format syntax. * * \param format A format string which generates the string to append */ -- (void)appendFormat: (OFString*)format, ...; +- (void)appendFormat: (OFConstantString*)format, ...; /** * \brief Appends a formatted string to the OFMutableString. * * See printf for the format syntax. * * \param format A format string which generates the string to append * \param arguments The arguments used in the format string */ -- (void)appendFormat: (OFString*)format +- (void)appendFormat: (OFConstantString*)format withArguments: (va_list)arguments; /** * \brief Prepends another OFString to the OFMutableString. * Index: src/OFMutableString.m ================================================================== --- src/OFMutableString.m +++ src/OFMutableString.m @@ -255,21 +255,21 @@ selector: _cmd]; [self appendCString: [string_ cString]]; } -- (void)appendFormat: (OFString*)format, ... +- (void)appendFormat: (OFConstantString*)format, ... { va_list arguments; va_start(arguments, format); [self appendFormat: format withArguments: arguments]; va_end(arguments); } -- (void)appendFormat: (OFString*)format +- (void)appendFormat: (OFConstantString*)format withArguments: (va_list)arguments { char *t; int len; Index: src/OFStream.h ================================================================== --- src/OFStream.h +++ src/OFStream.h @@ -670,20 +670,20 @@ * Writes a formatted string into the stream. * * \param format A string used as format * \return The number of bytes written */ -- (size_t)writeFormat: (OFString*)format, ...; +- (size_t)writeFormat: (OFConstantString*)format, ...; /** * Writes a formatted string into the stream. * * \param format A string used as format * \param arguments The arguments used in the format string * \return The number of bytes written */ -- (size_t)writeFormat: (OFString*)format +- (size_t)writeFormat: (OFConstantString*)format withArguments: (va_list)arguments; /** * \return The number of bytes still present in the internal cache. */ Index: src/OFStream.m ================================================================== --- src/OFStream.m +++ src/OFStream.m @@ -1269,11 +1269,11 @@ } return stringLength + 1; } -- (size_t)writeFormat: (OFString*)format, ... +- (size_t)writeFormat: (OFConstantString*)format, ... { va_list arguments; size_t ret; va_start(arguments, format); @@ -1282,11 +1282,11 @@ va_end(arguments); return ret; } -- (size_t)writeFormat: (OFString*)format +- (size_t)writeFormat: (OFConstantString*)format withArguments: (va_list)arguments { char *cString; int length; Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -18,10 +18,12 @@ #include #include #import "OFObject.h" #import "OFSerialization.h" + +@class OFConstantString; typedef uint32_t of_unichar_t; /** * \brief The encoding of a string. @@ -207,11 +209,11 @@ * See printf for the format syntax. * * \param format A string used as format to initialize the OFString * \return A new autoreleased OFString */ -+ stringWithFormat: (OFString*)format, ...; ++ stringWithFormat: (OFConstantString*)format, ...; /** * Creates a new OFString containing the constructed specified path. * * \param firstComponent The first component of the path @@ -405,21 +407,21 @@ * See printf for the format syntax. * * \param format A string used as format to initialize the OFString * \return An initialized OFString */ -- initWithFormat: (OFString*)format, ...; +- initWithFormat: (OFConstantString*)format, ...; /** * Initializes an already allocated OFString with a format string. * See printf for the format syntax. * * \param format A string used as format to initialize the OFString * \param arguments The arguments used in the format string * \return An initialized OFString */ -- initWithFormat: (OFString*)format +- initWithFormat: (OFConstantString*)format arguments: (va_list)arguments; /** * Initializes an already allocated OFString with the constructed specified * path. Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -362,11 +362,11 @@ return [[[self alloc] initWithUTF16String: string byteOrder: byteOrder length: length] autorelease]; } -+ stringWithFormat: (OFString*)format, ... ++ stringWithFormat: (OFConstantString*)format, ... { id ret; va_list arguments; va_start(arguments, format); @@ -834,11 +834,11 @@ } return self; } -- initWithFormat: (OFString*)format, ... +- initWithFormat: (OFConstantString*)format, ... { id ret; va_list arguments; va_start(arguments, format); @@ -847,11 +847,11 @@ va_end(arguments); return ret; } -- initWithFormat: (OFString*)format +- initWithFormat: (OFConstantString*)format arguments: (va_list)arguments { self = [super init]; @try {