ObjFW  Diff

Differences From Artifact [b5a7737ef1]:

To Artifact [a330fd8ef3]:

  • File src/OFOptionsParser.m — part of check-in [48980f2297] at 2015-11-29 11:43:05 on branch trunk — Make properties a requirement and clean up code

    This increases the required GCC version from 4.0 to 4.6 (exception:
    Apple GCC, which already supports this with >= 4.0 starting with OS X
    10.5). Since even GCC 4.6 is really old by now, there is no point in
    still supporting something even older and making the code ugly because
    of that. While some hardware and OS support was dropped from GCC 4.6
    compared to GCC 4.0, there is nothing in there that would be an
    interesting target with the exception of BeOS maybe - but a port to BeOS
    can also be achieved using the Haiku support. The other dropped OSes are
    mostly old versions of OSes while newer ones are still being supported
    (and those newer versions of those OSes still support the same
    hardware). (user: js, size: 6233) [annotate] [blame] [check-ins using]


32
33
34
35
36
37
38



39
40
41
42
43
44
45
static bool
stringEqual(void *value1, void *value2)
{
	return [(OFString*)value1 isEqual: (OFString*)value2];
}

@implementation OFOptionsParser



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

- init
{







>
>
>







32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
static bool
stringEqual(void *value1, void *value2)
{
	return [(OFString*)value1 isEqual: (OFString*)value2];
}

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

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

- init
{
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
			return _lastOption;
		}
	}

	return '?';
}

- (of_unichar_t)lastOption
{
	return _lastOption;
}

- (OFString*)lastLongOption
{
	OF_GETTER(_lastLongOption, true)
}

- (OFString*)argument
{
	OF_GETTER(_argument, true)
}

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







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






260
261
262
263
264
265
266















267
268
269
270
271
272
			return _lastOption;
		}
	}

	return '?';
}
















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