forked from dhomann/phonegap-iphone
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PGPlugin - Added VERIFY_ARGUMENTS macro, and verifyArguments function…
…, for plugin arguments verification, and automatic arg error reporting
- Loading branch information
Showing
5 changed files
with
111 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// NSMutableArray+QueueAdditions.h | ||
// | ||
// Created by Shazron Abdullah | ||
// Copyright 2011 Nitobi Software Inc. | ||
// | ||
#import <Foundation/Foundation.h> | ||
|
||
|
||
@interface NSMutableArray (QueueAdditions) | ||
|
||
- (id) pop; | ||
- (id) queueHead; | ||
- (id) dequeue; | ||
- (void) enqueue:(id)obj; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// | ||
// NSMutableArray+QueueAdditions.h | ||
// | ||
// Created by Shazron Abdullah | ||
// Copyright 2011 Nitobi Software Inc. | ||
// | ||
|
||
#import "NSMutableArray+QueueAdditions.h" | ||
|
||
@implementation NSMutableArray (QueueAdditions) | ||
|
||
- (id) queueHead | ||
{ | ||
if ([self count] == 0) { | ||
return nil; | ||
} | ||
|
||
return [self objectAtIndex:0]; | ||
} | ||
|
||
- (id) dequeue | ||
{ | ||
if ([self count] == 0) { | ||
return nil; | ||
} | ||
|
||
id head = [self objectAtIndex:0]; | ||
if (head != nil) { | ||
[[head retain] autorelease]; | ||
[self removeObjectAtIndex:0]; | ||
} | ||
|
||
return head; | ||
} | ||
|
||
- (id) pop | ||
{ | ||
return [self dequeue]; | ||
} | ||
|
||
- (void) enqueue:(id)object | ||
{ | ||
[self addObject:object]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters