ObjFW  Diff

Differences From Artifact [03713bc866]:

To Artifact [f1e270d342]:


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
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







-
+





-
+






-
+









-
+







#import "OFMapTable.h"

#import "OFInvalidArgumentException.h"

static uint32_t
stringHash(void *object)
{
	return [(OFString*)object hash];
	return [(OFString *)object hash];
}

static bool
stringEqual(void *object1, void *object2)
{
	return [(OFString*)object1 isEqual: (OFString*)object2];
	return [(OFString *)object1 isEqual: (OFString *)object2];
}

@implementation OFOptionsParser
@synthesize lastOption = _lastOption, lastLongOption = _lastLongOption;
@synthesize argument = _argument;

+ (instancetype)parserWithOptions: (const of_options_parser_option_t*)options
+ (instancetype)parserWithOptions: (const of_options_parser_option_t *)options
{
	return [[[self alloc] initWithOptions: options] autorelease];
}

- init
{
	OF_INVALID_INIT_METHOD
}

- initWithOptions: (const of_options_parser_option_t*)options
- initWithOptions: (const of_options_parser_option_t *)options
{
	self = [super init];

	@try {
		size_t count = 0;
		const of_options_parser_option_t *iter;
		of_options_parser_option_t *iter2;
271
272
273
274
275
276
277
278

279
280
281
282
283
271
272
273
274
275
276
277

278
279
280
281
282
283







-
+





			return _lastOption;
		}
	}

	return '?';
}

- (OFArray*)remainingArguments
- (OFArray *)remainingArguments
{
	return [_arguments objectsInRange:
	    of_range(_index, [_arguments count] - _index)];
}
@end