@@ -114,10 +114,29 @@ * \param str A string to initialize the OFString with * \return A new autoreleased OFString */ + stringWithString: (OFString*)str; +/** + * Creates a new OFString with the contents of the specified file. + * + * \param path The path to the file + * \return A new autoreleased OFString + */ ++ stringWithContentsOfFile: (OFString*)path; + +/** + * Creates a new OFString with the contents of the specified file in the + * specified encoding. + * + * \param path The path to the file + * \param encoding The encoding of the file + * \return A new autoreleased OFString + */ ++ stringWithContentsOfFile: (OFString*)path + encoding: (enum of_string_encoding)encoding; + /** * Initializes an already allocated OFString. * * \return An initialized OFString */ @@ -212,10 +231,30 @@ * \param str A string to initialize the OFString with * \return An initialized OFString */ - initWithString: (OFString*)str; +/** + * Initializes an already allocated OFString with the contents of the specified + * file in the specified encoding. + * + * \param path The path to the file + * \return An initialized OFString + */ +- initWithContentsOfFile: (OFString*)path; + +/** + * Initializes an already allocated OFString with the contents of the specified + * file in the specified encoding. + * + * \param path The path to the file + * \param encoding The encoding of the file + * \return An initialized OFString + */ +- initWithContentsOfFile: (OFString*)path + encoding: (enum of_string_encoding)encoding; + /** * \return The OFString as a UTF-8 encoded C string */ - (const char*)cString;