forked from SVGKit/SVGKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNodeList.m
More file actions
46 lines (34 loc) · 974 Bytes
/
Copy pathNodeList.m
File metadata and controls
46 lines (34 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
#import "NodeList.h"
#import "NodeList+Mutable.h"
@implementation NodeList
@synthesize internalArray;
- (id)init {
self = [super init];
if (self) {
self.internalArray = [NSMutableArray array];
}
return self;
}
- (void)dealloc {
self.internalArray = nil;
[super dealloc];
}
-(Node*) item:(NSUInteger) index
{
return [self.internalArray objectAtIndex:index];
}
-(NSUInteger)length
{
return [self.internalArray count];
}
#pragma mark - ADDITIONAL to SVG Spec: Objective-C support for fast-iteration ("for * in ..." syntax)
-(NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id [])buffer count:(NSUInteger)len
{
return [self.internalArray countByEnumeratingWithState:state objects:buffer count:len];
}
#pragma mark - ADDITIONAL to SVG Spec: useful debug / output / description methods
-(NSString *)description
{
return [NSString stringWithFormat:@"NodeList: array(%@)", self.internalArray];
}
@end