| 378 | #endif |
| 379 | |
| 380 | File URL::fileFromFileSchemeURL (const URL& fileURL) |
| 381 | { |
| 382 | if (! fileURL.isLocalFile()) |
| 383 | { |
| 384 | jassertfalse; |
| 385 | return {}; |
| 386 | } |
| 387 | |
| 388 | auto path = removeEscapeChars (fileURL.getDomainInternal (true)).replace ("+", "%2B"); |
| 389 | |
| 390 | #if JUCE_WINDOWS |
| 391 | bool isUncPath = (! fileURL.url.startsWith ("file:///")); |
| 392 | #else |
| 393 | path = File::getSeparatorString() + path; |
| 394 | #endif |
| 395 | |
| 396 | auto urlElements = StringArray::fromTokens (fileURL.getSubPath(), "/", ""); |
| 397 | |
| 398 | for (auto urlElement : urlElements) |
| 399 | path += File::getSeparatorString() + removeEscapeChars (urlElement.replace ("+", "%2B")); |
| 400 | |
| 401 | #if JUCE_WINDOWS |
| 402 | if (isUncPath) |
| 403 | path = "\\\\" + path; |
| 404 | #endif |
| 405 | |
| 406 | return path; |
| 407 | } |
| 408 | |
| 409 | int URL::getPort() const |
| 410 | { |
nothing calls this directly
no test coverage detected