@@ -14,10 +14,12 @@ * file. */ #import "OFXMLNode.h" +OF_ASSUME_NONNULL_BEGIN + @class OFString; /*! * @class OFXMLAttribute OFXMLAttribute.h ObjFW/OFXMLAttribute.h * @@ -30,13 +32,13 @@ } #ifdef OF_HAVE_PROPERTIES @property (readonly, copy) OFString *name; # ifdef __cplusplus -@property (readonly, copy, getter=namespace) OFString *namespace_; +@property (readonly, copy, getter=namespace, nullable) OFString *namespace_; # else -@property (readonly, copy) OFString *namespace; +@property (readonly, copy, nullable) OFString *namespace; # endif #endif /*! * @brief Creates a new XML attribute. @@ -55,11 +57,11 @@ * @param namespace_ The namespace of the attribute * @param stringValue The string value of the attribute * @return A new autoreleased OFXMLAttribute with the specified parameters */ + (instancetype)attributeWithName: (OFString*)name - namespace: (OFString*)namespace_ + namespace: (nullable OFString*)namespace_ stringValue: (OFString*)stringValue; /*! * @brief Initializes an already allocated OFXMLAttribute. * @@ -77,11 +79,11 @@ * @param namespace_ The namespace of the attribute * @param stringValue The string value of the attribute * @return An initialized OFXMLAttribute with the specified parameters */ - initWithName: (OFString*)name - namespace: (OFString*)namespace_ + namespace: (nullable OFString*)namespace_ stringValue: (OFString*)stringValue; /*! * @brief Returns the name of the attribute as an autoreleased OFString. * @@ -92,7 +94,9 @@ /*! * @brief Returns the namespace of the attribute as an autoreleased OFString. * * @return The namespace of the attribute as an autoreleased OFString */ -- (OFString*)namespace; +- (nullable OFString*)namespace; @end + +OF_ASSUME_NONNULL_END