@@ -18,10 +18,12 @@ #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif +OF_ASSUME_NONNULL_BEGIN + @class OFHTTPServer; @class OFHTTPRequest; @class OFHTTPResponse; @class OFTCPSocket; @class OFException; @@ -75,14 +77,14 @@ OFString *_name; OFTCPSocket *_listeningSocket; } #ifdef OF_HAVE_PROPERTIES -@property (copy) OFString *host; +@property (copy, nullable) OFString *host; @property uint16_t port; -@property (assign) id delegate; -@property (copy) OFString *name; +@property (assign, nullable) id delegate; +@property (copy, nullable) OFString *name; #endif /*! * @brief Creates a new HTTP server. * @@ -93,18 +95,18 @@ /*! * @brief Sets the host on which the HTTP server will listen. * * @param host The host to listen on */ -- (void)setHost: (OFString*)host; +- (void)setHost: (nullable OFString*)host; /*! * @brief Returns the host on which the HTTP server will listen. * * @return The host on which the HTTP server will listen */ -- (OFString*)host; +- (nullable OFString*)host; /*! * @brief Sets the port on which the HTTP server will listen. * * @param port The port to listen on @@ -121,32 +123,32 @@ /*! * @brief Sets the delegate for the HTTP server. * * @param delegate The delegate for the HTTP server */ -- (void)setDelegate: (id )delegate; +- (void)setDelegate: (nullable id )delegate; /*! * @brief Returns the delegate for the HTTP server. * * @return The delegate for the HTTP server */ -- (id )delegate; +- (nullable id )delegate; /*! * @brief Sets the server name the server presents to clients. * * @param name The server name to present to clients */ -- (void)setName: (OFString*)name; +- (void)setName: (nullable OFString*)name; /*! * @brief Returns the server name the server presents to clients. * * @return The server name the server presents to clients */ -- (OFString*)name; +- (nullable OFString*)name; /*! * @brief Starts the HTTP server in the current thread's runloop. */ - (void)start; @@ -159,5 +161,7 @@ - (void)stop; @end @interface OFObject (OFHTTPServerDelegate) @end + +OF_ASSUME_NONNULL_END