forked from fortinmike/XcodeBoost
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMFSymbol.m
More file actions
39 lines (31 loc) · 848 Bytes
/
MFSymbol.m
File metadata and controls
39 lines (31 loc) · 848 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
//
// MFSymbol.m
// XcodeBoost
//
// Created by Michaël Fortin on 2014-05-26.
// Copyright (c) 2014 Michaël Fortin. All rights reserved.
//
#import "MFSymbol.h"
@implementation MFSymbol
- (id)initWithType:(MFSymbolType)type matchRange:(NSRange)matchRange matchText:(NSString *)matchText
{
self = [super init];
if (self)
{
_type = type;
_matchRange = matchRange;
_matchText = matchText;
// Unless manually specified, default to match range and text
_range = matchRange;
_text = matchText;
}
return self;
}
#pragma mark NSObject Overrides
- (NSString *)description
{
NSUInteger start = self.range.location;
NSUInteger end = self.range.location + self.range.length;
return [[super description] stringByAppendingFormat:@" %@ (type %d), %ld..%ld", self.text, (int)self.type, start, end];
}
@end