ObjFW  Diff

Differences From Artifact [189c6c26d9]:

To Artifact [ef2dd82880]:


84
85
86
87
88
89
90
91

92
93
94
95
96
97
98
99

100
101
102
103
104
105
106
107
108
109
110


111
112
113
114
115
116
117
118
119
120


121
122
123
124
125
126
127
128
129
130
131
132
133



134
135
136
137
138
139
140
141

142
143
144
145
146
147
148
149

150
151
152
153
154
155
156
157
158
159
160


161
162
163
164
165
166
167
168
169
170
171


172
173
174
175
176
177
178
179
180
181
182
183
184



185
186
187
188
189
190
191
192

193
194
195
196
197
198
199
200
201
202
203


204
205
206
207
208
209
210
211
212
213
214


215
216
217
218
219
220
221
222
223
224
225
226
227
228



229
230
231
232
233
234
235
236
237
238
239

240
241
242
243
244
245
246
247

248
249
250
251
252
253
254
255
256

257
258
259
260
261
262
263
264
265
266
267


268
269
270
271
272
273
274
275
276
277
278
279
280
281

282
283
284
285
286
287
288
289
290
291
292


293
294
295
296
297
298
299
84
85
86
87
88
89
90

91
92
93
94
95
96
97
98

99
100
101
102
103
104
105
106
107
108


109
110
111
112
113
114
115
116
117
118


119
120
121
122
123
124
125
126
127
128
129
130



131
132
133
134
135
136
137
138
139
140

141
142
143
144
145
146
147
148

149
150
151
152
153
154
155
156
157
158


159
160
161
162
163
164
165
166
167
168
169


170
171
172
173
174
175
176
177
178
179
180
181



182
183
184
185
186
187
188
189
190
191

192
193
194
195
196
197
198
199
200
201


202
203
204
205
206
207
208
209
210
211
212


213
214
215
216
217
218
219
220
221
222
223
224
225



226
227
228
229
230
231
232
233
234
235
236
237
238

239
240
241
242
243
244
245
246

247
248
249
250
251
252
253
254
255

256
257
258
259
260
261
262
263
264
265


266
267
268
269
270
271
272
273
274
275
276
277
278
279
280

281
282
283
284
285
286
287
288
289
290


291
292
293
294
295
296
297
298
299







-
+







-
+









-
-
+
+








-
-
+
+










-
-
-
+
+
+







-
+







-
+









-
-
+
+









-
-
+
+










-
-
-
+
+
+







-
+









-
-
+
+









-
-
+
+











-
-
-
+
+
+










-
+







-
+








-
+









-
-
+
+













-
+









-
-
+
+







#endif

/**
 * \brief Creates a new OFString.
 *
 * \return A new, autoreleased OFString
 */
+ string;
+ (instancetype)string;

/**
 * \brief Creates a new OFString from a UTF-8 encoded C string.
 *
 * \param UTF8String A UTF-8 encoded C string to initialize the OFString with
 * \return A new autoreleased OFString
 */
+ stringWithUTF8String: (const char*)UTF8String;
+ (instancetype)stringWithUTF8String: (const char*)UTF8String;

/**
 * \brief Creates a new OFString from a UTF-8 encoded C string with the
 *	  specified length.
 *
 * \param UTF8String A UTF-8 encoded C string to initialize the OFString with
 * \param UTF8StringLength The length of the UTF-8 encoded C string
 * \return A new autoreleased OFString
 */
+ stringWithUTF8String: (const char*)UTF8String
		length: (size_t)UTF8StringLength;
+ (instancetype)stringWithUTF8String: (const char*)UTF8String
			      length: (size_t)UTF8StringLength;

/**
 * \brief Creates a new OFString from a C string with the specified encoding.
 *
 * \param string A C string to initialize the OFString with
 * \param encoding The encoding of the C string
 * \return A new autoreleased OFString
 */
+ stringWithCString: (const char*)cString
	   encoding: (of_string_encoding_t)encoding;
+ (instancetype)stringWithCString: (const char*)cString
			 encoding: (of_string_encoding_t)encoding;

/**
 * \brief Creates a new OFString from a C string with the specified encoding
 *	  and length.
 *
 * \param cString A C string to initialize the OFString with
 * \param encoding The encoding of the C string
 * \param cStringLength The length of the C string
 * \return A new autoreleased OFString
 */
+ stringWithCString: (const char*)cString
	   encoding: (of_string_encoding_t)encoding
	     length: (size_t)cStringLength;
+ (instancetype)stringWithCString: (const char*)cString
			 encoding: (of_string_encoding_t)encoding
			   length: (size_t)cStringLength;

/**
 * \brief Creates a new OFString from another string.
 *
 * \param string A string to initialize the OFString with
 * \return A new autoreleased OFString
 */
+ stringWithString: (OFString*)string;
+ (instancetype)stringWithString: (OFString*)string;

/**
 * \brief Creates a new OFString from a unicode string.
 *
 * \param string The unicode string
 * \return A new autoreleased OFString
 */
+ stringWithUnicodeString: (const of_unichar_t*)string;
+ (instancetype)stringWithUnicodeString: (const of_unichar_t*)string;

/**
 * \brief Creates a new OFString from a unicode string, assuming the specified
 *	  byte order if no BOM is found.
 *
 * \param string The unicode string
 * \param byteOrder The byte order to assume if there is no BOM
 * \return A new autoreleased OFString
 */
+ stringWithUnicodeString: (const of_unichar_t*)string
		byteOrder: (of_endianess_t)byteOrder;
+ (instancetype)stringWithUnicodeString: (const of_unichar_t*)string
			      byteOrder: (of_endianess_t)byteOrder;

