@@ -43,10 +43,11 @@ #ifdef __cplusplus } #endif @class OFArray; +@class OFURL; /** * \brief A class for handling strings. */ @interface OFString: OFObject @@ -148,10 +149,30 @@ * \return A new autoreleased OFString */ + stringWithContentsOfFile: (OFString*)path encoding: (of_string_encoding_t)encoding; +/** + * Creates a new OFString with the contents of the specified URL, assuming + * UTF-8 encoding. + * + * \param url The URL to the contents for the string + * \return A new autoreleased OFString + */ ++ stringWithContentsOfURL: (OFURL*)url; + +/** + * Creates a new OFString with the contents of the specified URL in the + * specified encoding. + * + * \param url The URL to the contents for the string + * \param encoding The encoding to assume + * \return A new autoreleased OFString + */ ++ stringWithContentsOfURL: (OFURL*)url + encoding: (of_string_encoding_t)encoding; + /** * Initializes an already allocated OFString from a UTF-8 encoded C string. * * \param str A UTF-8 encoded C string to initialize the OFString with * \return An initialized OFString @@ -259,10 +280,30 @@ * \return An initialized OFString */ - initWithContentsOfFile: (OFString*)path encoding: (of_string_encoding_t)encoding; +/** + * Initializes an already allocated OFString with the contents of the specified + * URL, assuming UTF-8 encoding. + * + * \param url The URL to the contents for the string + * \return An initialized OFString + */ +- initWithContentsOfURL: (OFURL*)url; + +/** + * Initializes an already allocated OFString with the contents of the specified + * URL in the specified encoding. + * + * \param url The URL to the contents for the string + * \param encoding The encoding to assume + * \return An initialized OFString + */ +- initWithContentsOfURL: (OFURL*)url + encoding: (of_string_encoding_t)encoding; + /** * \return The OFString as a UTF-8 encoded C string */ - (const char*)cString;