-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPBGraphCellInfo.m
56 lines (45 loc) · 1.12 KB
/
PBGraphCellInfo.m
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
47
48
49
50
51
52
53
54
55
56
//
// PBGraphCellInfo.m
// GitX
//
// Created by Pieter de Bie on 27-08-08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "PBGraphCellInfo.h"
@implementation PBGraphCellInfo
@synthesize nLines, position, numColumns, sign;
- (id)initWithPosition:(long)p andLines:(struct PBGitGraphLine *)l
{
position = p;
lines = l;
return self;
}
- (struct PBGitGraphLine *)lines
{
return lines;
}
- (void)setLines:(struct PBGitGraphLine *)l
{
free(lines);
lines = l;
}
- (NSString *)description
{
return [self debugDescription];
}
- (NSString *)debugDescription
{
NSMutableString *desc = [NSMutableString stringWithFormat:@"<%@: %p position: %ld numColumns: %ld nLines: %ld sign: '%c'>",
NSStringFromClass([self class]), self, position, numColumns, nLines, sign];
for (int lineIndex = 0; lineIndex < nLines; lineIndex++) {
struct PBGitGraphLine line = lines[lineIndex];
[desc appendString:[NSString stringWithFormat:@"\n\t<upper: %d from: %d to: %d colorIndex: %d>",
line.upper, line.from, line.to, line.colorIndex]];
}
return desc;
}
- (void)dealloc
{
free(lines);
}
@end