This repository was archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFeedEntry.m
More file actions
109 lines (86 loc) · 1.44 KB
/
FeedEntry.m
File metadata and controls
109 lines (86 loc) · 1.44 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//
// FeedEntry.m
//
#import "FeedEntry.h"
@implementation FeedEntry
@synthesize title;
@synthesize description;
@synthesize date;
@synthesize isRead;
@synthesize feedID;
+ (FeedEntry *)entryWithPSEntry:(PSEntry *)entry
{
return [[[FeedEntry alloc] initWithEntry:entry] autorelease];
}
- (id) initWithEntry:(PSEntry *)entry
{
self = [super init];
if (self != nil)
{
_entry = [entry retain];
feedID = -1;
}
return self;
}
- (void) dealloc
{
[_entry release];
[title release];
[description release];
[super dealloc];
}
- (id)copyWithZone:(NSZone *)zone
{
FeedEntry *copy = [[FeedEntry alloc] initWithEntry:_entry];
[copy setFeedID:feedID];
return copy;
}
- (NSDate *)date
{
return [_entry dateForDisplay];
}
- (NSURL *)url
{
return [_entry alternateURL];
}
- (NSString *)description
{
return [[_entry content] plainTextString];
}
- (NSString *)title
{
return [_entry title];
}
- (BOOL)isRead
{
return [_entry isRead];
}
- (void)setIsRead:(BOOL)read
{
[_entry setRead:read];
}
- (BOOL)isEqual:(id)object
{
BOOL is;
if(![object isKindOfClass:[FeedEntry class]])
{
is = NO;
}
else
{
if ([[self url] isEqual:[object url]])
{
is = YES;
}
else
{
is = NO;
}
}
return is;
}
- (NSUInteger)hash
{
return [[self url] hash];
}
@end