ObjFW  Diff

Differences From Artifact [5e428f851d]:

To Artifact [2779dde916]:


218
219
220
221
222
223
224







225
226
227
228
229
230
231
232













233
234
235
236
237
238
239
	andSize: (size_t)size
      andNItems: (size_t)nitems
{
	return [[self alloc] initWithObject: obj
				    andSize: size
				  andNItems: nitems];
}








- initWithObject: (id)obj
	 andSize: (size_t)size
       andNItems: (size_t)nitems
{
	if ((self = [super initWithObject: obj])) {
		req_size = size;
		req_items = nitems;













	}

	return self;
}

- (size_t)requestedSize
{







>
>
>
>
>
>
>








>
>
>
>
>
>
>
>
>
>
>
>
>







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
	andSize: (size_t)size
      andNItems: (size_t)nitems
{
	return [[self alloc] initWithObject: obj
				    andSize: size
				  andNItems: nitems];
}

+ newWithObject: (id)obj
	andSize: (size_t)size
{
	return [[self alloc] initWithObject: obj
				    andSize: size];
}

- initWithObject: (id)obj
	 andSize: (size_t)size
       andNItems: (size_t)nitems
{
	if ((self = [super initWithObject: obj])) {
		req_size = size;
		req_items = nitems;
		has_items = YES;
	}

	return self;
}

- initWithObject: (id)obj
	 andSize: (size_t)size
{
	if ((self = [super initWithObject: obj])) {
		req_size = size;
		req_items = 0;
		has_items = NO;
	}

	return self;
}

- (size_t)requestedSize
{
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

@implementation OFReadFailedException
- (char*)cString
{
	if (string != NULL)
		return string;;


	asprintf(&string, "Failed to read %zu items of size %zu in object of "
	    "class %s!", req_items, req_size, [object name]);




	return string;
}
@end

@implementation OFWriteFailedException
- (char*)cString
{
	if (string != NULL)
		return string;


	asprintf(&string, "Failed to write %zu items of size %zu in object of "
	    "class %s!", req_items, req_size, [object name]);




	return string;
}
@end

@implementation OFNotConnectedException
- (char*)cString







>
|
|
>
>
>











>
|
|
>
>
>







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
300
301
302
303
304

@implementation OFReadFailedException
- (char*)cString
{
	if (string != NULL)
		return string;;

	if (has_items)
		asprintf(&string, "Failed to read %zu items of size %zu in "
		    "object of class %s!", req_items, req_size, [object name]);
	else
		asprintf(&string, "Failed to read %zu bytes in object of class "
		    "%s!", req_size, [object name]);

	return string;
}
@end

@implementation OFWriteFailedException
- (char*)cString
{
	if (string != NULL)
		return string;

	if (has_items)
		asprintf(&string, "Failed to write %zu items of size %zu in "
		    "object of class %s!", req_items, req_size, [object name]);
	else
		asprintf(&string, "Failed to write %zu bytes in object of "
		    "class %s!", req_size, [object name]);

	return string;
}
@end

@implementation OFNotConnectedException
- (char*)cString