@@ -16,10 +16,12 @@ #import "OFObject.h" #import "OFString.h" #import "OFXMLAttribute.h" +OF_ASSUME_NONNULL_BEGIN + @class OFXMLParser; #ifndef DOXYGEN @class OFArray OF_GENERIC(ObjectType); @class OFMutableArray OF_GENERIC(ObjectType); @class OFMutableDictionary OF_GENERIC(KeyType, ObjectType); @@ -57,13 +59,13 @@ * @param attributes The attributes included in the tag which just started or * nil */ - (void)parser: (OFXMLParser*)parser didStartElement: (OFString*)name - prefix: (OFString*)prefix - namespace: (OFString*)ns - attributes: (OFArray OF_GENERIC(OFXMLAttribute*)*)attributes; + prefix: (nullable OFString*)prefix + namespace: (nullable OFString*)ns + attributes: (nullable OFArray OF_GENERIC(OFXMLAttribute*)*)attributes; /*! * @brief This callback is called when the XML parser found the end of a tag. * * @param parser The parser which found the end of a tag @@ -71,12 +73,12 @@ * @param prefix The prefix of the tag which just ended or nil * @param ns The namespace of the tag which just ended or nil */ - (void)parser: (OFXMLParser*)parser didEndElement: (OFString*)name - prefix: (OFString*)prefix - namespace: (OFString*)ns; + prefix: (nullable OFString*)prefix + namespace: (nullable OFString*)ns; /*! * @brief This callback is called when the XML parser found characters. * * In case there are comments or CDATA, it is possible that this callback is @@ -174,11 +176,11 @@ of_string_encoding_t _encoding; size_t _depthLimit; } #ifdef OF_HAVE_PROPERTIES -@property (assign) id delegate; +@property (assign, nullable) id delegate; @property size_t depthLimit; #endif /*! * @brief Creates a new XML parser. @@ -185,23 +187,23 @@ * * @return A new, autoreleased OFXMLParser */ + (instancetype)parser; -/*! - * @brief Returns the delegate that is used by the XML parser. - * - * @return The delegate that is used by the XML parser - */ -- (id )delegate; - /*! * @brief Sets the delegate the XML parser should use. * * @param delegate The delegate to use */ -- (void)setDelegate: (id )delegate; +- (void)setDelegate: (nullable id )delegate; + +/*! + * @brief Returns the delegate that is used by the XML parser. + * + * @return The delegate that is used by the XML parser + */ +- (nullable id )delegate; /*! * @brief Returns the depth limit for the XML parser. * * @return The depth limit for the XML parser @@ -266,5 +268,7 @@ - (bool)finishedParsing; @end @interface OFObject (OFXMLParserDelegate) @end + +OF_ASSUME_NONNULL_END