| Comment: | OFString: Add -[substring{From,To}Index:] |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
4bbac7ab1704fa30fd24a214f001b324 |
| User & Date: | js on 2020-11-01 11:35:03 |
| Other Links: | manifest | tags |
|
2020-11-01
| ||
| 13:08 | Clean up .travis.yml by moving out scripts (check-in: 74857232b0 user: js tags: trunk) | |
| 11:35 | OFString: Add -[substring{From,To}Index:] (check-in: 4bbac7ab17 user: js tags: trunk) | |
|
2020-10-31
| ||
| 19:16 | OFHTTPClient: Remove didFailWithException (check-in: 7f102e8c95 user: js tags: trunk) | |
Modified src/OFApplication.m from [818d93f949] to [ba8b4a32b1].
| ︙ | |||
255 256 257 258 259 260 261 | 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | - + - - + - |
if (pos == OF_NOT_FOUND) {
fprintf(stderr,
"Warning: Invalid environment "
"variable: %s\n", tmp.UTF8String);
continue;
}
|
| ︙ | |||
301 302 303 304 305 306 307 | 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | - + - - + - |
if (pos == OF_NOT_FOUND) {
fprintf(stderr,
"Warning: Invalid environment "
"variable: %s\n", tmp.UTF8String);
continue;
}
|
| ︙ |
Modified src/OFConstantString.m from [0adc85a65a] to [a6f51dcbb3].
| ︙ | |||
400 401 402 403 404 405 406 407 408 409 410 411 412 413 | 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 | + + + + + + + + + + + + + + |
- (bool)containsString: (OFString *)string
{
[self finishInitialization];
return [self containsString: string];
}
- (OFString *)substringFromIndex: (size_t)idx
{
[self finishInitialization];
return [self substringFromIndex: idx];
}
- (OFString *)substringToIndex: (size_t)idx
{
[self finishInitialization];
return [self substringToIndex: idx];
}
- (OFString *)substringWithRange: (of_range_t)range
{
[self finishInitialization];
return [self substringWithRange: range];
}
|
| ︙ |
Modified src/OFDNSResolverSettings.m from [92fa7c4194] to [7c81772fe9].
| ︙ | |||
91 92 93 94 95 96 97 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | - + - |
} @catch (OFInvalidFormatException *e) {
/* Not an IP address -> we can use it if it contains a dot. */
size_t pos = [domain rangeOfString: @"."].location;
if (pos == OF_NOT_FOUND)
return nil;
|
| ︙ | |||
190 191 192 193 194 195 196 | 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | - + | void *pool2 = objc_autoreleasePoolPush(); OFArray *components, *hosts; size_t pos; OFString *address; pos = [line rangeOfString: @"#"].location; if (pos != OF_NOT_FOUND) |
| ︙ | |||
239 240 241 242 243 244 245 | 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | - + - - + - - + - - + - |
# if !defined(OF_WINDOWS) && !defined(OF_AMIGAOS4)
- (void)parseResolvConfOption: (OFString *)option
{
@try {
if ([option hasPrefix: @"ndots:"]) {
unsigned long long number;
|
| ︙ | |||
304 305 306 307 308 309 310 | 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | - + | void *pool2 = objc_autoreleasePoolPush(); size_t pos; OFArray *components, *arguments; OFString *option; pos = [line indexOfCharacterFromSet: commentCharacters]; if (pos != OF_NOT_FOUND) |
| ︙ |
Modified src/OFHTTPClient.m from [62848f22ab] to [c27ed01d4c].
| ︙ | |||
998 999 1000 1001 1002 1003 1004 | 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 | - + - - - + + + - - + - |
if (_toRead == 0)
_toRead = -2;
return length;
} else {
void *pool = objc_autoreleasePoolPush();
OFString *line;
|
| ︙ |
Modified src/OFHTTPCookieManager.m from [0f44cd343b] to [f3b5caf32a].
| ︙ | |||
134 135 136 137 138 139 140 | 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | - - + + |
cookieDomain = cookie.domain.lowercaseString;
URLHost = URL.host.lowercaseString;
if ([cookieDomain hasPrefix: @"."]) {
if ([URLHost hasSuffix: cookieDomain])
match = true;
else {
|
| ︙ |
Modified src/OFHTTPServer.m from [28acc739df] to [59a786282c].
| ︙ | |||
372 373 374 375 376 377 378 | 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 | - + | return [self sendErrorAndClose: 400]; } pos = [line rangeOfString: @" "].location; if (pos == OF_NOT_FOUND) return [self sendErrorAndClose: 400]; |
| ︙ | |||
448 449 450 451 452 453 454 | 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 | - - + + - - + - - - - + | return false; } pos = [line rangeOfString: @":"].location; if (pos == OF_NOT_FOUND) return [self sendErrorAndClose: 400]; |
| ︙ | |||
544 545 546 547 548 549 550 | 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 | - - + + - |
URL.host = _host;
if (_port != 80)
URL.port = [OFNumber numberWithUnsignedShort: _port];
if ((pos = [_path rangeOfString: @"?"].location) != OF_NOT_FOUND) {
OFString *path, *query;
|
| ︙ | |||
694 695 696 697 698 699 700 | 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 | - + - - - + + + - - + - |
if (_toRead == 0)
_toRead = -2;
return length;
} else {
void *pool = objc_autoreleasePoolPush();
OFString *line;
|
| ︙ |
Modified src/OFINICategory.m from [4145f33ae0] to [ee9139e5e6].
| ︙ | |||
157 158 159 160 161 162 163 | 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | - - + - - - - + + + - - - | [[[OFINICategoryPair alloc] init] autorelease]; OFString *key, *value; size_t pos; if ((pos = [line rangeOfString: @"="].location) == OF_NOT_FOUND) @throw [OFInvalidFormatException exception]; |
| ︙ |
Modified src/OFINIFileSettings.m from [c8fa651c4c] to [062d94ddbb].
| ︙ | |||
63 64 65 66 67 68 69 | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | - - + + - |
if (pos == OF_NOT_FOUND) {
*category = @"";
*key = path;
return;
}
|
| ︙ |
Modified src/OFOptionsParser.m from [a777f53d6b] to [194fc0cb2f].
| ︙ | |||
193 194 195 196 197 198 199 | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | - + - - - - + + | size_t pos; of_options_parser_option_t *option; _lastOption = '-'; _index++; if ((pos = [argument rangeOfString: @"="].location) != |
| ︙ | |||
251 252 253 254 255 256 257 | 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | - + - | return _lastOption; } if (_index >= _arguments.count) return ':'; argument = [_arguments objectAtIndex: _index]; |
| ︙ |
Modified src/OFString.h from [670340b7ed] to [b31ea8640a].
| ︙ | |||
1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 | 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 | + + + + + + + + + + + + + + + + | * @brief Returns whether the string contains the specified string. * * @param string The string to search * @return Whether the string contains the specified string */ - (bool)containsString: (OFString *)string; /** * @brief Creates a substring from the specified index to the end. * * @param idx The index from where the substring should start, inclusive * @return The substring from the specified index to the end */ - (OFString *)substringFromIndex: (size_t)idx; /** * @brief Creates a substring from the beginning to the specified index. * * @param idx The index at which the substring should end, exclusive * @return The subtring from the beginning to the specified index */ - (OFString *)substringToIndex: (size_t)idx; /** * @brief Creates a substring with the specified range. * * @param range The range of the substring * @return The substring as a new autoreleased OFString */ - (OFString *)substringWithRange: (of_range_t)range; |
| ︙ |
Modified src/OFString.m from [25e18e82dd] to [b2cfcd4f85].
| ︙ | |||
1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 | 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 | + + + + + + + + + + |
}
}
objc_autoreleasePoolPop(pool);
return false;
}
- (OFString *)substringFromIndex: (size_t)idx
{
return [self substringWithRange: of_range(idx, self.length - idx)];
}
- (OFString *)substringToIndex: (size_t)idx
{
return [self substringWithRange: of_range(0, idx)];
}
- (OFString *)substringWithRange: (of_range_t)range
{
void *pool;
OFString *ret;
if (range.length > SIZE_MAX - range.location ||
|
| ︙ |
Modified src/OFURL.m from [0558fd50c5] to [a1fb3bc27c].
| ︙ | |||
1001 1002 1003 1004 1005 1006 1007 | 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 | - + |
if ([path isEqual: @"/"]) {
objc_autoreleasePoolPop(pool);
return @"/";
}
if ([path hasSuffix: @"/"])
|
| ︙ |
Modified src/OFXMLParser.m from [51abbe68ac] to [ff15f62058].
| ︙ | |||
412 413 414 415 416 417 418 | 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 | - + | bool hasVersion = false; if (!self->_acceptProlog) return false; self->_acceptProlog = false; |
| ︙ |
Modified src/platform/amiga/OFString+PathAdditions.m from [1ed97b2697] to [6f79ae7bc0].
| ︙ | |||
123 124 125 126 127 128 129 | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | - + - |
pos = [fileName rangeOfString: @"."
options: OF_STRING_SEARCH_BACKWARDS].location;
if (pos == OF_NOT_FOUND || pos == 0) {
objc_autoreleasePoolPop(pool);
return @"";
}
|
| ︙ | |||
183 184 185 186 187 188 189 | 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | - + |
pos = [fileName rangeOfString: @"."
options: OF_STRING_SEARCH_BACKWARDS].location;
if (pos == OF_NOT_FOUND || pos == 0) {
objc_autoreleasePoolPop(pool);
return [[self copy] autorelease];
}
|
| ︙ | |||
301 302 303 304 305 306 307 | 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | - + - + |
}
- (OFString *)of_URLPathToPathWithURLEncodedHost: (OFString *)URLEncodedHost
{
OFString *path = self;
if (path.length > 1 && [path hasSuffix: @"/"])
|
| ︙ |
Modified src/platform/libfat/OFString+PathAdditions.m from [b5e9ff2888] to [a4536de6b4].
| ︙ | |||
157 158 159 160 161 162 163 | 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | - + - |
pos = [fileName rangeOfString: @"."
options: OF_STRING_SEARCH_BACKWARDS].location;
if (pos == OF_NOT_FOUND || pos == 0) {
objc_autoreleasePoolPop(pool);
return @"";
}
|
| ︙ | |||
228 229 230 231 232 233 234 | 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | - + |
pos = [fileName rangeOfString: @"."
options: OF_STRING_SEARCH_BACKWARDS].location;
if (pos == OF_NOT_FOUND || pos == 0) {
objc_autoreleasePoolPop(pool);
return [[self copy] autorelease];
}
|
| ︙ | |||
330 331 332 333 334 335 336 | 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | - + - + |
}
- (OFString *)of_URLPathToPathWithURLEncodedHost: (OFString *)URLEncodedHost
{
OFString *path = self;
if (path.length > 1 && [path hasSuffix: @"/"])
|
Modified src/platform/posix/OFString+PathAdditions.m from [e173df7149] to [b28e56e3b6].
| ︙ | |||
150 151 152 153 154 155 156 | 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | - + - |
pos = [fileName rangeOfString: @"."
options: OF_STRING_SEARCH_BACKWARDS].location;
if (pos == OF_NOT_FOUND || pos == 0) {
objc_autoreleasePoolPop(pool);
return @"";
}
|
| ︙ | |||
220 221 222 223 224 225 226 | 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | - + |
pos = [fileName rangeOfString: @"."
options: OF_STRING_SEARCH_BACKWARDS].location;
if (pos == OF_NOT_FOUND || pos == 0) {
objc_autoreleasePoolPop(pool);
return [[self copy] autorelease];
}
|
| ︙ | |||
330 331 332 333 334 335 336 | 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | - + |
}
- (OFString *)of_URLPathToPathWithURLEncodedHost: (OFString *)URLEncodedHost
{
OFString *path = self;
if (path.length > 1 && [path hasSuffix: @"/"])
|
Modified src/platform/windows/OFString+PathAdditions.m from [c654a7d368] to [3c2f48d580].
| ︙ | |||
161 162 163 164 165 166 167 | 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | - + - |
pos = [fileName rangeOfString: @"."
options: OF_STRING_SEARCH_BACKWARDS].location;
if (pos == OF_NOT_FOUND || pos == 0) {
objc_autoreleasePoolPop(pool);
return @"";
}
|
| ︙ | |||
231 232 233 234 235 236 237 | 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | - + |
pos = [fileName rangeOfString: @"."
options: OF_STRING_SEARCH_BACKWARDS].location;
if (pos == OF_NOT_FOUND || pos == 0) {
objc_autoreleasePoolPop(pool);
return [[self copy] autorelease];
}
|
| ︙ | |||
354 355 356 357 358 359 360 | 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | - + - + |
- (OFString *)of_URLPathToPathWithURLEncodedHost: (OFString *)URLEncodedHost
{
OFString *path = self;
if (path.length > 1 && [path hasSuffix: @"/"] &&
![path hasSuffix: @":/"])
|
| ︙ |
Modified src/socket.m from [4343bc563f] to [2544d0730b].
| ︙ | |||
435 436 437 438 439 440 441 | 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 | - + - - + - |
addrIn6->sin6_family = AF_UNSPEC;
#endif
addrIn6->sin6_port = OF_BSWAP16_IF_LE(port);
doubleColon = [IPv6 rangeOfString: @"::"].location;
if (doubleColon != OF_NOT_FOUND) {
|
| ︙ |
Modified utils/ofhttp/OFHTTP.m from [1aec658c7f] to [c172d83732].
| ︙ | |||
321 322 323 324 325 326 327 | 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | - - + + - + - - + |
if (pos == OF_NOT_FOUND) {
[of_stderr writeLine: OF_LOCALIZED(@"invalid_input_header",
@"%[prog]: Headers must to be in format name:value!",
@"prog", [OFApplication programName])];
[OFApplication terminateWithStatus: 1];
}
|
| ︙ | |||
394 395 396 397 398 399 400 | 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 | - - - + + + | options: OF_STRING_SEARCH_BACKWARDS].location; OFString *host; unsigned long long port; if (pos == OF_NOT_FOUND) @throw [OFInvalidFormatException exception]; |
| ︙ |