2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
|
* removed, so return a new string anyway.
*/
if (i < 0)
i = 0;
return [self substringWithRange: of_range(i, length - i)];
}
- (OFString*)stringByDeletingLastPathComponent
{
void *pool;
const of_unichar_t *characters;
size_t i, length = [self length];
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
|
* removed, so return a new string anyway.
*/
if (i < 0)
i = 0;
return [self substringWithRange: of_range(i, length - i)];
}
- (OFString*)pathExtension
{
void *pool = objc_autoreleasePoolPush();
OFString *ret, *fileName;
size_t pos;
fileName = [self lastPathComponent];
pos = [fileName rangeOfString: @"."
options: OF_STRING_SEARCH_BACKWARDS].location;
if (pos == OF_NOT_FOUND || pos == 0)
return @"";
ret = [fileName substringWithRange:
of_range(pos + 1, [fileName length] - pos - 1)];
[ret retain];
objc_autoreleasePoolPop(pool);
return [ret autorelease];
}
- (OFString*)stringByDeletingLastPathComponent
{
void *pool;
const of_unichar_t *characters;
size_t i, length = [self length];
|
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
|
[components replaceObjectAtIndex: [components count] - 1
withObject: fileName];
ret = [OFString pathWithComponents: components];
[ret retain];
objc_autoreleasePoolPop(pool);
return [ret autorelease];
}
- (OFString*)stringByStandardizingPath
{
return standardize_path([self pathComponents],
OF_PATH_CURRENT_DIRECTORY, OF_PATH_PARENT_DIRECTORY,
|
<
|
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
|
[components replaceObjectAtIndex: [components count] - 1
withObject: fileName];
ret = [OFString pathWithComponents: components];
[ret retain];
objc_autoreleasePoolPop(pool);
return [ret autorelease];
}
- (OFString*)stringByStandardizingPath
{
return standardize_path([self pathComponents],
OF_PATH_CURRENT_DIRECTORY, OF_PATH_PARENT_DIRECTORY,
|