MCPcopy Create free account
hub / github.com/HumbleNet/HumbleNet / withFileExtension

Method withFileExtension

3rdparty/Amalgamate/juce_core_amalgam.cpp:2504–2519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2502}
2503
2504File 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
2521bool File::startAsProcess (const String& parameters) const
2522{

Callers 2

createTempFileMethod · 0.80
runTestMethod · 0.80

Calls 4

lastIndexOfCharMethod · 0.80
substringMethod · 0.80
startsWithCharMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected