forked from nolanw/HTMLReader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HTMLDocumentType.m
42 lines (32 loc) · 1019 Bytes
/
HTMLDocumentType.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
// HTMLDocumentType.m
//
// Public domain. https://github.com/nolanw/HTMLReader
#import "HTMLDocumentType.h"
#import "HTMLDocument.h"
NS_ASSUME_NONNULL_BEGIN
@implementation HTMLDocumentType
- (instancetype)initWithName:(NSString *)name publicIdentifier:(NSString * __nullable)publicIdentifier systemIdentifier:(NSString * __nullable)systemIdentifier
{
NSParameterAssert(name);
if ((self = [super init])) {
_name = [name copy];
_publicIdentifier = [publicIdentifier copy] ?: @"";
_systemIdentifier = [systemIdentifier copy] ?: @"";
}
return self;
}
- (instancetype)init
{
return [self initWithName:@"html" publicIdentifier:nil systemIdentifier:nil];
}
#pragma mark NSCopying
- (id)copyWithZone:(NSZone * __nullable)zone
{
HTMLDocumentType *copy = [super copyWithZone:zone];
copy->_name = self.name;
copy->_publicIdentifier = self.publicIdentifier;
copy->_systemIdentifier = self.systemIdentifier;
return copy;
}
@end
NS_ASSUME_NONNULL_END