@@ -12,12 +12,10 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ -#include - #import "OFException.h" /*! * @class OFOpenFileFailedException \ * OFOpenFileFailedException.h ObjFW/OFOpenFileFailedException.h @@ -43,10 +41,22 @@ * @return A new, autoreleased open file failed exception */ + (instancetype)exceptionWithPath: (OFString*)path mode: (OFString*)mode; +/*! + * @brief Creates a new, autoreleased open file failed exception. + * + * @param path A string with the path of the file tried to open + * @param mode A string with the mode in which the file should have been opened + * @param errNo The errno of the error + * @return A new, autoreleased open file failed exception + */ ++ (instancetype)exceptionWithPath: (OFString*)path + mode: (OFString*)mode + errNo: (int)errNo; + /*! * @brief Initializes an already allocated open file failed exception. * * @param path A string with the path of the file which couldn't be opened * @param mode A string with the mode in which the file should have been opened @@ -53,10 +63,22 @@ * @return An initialized open file failed exception */ - initWithPath: (OFString*)path mode: (OFString*)mode; +/*! + * @brief Initializes an already allocated open file failed exception. + * + * @param path A string with the path of the file which couldn't be opened + * @param mode A string with the mode in which the file should have been opened + * @param errNo The errno of the error + * @return An initialized open file failed exception + */ +- initWithPath: (OFString*)path + mode: (OFString*)mode + errNo: (int)errNo; + /*! * @brief Returns a string with the path of the file which couldn't be opened. * * @return A string with the path of the file which couldn't be opened */