@@ -14,10 +14,12 @@ * file. */ #import "OFException.h" +OF_ASSUME_NONNULL_BEGIN + /*! * @class OFOpenItemFailedException \ * OFOpenItemFailedException.h ObjFW/OFOpenItemFailedException.h * * @brief An exception indicating an item could not be opened. @@ -34,11 +36,11 @@ @property (readonly, nonatomic) OFString *path; /*! * The mode in which the item should have been opened. */ -@property (readonly, nonatomic) OFString *mode; +@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *mode; /*! * The errno of the error that occurred. */ @property (readonly) int errNo; @@ -57,11 +59,11 @@ * @param path A string with the path of the item tried to open * @param mode A string with the mode in which the item should have been opened * @return A new, autoreleased open item failed exception */ + (instancetype)exceptionWithPath: (OFString*)path - mode: (OFString*)mode; + mode: (nullable OFString*)mode; /*! * @brief Creates a new, autoreleased open item failed exception. * * @param path A string with the path of the item tried to open @@ -78,11 +80,11 @@ * @param mode A string with the mode in which the item should have been opened * @param errNo The errno of the error that occurred * @return A new, autoreleased open item failed exception */ + (instancetype)exceptionWithPath: (OFString*)path - mode: (OFString*)mode + mode: (nullable OFString*)mode errNo: (int)errNo; /*! * @brief Initializes an already allocated open item failed exception. * @@ -97,11 +99,11 @@ * @param path A string with the path of the item which could not be opened * @param mode A string with the mode in which the item should have been opened * @return An initialized open item failed exception */ - initWithPath: (OFString*)path - mode: (OFString*)mode; + mode: (nullable OFString*)mode; /*! * @brief Initializes an already allocated open item failed exception. * * @param path A string with the path of the item which could not be opened @@ -118,8 +120,10 @@ * @param mode A string with the mode in which the item should have been opened * @param errNo The errno of the error that occurred * @return An initialized open item failed exception */ - initWithPath: (OFString*)path - mode: (OFString*)mode + mode: (nullable OFString*)mode errNo: (int)errNo; @end + +OF_ASSUME_NONNULL_END