forked from NSGod/ichm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CHMSearchResult.m
49 lines (37 loc) · 1.16 KB
/
CHMSearchResult.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
//
// CHMSearchResult.m
// ichm
//
// Created by Mark Douma on 4/27/2016.
// Copyright © 2016 Mark Douma LLC. All rights reserved.
//
#import "CHMSearchResult.h"
#import "CHMLinkItem.h"
#import "CHMKitPrivateInterfaces.h"
@implementation CHMSearchResult
@synthesize linkItem;
@synthesize score;
- (id)initWithLinkItem:(CHMLinkItem *)anItem score:(CGFloat)aScore {
if ((self = [super init])) {
linkItem = [anItem retain];
score = aScore;
}
return self;
}
- (void)dealloc {
[linkItem release];
[super dealloc];
}
- (NSString *)description {
NSMutableString *description = nil;
if (score) {
description = [NSMutableString stringWithFormat:@"<%@> score == %0.3f\r", NSStringFromClass([self class]), score];
} else {
description = [NSMutableString stringWithFormat:@"<%@>\r", NSStringFromClass([self class])];
}
[description appendFormat:@" linkItem == %@\r\r", linkItem];
// [description replaceOccurrencesOfString:@"\\n" withString:@"\r" options:0 range:NSMakeRange(0, description.length)];
// [description replaceOccurrencesOfString:@"\\\"" withString:@" " options:0 range:NSMakeRange(0, description.length)];
return description;
}
@end