ObjFW  Diff

Differences From Artifact [e7b34fe947]:

To Artifact [16fd1ae620]:


16
17
18
19
20
21
22











































23
24
25

26

27
28
29

#include "config.h"

#import "OFWriteFailedException.h"
#import "OFString.h"

@implementation OFWriteFailedException











































- (OFString *)description
{
	return [OFString stringWithFormat:

	    @"Failed to write %zu bytes to an object of type %@: %@",

	    _requestedLength, [_object class], of_strerror(_errNo)];
}
@end







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



>
|
>
|


16
17
18
19
20
21
22
23
24
25
26
27
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
62
63
64
65
66
67
68
69
70
71
72
73
74

#include "config.h"

#import "OFWriteFailedException.h"
#import "OFString.h"

@implementation OFWriteFailedException
@synthesize bytesWritten = _bytesWritten;

+ (instancetype)exceptionWithObject: (id)object
		    requestedLength: (size_t)requestedLength
			      errNo: (int)errNo
{
	return [[[self alloc] initWithObject: object
			     requestedLength: requestedLength
				       errNo: errNo] autorelease];
}

+ (instancetype)exceptionWithObject: (id)object
		    requestedLength: (size_t)requestedLength
		       bytesWritten: (size_t)bytesWritten
			      errNo: (int)errNo
{
	return [[[self alloc] initWithObject: object
			     requestedLength: requestedLength
				bytesWritten: bytesWritten
				       errNo: errNo] autorelease];
}

-  initWithObject: (id)object
  requestedLength: (size_t)requestedLength
	    errNo: (int)errNo
{
	OF_INVALID_INIT_METHOD
}

-  initWithObject: (id)object
  requestedLength: (size_t)requestedLength
     bytesWritten: (size_t)bytesWritten
	    errNo: (int)errNo
{
	self = [super initWithObject: object
		     requestedLength: requestedLength
			       errNo: errNo];

	_bytesWritten = bytesWritten;

	return self;
}

- (OFString *)description
{
	return [OFString stringWithFormat:
	    @"Failed to write %zu bytes (after %zu bytes written)  to an "
	    @"object of type %@: %@",
	    _requestedLength, _bytesWritten, [_object class],
	    of_strerror(_errNo)];
}
@end