@@ -13,14 +13,14 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" +#import "OFString.h" #import "OFINICategory.h" @class OFMutableArray; -@class OFString; /*! * @class OFINIFile OFINIFile.h ObjFW/OFINIFile.h * * @brief A class for reading, creating and modifying INI files. @@ -37,10 +37,22 @@ * * @return A new, autoreleased OFINIFile with the contents of the specified file */ + (instancetype)fileWithPath: (OFString*)path; +/*! + * @brief Creates a new OFINIFile with the contents of the specified file in + * the specified encoding. + * + * @param path The path to the file whose contents the OFINIFile should contain + * @param encoding The encoding of the specified file + * + * @return A new, autoreleased OFINIFile with the contents of the specified file + */ ++ (instancetype)fileWithPath: (OFString*)path + encoding: (of_string_encoding_t)encoding; + /*! * @brief Initializes an already allocated OFINIFile with the contents of the * specified file. * * @param path The path to the file whose contents the OFINIFile should contain @@ -47,10 +59,22 @@ * * @return An initialized OFINIFile with the contents of the specified file */ - initWithPath: (OFString*)path; +/*! + * @brief Initializes an already allocated OFINIFile with the contents of the + * specified file in the specified encoding. + * + * @param path The path to the file whose contents the OFINIFile should contain + * @param encoding The encoding of the specified file + * + * @return An initialized OFINIFile with the contents of the specified file + */ +- initWithPath: (OFString*)path + encoding: (of_string_encoding_t)encoding; + /*! * @brief Returns an @ref OFINICategory for the category with the specified * name. * * @param name The name of the category for which an @ref OFINICategory should @@ -64,6 +88,16 @@ * @brief Writes the contents of the OFINIFile to a file. * * @param path The path of the file to write to */ - (void)writeToFile: (OFString*)path; + +/*! + * @brief Writes the contents of the OFINIFile to a file in the specified + * encoding. + * + * @param path The path of the file to write to + * @param encoding The encoding to use + */ +- (void)writeToFile: (OFString*)path + encoding: (of_string_encoding_t)encoding; @end