/**
 * \brief Creates a new OFString from a unicode string with the specified
 *	  length.
 *
 * \param string The unicode string
 * \param length The length of the unicode string
 * \return A new autoreleased OFString
 */
+ stringWithUnicodeString: (const of_unichar_t*)string
		   length: (size_t)length;
+ (instancetype)stringWithUnicodeString: (const of_unichar_t*)string
				 length: (size_t)length;

/**
 * \brief Creates a new OFString from a unicode string with the specified
 *	  length, assuming the specified byte order if no BOM is found.
 *
 * \param string The unicode string
 * \param byteOrder The byte order to assume if there is no BOM
 * \param length The length of the unicode string
 * \return A new autoreleased OFString
 */
+ stringWithUnicodeString: (const of_unichar_t*)string
		byteOrder: (of_endianess_t)byteOrder
		   length: (size_t)length;
+ (instancetype)stringWithUnicodeString: (const of_unichar_t*)string
			      byteOrder: (of_endianess_t)byteOrder
				 length: (size_t)length;

/**
 * \brief Creates a new OFString from a UTF-16 encoded string.
 *
 * \param string The UTF-16 string
 * \return A new autoreleased OFString
 */
+ stringWithUTF16String: (const uint16_t*)string;
+ (instancetype)stringWithUTF16String: (const uint16_t*)string;

/**
 * \brief Creates a new OFString from a UTF-16 encoded string, assuming the
 *	  specified byte order if no BOM is found.
 *
 * \param string The UTF-16 string
 * \param byteOrder The byte order to assume if there is no BOM
 * \return A new autoreleased OFString
 */
+ stringWithUTF16String: (const uint16_t*)string
	      byteOrder: (of_endianess_t)byteOrder;
+ (instancetype)stringWithUTF16String: (const uint16_t*)string
			    byteOrder: (of_endianess_t)byteOrder;

/**
 * \brief Creates a new OFString from a UTF-16 encoded string with the specified
 *	  length.
 *
 * \param string The UTF-16 string
 * \param length The length of the unicode string
 * \return A new autoreleased OFString
 */
+ stringWithUTF16String: (const uint16_t*)string
		 length: (size_t)length;
+ (instancetype)stringWithUTF16String: (const uint16_t*)string
			       length: (size_t)length;

/**
 * \brief Creates a new OFString from a UTF-16 encoded string with the
 *	  specified length, assuming the specified byte order if no BOM is
 *	  found.
 *
 * \param string The UTF-16 string
 * \param byteOrder The byte order to assume if there is no BOM
 * \param length The length of the unicode string
 * \return A new autoreleased OFString
 */
+ stringWithUTF16String: (const uint16_t*)string
	      byteOrder: (of_endianess_t)byteOrder
		 length: (size_t)length;
+ (instancetype)stringWithUTF16String: (const uint16_t*)string
			    byteOrder: (of_endianess_t)byteOrder
			       length: (size_t)length;

/**
 * \brief Creates a new OFString from a format string.
 *
 * See printf for the format syntax. As an addition, %@ is available as format
 * specifier for objects.
 *
 * \param format A string used as format to initialize the OFString
 * \return A new autoreleased OFString
 */
+ stringWithFormat: (OFConstantString*)format, ...;
+ (instancetype)stringWithFormat: (OFConstantString*)format, ...;

/**
 * \brief Creates a new OFString containing the constructed specified path.
 *
 * \param firstComponent The first component of the path
 * \return A new autoreleased OFString
 */
+ stringWithPath: (OFString*)firstComponent, ...;
+ (instancetype)stringWithPath: (OFString*)firstComponent, ...;

/**
 * \brief Creates a new OFString with the contents of the specified UTF-8
 *	  encoded file.
 *
 * \param path The path to the file
 * \return A new autoreleased OFString
 */
+ stringWithContentsOfFile: (OFString*)path;
+ (instancetype)stringWithContentsOfFile: (OFString*)path;

/**
 * \brief Creates a new OFString with the contents of the specified file in the
 *	  specified encoding.
 *
 * \param path The path to the file
 * \param encoding The encoding of the file
 * \return A new autoreleased OFString
 */
+ stringWithContentsOfFile: (OFString*)path
		  encoding: (of_string_encoding_t)encoding;
+ (instancetype)stringWithContentsOfFile: (OFString*)path
				encoding: (of_string_encoding_t)encoding;

/**
 * \brief Creates a new OFString with the contents of the specified URL.
 *
 * If the URL's scheme is file, it tries UTF-8 encoding.
 *
 * If the URL's scheme is http(s), it tries to detect the encoding from the HTTP
 * headers. If it could not detect the encoding using the HTTP headers, it tries
 * UTF-8.
 *
 * \param URL The URL to the contents for the string
 * \return A new autoreleased OFString
 */
+ stringWithContentsOfURL: (OFURL*)URL;
+ (instancetype)stringWithContentsOfURL: (OFURL*)URL;

/**
 * \brief Creates a new OFString with the contents of the specified URL in the
 *	  specified encoding.
 *
 * \param URL The URL to the contents for the string
 * \param encoding The encoding to assume
 * \return A new autoreleased OFString
 */
+ stringWithContentsOfURL: (OFURL*)URL
		 encoding: (of_string_encoding_t)encoding;
+ (instancetype)stringWithContentsOfURL: (OFURL*)URL
			       encoding: (of_string_encoding_t)encoding;

/**
 * \brief Initializes an already allocated OFString from a UTF-8 encoded C
 *	  string.
 *
 * \param UTF8String A UTF-8 encoded C string to initialize the OFString with
 * \return An initialized OFString