ObjFW  Diff

Differences From Artifact [8b2b368da6]:

  • File src/OFHTTPResponse.h — part of check-in [0a73af49f0] at 2017-04-30 13:35:16 on branch trunk — Use nonatomic for properties and clean up

    This changes retaining behavior, meaning properties are not returned
    retained and autoreleased anymore, so a property returned from a getter
    now needs to be manually retained and autoreleased before calling the
    setter. However, this is rarely the case and not using atomic improves
    performance. (user: js, size: 2824) [annotate] [blame] [check-ins using]

To Artifact [88ee04dd60]:


28
29
30
31
32
33
34
35
36


37
38
39
40
41
42
43
44
45
46
47
48

49
50
51
52
53
54

55
56
57
58
59
60
61
28
29
30
31
32
33
34


35
36
37
38
39
40
41
42
43
44
45
46
47

48
49
50
51
52
53

54
55
56
57
58
59
60
61







-
-
+
+











-
+





-
+







 *
 * @brief A class for representing an HTTP request reply as a stream.
 */
@interface OFHTTPResponse: OFStream
{
	of_http_request_protocol_version_t _protocolVersion;
	short _statusCode;
	OFDictionary OF_GENERIC(OFString*, OFString*) *_headers;
	OFArray OF_GENERIC(OFHTTPCookie*) *_cookies;
	OFDictionary OF_GENERIC(OFString *, OFString *) *_headers;
	OFArray OF_GENERIC(OFHTTPCookie *) *_cookies;
}

/*!
 * The status code of the reply to the HTTP request.
 */
@property short statusCode;

/*!
 * The headers of the reply to the HTTP request.
 */
@property OF_NULLABLE_PROPERTY (nonatomic, copy)
    OFDictionary OF_GENERIC(OFString*, OFString*) *headers;
    OFDictionary OF_GENERIC(OFString *, OFString *) *headers;

/*!
 * The cookies to set of the reply to the HTTP request.
 */
@property OF_NULLABLE_PROPERTY (nonatomic, copy)
    OFArray OF_GENERIC(OFHTTPCookie*) *cookies;
    OFArray OF_GENERIC(OFHTTPCookie *) *cookies;

/*!
 * @brief Sets the protocol version of the HTTP request reply.
 *
 * @param protocolVersion The protocol version of the HTTP request reply
 */
- (void)setProtocolVersion: (of_http_request_protocol_version_t)protocolVersion;
69
70
71
72
73
74
75
76

77
78
79
80
81
82
83

84
85
86
87
88
89
90

91
92
93
94
95
96
97
98

99
100
101
69
70
71
72
73
74
75

76
77
78
79
80
81
82

83
84
85
86
87
88
89

90
91
92
93
94
95
96
97

98
99
100
101







-
+






-
+






-
+







-
+




/*!
 * @brief Sets the protocol version of the HTTP request reply to the version
 *	  described by the specified string.
 *
 * @param string A string describing an HTTP version
 */
- (void)setProtocolVersionFromString: (OFString*)string;
- (void)setProtocolVersionFromString: (OFString *)string;

/*!
 * @brief Returns the protocol version of the HTTP request reply as a string.
 *
 * @return The protocol version of the HTTP request reply as a string
 */
- (OFString*)protocolVersionString;
- (OFString *)protocolVersionString;

/*!
 * @brief Returns the reply as a string, trying to detect the encoding.
 *
 * @return The reply as a string
 */
- (OFString*)string;
- (OFString *)string;

/*!
 * @brief Returns the reply as a string, trying to detect the encoding and
 *	  falling back to the specified encoding if not detectable.
 *
 * @return The reply as a string
 */
- (OFString*)stringWithEncoding: (of_string_encoding_t)encoding;
- (OFString *)stringWithEncoding: (of_string_encoding_t)encoding;
@end

OF_ASSUME_NONNULL_END