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
|
[_path release];
[_storage release];
[_sites release];
[super dealloc];
}
- (OFArray<OFString *> *)sites
{
void *pool = objc_autoreleasePoolPush();
OFArray *sites = [[_storage allKeys] sortedArray];
[sites retain];
objc_autoreleasePoolPop(pool);
return [sites autorelease];
}
- (size_t)sitesCount
{
return [_storage count];
}
- (bool)hasSite: (OFString *)name
{
return (_storage[name] != nil);
}
- (size_t)lengthForSite: (OFString *)name
{
|
|
>
>
>
>
|
>
>
>
>
>
>
<
<
<
<
<
|
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
110
111
112
|
[_path release];
[_storage release];
[_sites release];
[super dealloc];
}
- (OFArray<OFString *> *)sitesWithFilter: (OFString *)filter
{
void *pool = objc_autoreleasePoolPush();
/*
* FIXME: We need case folding here, but there is no method for it yet.
*/
filter = [filter lowercaseString];
OFArray *sites = [[[_storage allKeys] sortedArray]
filteredArrayUsingBlock: ^ (id name, size_t index) {
if (filter == nil)
return true;
return [[name lowercaseString] containsString: filter];
}];
[sites retain];
objc_autoreleasePoolPop(pool);
return [sites autorelease];
}
- (bool)hasSite: (OFString *)name
{
return (_storage[name] != nil);
}
- (size_t)lengthForSite: (OFString *)name
{
|