ObjFW  Check-in [72f2eb445d]

Overview
Comment:Use a more fitting exception in -[initWithContentsOfFile:].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 72f2eb445ddd703b0d3b68d793b827c8e781284cf55162b4c117b38de8974034
User & Date: js on 2011-04-03 10:58:31
Other Links: manifest | tags
Context
2011-04-03
17:02
Fix -[performSelector:] and friends. check-in: 3398436156 user: js tags: trunk
10:58
Use a more fitting exception in -[initWithContentsOfFile:]. check-in: 72f2eb445d user: js tags: trunk
2011-04-02
02:29
Fix small bugs introduced by the last commit. check-in: 321274075d user: js tags: trunk
Changes

Modified src/OFString.m from [f081783cbe] to [feba50e66c].

39
40
41
42
43
44
45

46
47
48
49
50
51
52
#import "OFAutoreleasePool.h"

#import "OFHTTPRequestFailedException.h"
#import "OFInitializationFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFInvalidEncodingException.h"
#import "OFInvalidFormatException.h"

#import "OFOutOfMemoryException.h"
#import "OFOutOfRangeException.h"

#import "macros.h"
#import "of_asprintf.h"
#import "unicode.h"








>







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#import "OFAutoreleasePool.h"

#import "OFHTTPRequestFailedException.h"
#import "OFInitializationFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFInvalidEncodingException.h"
#import "OFInvalidFormatException.h"
#import "OFOpenFileFailedException.h"
#import "OFOutOfMemoryException.h"
#import "OFOutOfRangeException.h"

#import "macros.h"
#import "of_asprintf.h"
#import "unicode.h"

658
659
660
661
662
663
664
665
666


667
668
669
670
671
672
673

	self = [super init];

	@try {
		OFFile *file;

		if (stat([path cString], &s) == -1)
			@throw [OFInitializationFailedException
			    newWithClass: isa];



		file = [[OFFile alloc] initWithPath: path
					       mode: @"rb"];

		@try {
			tmp = [self allocMemoryWithSize: s.st_size];








<
|
>
>







659
660
661
662
663
664
665

666
667
668
669
670
671
672
673
674
675

	self = [super init];

	@try {
		OFFile *file;

		if (stat([path cString], &s) == -1)

			@throw [OFOpenFileFailedException newWithClass: isa
								  path: path
								  mode: @"rb"];

		file = [[OFFile alloc] initWithPath: path
					       mode: @"rb"];

		@try {
			tmp = [self allocMemoryWithSize: s.st_size];