Commit 2996a461 authored by Felix Paul Kühne's avatar Felix Paul Kühne

osx/framework: allow VLCTime to handle int values

parent 390f573e
......@@ -35,13 +35,16 @@
/* Factories */
+ (VLCTime *)nullTime;
+ (VLCTime *)timeWithNumber:(NSNumber *)aNumber;
+ (VLCTime *)timeWithInt:(int)aInt;
/* Initializers */
- (id)initWithNumber:(NSNumber *)aNumber;
- (id)initWithInt:(int)aInt;
/* Properties */
@property (readonly) NSNumber * numberValue;
@property (readonly) NSString * stringValue;
@property (readonly) int intValue;
/* Comparitors */
- (NSComparisonResult)compare:(VLCTime *)aTime;
......
......@@ -39,6 +39,11 @@
return [[[VLCTime alloc] initWithNumber:aNumber] autorelease];
}
+ (VLCTime *)timeWithInt:(int)aInt
{
return [[[VLCTime alloc] initWithInt:aInt] autorelease];
}
/* Initializers */
- (id)initWithNumber:(NSNumber *)aNumber
{
......@@ -52,6 +57,18 @@
return self;
}
- (id)initWithInt:(int)aInt
{
if (self = [super init])
{
if (aInt)
value = [[NSNumber numberWithInt: aInt] retain];
else
value = nil;
}
return self;
}
- (void)dealloc
{
[value release];
......@@ -100,6 +117,13 @@
}
}
- (int)intValue
{
if( value )
return [value intValue];
return 0;
}
- (NSComparisonResult)compare:(VLCTime *)aTime
{
if (!aTime && !value)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment