forked from nolanw/HTMLReader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHTMLTextNode.m
More file actions
44 lines (35 loc) · 692 Bytes
/
HTMLTextNode.m
File metadata and controls
44 lines (35 loc) · 692 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
// HTMLTextNode.m
//
// Public domain. https://github.com/nolanw/HTMLReader
#import "HTMLTextNode.h"
@implementation HTMLTextNode
{
NSMutableString *_data;
}
- (instancetype)initWithData:(NSString *)data
{
if ((self = [super init])) {
_data = [NSMutableString stringWithString:data];
}
return self;
}
- (instancetype)init
{
return [self initWithData:@""];
}
- (void)appendString:(NSString *)string
{
[_data appendString:string];
}
- (NSString *)data
{
return [_data copy];
}
#pragma mark NSCopying
- (id)copyWithZone:(NSZone *)zone
{
HTMLTextNode *copy = [super copyWithZone:zone];
[copy->_data setString:_data];
return copy;
}
@end