| 2502 | } |
| 2503 | |
| 2504 | File File::withFileExtension (const String& newExtension) const |
| 2505 | { |
| 2506 | if (fullPath.isEmpty()) |
| 2507 | return File::nonexistent; |
| 2508 | |
| 2509 | String filePart (getFileName()); |
| 2510 | |
| 2511 | int i = filePart.lastIndexOfChar ('.'); |
| 2512 | if (i >= 0) |
| 2513 | filePart = filePart.substring (0, i); |
| 2514 | |
| 2515 | if (newExtension.isNotEmpty() && ! newExtension.startsWithChar ('.')) |
| 2516 | filePart << '.'; |
| 2517 | |
| 2518 | return getSiblingFile (filePart + newExtension); |
| 2519 | } |
| 2520 | |
| 2521 | bool File::startAsProcess (const String& parameters) const |
| 2522 | { |
no test coverage detected