@@ -92,12 +92,10 @@ */ size_t initialized; } #ifdef OF_HAVE_PROPERTIES -@property (readonly) const char *cString; -@property (readonly) size_t cStringLength; @property (readonly) size_t length; #endif /** * \brief Creates a new OFString. @@ -107,14 +105,25 @@ + string; /** * \brief Creates a new OFString from a UTF-8 encoded C string. * - * \param cString A UTF-8 encoded C string to initialize the OFString with + * \param UTF8String A UTF-8 encoded C string to initialize the OFString with + * \return A new autoreleased OFString + */ ++ stringWithUTF8String: (const char*)UTF8String; + +/** + * \brief Creates a new OFString from a UTF-8 encoded C string with the + * specified length. + * + * \param UTF8String A UTF-8 encoded C string to initialize the OFString with + * \param UTF8StringLength The length of the UTF-8 encoded C string * \return A new autoreleased OFString */ -+ stringWithCString: (const char*)cString; ++ stringWithUTF8String: (const char*)UTF8String + length: (size_t)UTF8StringLength; /** * \brief Creates a new OFString from a C string with the specified encoding. * * \param string A C string to initialize the OFString with @@ -135,21 +144,10 @@ */ + stringWithCString: (const char*)cString encoding: (of_string_encoding_t)encoding length: (size_t)cStringLength; -/** - * \brief Creates a new OFString from a UTF-8 encoded C string with the - * specified length. - * - * \param cString A UTF-8 encoded C string to initialize the OFString with - * \param cStringLength The length of the UTF-8 encoded C string - * \return A new autoreleased OFString - */ -+ stringWithCString: (const char*)cString - length: (size_t)cStringLength; - /** * \brief Creates a new OFString from another string. * * \param string A string to initialize the OFString with * \return A new autoreleased OFString @@ -309,14 +307,25 @@ /** * \brief Initializes an already allocated OFString from a UTF-8 encoded C * string. * - * \param cString A UTF-8 encoded C string to initialize the OFString with + * \param UTF8String A UTF-8 encoded C string to initialize the OFString with + * \return An initialized OFString + */ +- initWithUTF8String: (const char*)UTF8String; + +/** + * \brief Initializes an already allocated OFString from a UTF-8 encoded C + * string with the specified length. + * + * \param UTF8String A UTF-8 encoded C string to initialize the OFString with + * \param UTF8StringLength The length of the UTF-8 encoded C string * \return An initialized OFString */ -- initWithCString: (const char*)cString; +- initWithUTF8String: (const char*)UTF8String + length: (size_t)UTF8StringLength; /** * \brief Initializes an already allocated OFString from a C string with the * specified encoding. * @@ -338,21 +347,10 @@ */ - initWithCString: (const char*)cString encoding: (of_string_encoding_t)encoding length: (size_t)cStringLength; -/** - * \brief Initializes an already allocated OFString from a UTF-8 encoded C - * string with the specified length. - * - * \param cString A UTF-8 encoded C string to initialize the OFString with - * \param cStringLength The length of the UTF-8 encoded C string - * \return An initialized OFString - */ -- initWithCString: (const char*)cString - length: (size_t)cStringLength; - /** * \brief Initializes an already allocated OFString with another string. * * \param string A string to initialize the OFString with * \return An initialized OFString @@ -540,11 +538,11 @@ /** * \brief Returns the OFString as a UTF-8 encoded C string. * * \return The OFString as a UTF-8 encoded C string */ -- (const char*)cString; +- (const char*)UTF8String; /** * \brief Returns the OFString as a C string in the specified encoding. * * \param encoding The encoding for the C string @@ -558,15 +556,15 @@ * \return The length of the string in Unicode characters */ - (size_t)length; /** - * \brief Returns the length of the string which cString would return. + * \brief Returns the number of bytes the string needs in UTF-8 encoding. * - * \return The length of the string which cString would return + * \return The number of bytes the string needs in UTF-8 encoding. */ -- (size_t)cStringLength; +- (size_t)UTF8StringLength; /** * \brief Returns the number of bytes the string needs in the specified * encoding. *