diff --git a/examples/Assets/DemoUtilities.h b/examples/Assets/DemoUtilities.h index 1c5534bff7..4f1f0f2631 100644 --- a/examples/Assets/DemoUtilities.h +++ b/examples/Assets/DemoUtilities.h @@ -63,7 +63,7 @@ inline File getExamplesDirectory() noexcept return File { CharPointer_UTF8 { PIP_JUCE_EXAMPLES_DIRECTORY_STRING } }; #else auto currentFile = File::getSpecialLocation (File::SpecialLocationType::currentApplicationFile); - auto exampleDir = currentFile.getParentDirectory().getChildFile ("examples"); + auto exampleDir = currentFile.getSiblingFile ("examples"); if (exampleDir.exists()) return exampleDir; @@ -109,10 +109,10 @@ inline std::unique_ptr createAssetInputStream (const char* resource #else #if JUCE_IOS auto assetsDir = File::getSpecialLocation (File::currentExecutableFile) - .getParentDirectory().getChildFile ("Assets"); + .getSiblingFile ("Assets"); #elif JUCE_MAC auto assetsDir = File::getSpecialLocation (File::currentExecutableFile) - .getParentDirectory().getParentDirectory().getChildFile ("Resources").getChildFile ("Assets"); + .getParentDirectory().getSiblingFile ("Resources").getChildFile ("Assets"); if (! assetsDir.exists()) assetsDir = getExamplesDirectory().getChildFile ("Assets"); diff --git a/examples/DemoRunner/Builds/Android/app/src/main/assets/DemoUtilities.h b/examples/DemoRunner/Builds/Android/app/src/main/assets/DemoUtilities.h index 1c5534bff7..4f1f0f2631 100644 --- a/examples/DemoRunner/Builds/Android/app/src/main/assets/DemoUtilities.h +++ b/examples/DemoRunner/Builds/Android/app/src/main/assets/DemoUtilities.h @@ -63,7 +63,7 @@ inline File getExamplesDirectory() noexcept return File { CharPointer_UTF8 { PIP_JUCE_EXAMPLES_DIRECTORY_STRING } }; #else auto currentFile = File::getSpecialLocation (File::SpecialLocationType::currentApplicationFile); - auto exampleDir = currentFile.getParentDirectory().getChildFile ("examples"); + auto exampleDir = currentFile.getSiblingFile ("examples"); if (exampleDir.exists()) return exampleDir; @@ -109,10 +109,10 @@ inline std::unique_ptr createAssetInputStream (const char* resource #else #if JUCE_IOS auto assetsDir = File::getSpecialLocation (File::currentExecutableFile) - .getParentDirectory().getChildFile ("Assets"); + .getSiblingFile ("Assets"); #elif JUCE_MAC auto assetsDir = File::getSpecialLocation (File::currentExecutableFile) - .getParentDirectory().getParentDirectory().getChildFile ("Resources").getChildFile ("Assets"); + .getParentDirectory().getSiblingFile ("Resources").getChildFile ("Assets"); if (! assetsDir.exists()) assetsDir = getExamplesDirectory().getChildFile ("Assets"); diff --git a/examples/DemoRunner/Source/Demos/JUCEDemos.cpp b/examples/DemoRunner/Source/Demos/JUCEDemos.cpp index e6b42fad4d..506c27da8c 100644 --- a/examples/DemoRunner/Source/Demos/JUCEDemos.cpp +++ b/examples/DemoRunner/Source/Demos/JUCEDemos.cpp @@ -50,7 +50,7 @@ void JUCEDemos::registerDemo (std::function constructorCallback, c { #if JUCE_MAC auto f = File::getSpecialLocation (File::currentExecutableFile) - .getParentDirectory().getParentDirectory().getChildFile ("Resources"); + .getParentDirectory().getSiblingFile ("Resources"); #else auto f = findExamplesDirectoryFromExecutable (File::getSpecialLocation (File::currentApplicationFile)); #endif @@ -69,7 +69,7 @@ void JUCEDemos::registerDemo (std::function constructorCallback, c File JUCEDemos::findExamplesDirectoryFromExecutable (File exec) { int numTries = 15; - auto exampleDir = exec.getParentDirectory().getChildFile ("examples"); + auto exampleDir = exec.getSiblingFile ("examples"); if (exampleDir.exists()) return exampleDir; diff --git a/extras/AudioPluginHost/Builds/Android/app/src/main/assets/DemoUtilities.h b/extras/AudioPluginHost/Builds/Android/app/src/main/assets/DemoUtilities.h index 1c5534bff7..4f1f0f2631 100644 --- a/extras/AudioPluginHost/Builds/Android/app/src/main/assets/DemoUtilities.h +++ b/extras/AudioPluginHost/Builds/Android/app/src/main/assets/DemoUtilities.h @@ -63,7 +63,7 @@ inline File getExamplesDirectory() noexcept return File { CharPointer_UTF8 { PIP_JUCE_EXAMPLES_DIRECTORY_STRING } }; #else auto currentFile = File::getSpecialLocation (File::SpecialLocationType::currentApplicationFile); - auto exampleDir = currentFile.getParentDirectory().getChildFile ("examples"); + auto exampleDir = currentFile.getSiblingFile ("examples"); if (exampleDir.exists()) return exampleDir; @@ -109,10 +109,10 @@ inline std::unique_ptr createAssetInputStream (const char* resource #else #if JUCE_IOS auto assetsDir = File::getSpecialLocation (File::currentExecutableFile) - .getParentDirectory().getChildFile ("Assets"); + .getSiblingFile ("Assets"); #elif JUCE_MAC auto assetsDir = File::getSpecialLocation (File::currentExecutableFile) - .getParentDirectory().getParentDirectory().getChildFile ("Resources").getChildFile ("Assets"); + .getParentDirectory().getSiblingFile ("Resources").getChildFile ("Assets"); if (! assetsDir.exists()) assetsDir = getExamplesDirectory().getChildFile ("Assets"); diff --git a/extras/Projucer/Source/Utility/PIPs/jucer_PIPGenerator.cpp b/extras/Projucer/Source/Utility/PIPs/jucer_PIPGenerator.cpp index 11f7698cae..4e66e8afed 100644 --- a/extras/Projucer/Source/Utility/PIPs/jucer_PIPGenerator.cpp +++ b/extras/Projucer/Source/Utility/PIPs/jucer_PIPGenerator.cpp @@ -507,7 +507,7 @@ Array PIPGenerator::replaceRelativeIncludesAndGetFilesToMove() if (path.startsWith ("<") && path.endsWith (">")) continue; - auto file = pipFile.getParentDirectory().getChildFile (path); + auto file = pipFile.getSiblingFile (path); files.add (file); line = line.replace (path, file.getFileName()); diff --git a/modules/juce_core/files/juce_File.cpp b/modules/juce_core/files/juce_File.cpp index 073ee8e925..ebc5a95796 100644 --- a/modules/juce_core/files/juce_File.cpp +++ b/modules/juce_core/files/juce_File.cpp @@ -1158,10 +1158,10 @@ public: expect (home.getChildFile ("...xyz").getFileName() == "...xyz"); expect (home.getChildFile ("./xyz") == home.getChildFile ("xyz")); expect (home.getChildFile ("././xyz") == home.getChildFile ("xyz")); - expect (home.getChildFile ("../xyz") == home.getParentDirectory().getChildFile ("xyz")); - expect (home.getChildFile (".././xyz") == home.getParentDirectory().getChildFile ("xyz")); - expect (home.getChildFile (".././xyz/./abc") == home.getParentDirectory().getChildFile ("xyz/abc")); - expect (home.getChildFile ("./../xyz") == home.getParentDirectory().getChildFile ("xyz")); + expect (home.getChildFile ("../xyz") == home.getSiblingFile ("xyz")); + expect (home.getChildFile (".././xyz") == home.getSiblingFile ("xyz")); + expect (home.getChildFile (".././xyz/./abc") == home.getSiblingFile ("xyz/abc")); + expect (home.getChildFile ("./../xyz") == home.getSiblingFile ("xyz")); expect (home.getChildFile ("a1/a2/a3/./../../a4") == home.getChildFile ("a1/a4")); expect (! File().hasReadAccess()); diff --git a/modules/juce_gui_basics/drawables/juce_SVGParser.cpp b/modules/juce_gui_basics/drawables/juce_SVGParser.cpp index 04175c6e5c..56ce6b2bbd 100644 --- a/modules/juce_gui_basics/drawables/juce_SVGParser.cpp +++ b/modules/juce_gui_basics/drawables/juce_SVGParser.cpp @@ -1299,7 +1299,7 @@ private: } else { - auto linkedFile = originalFile.getParentDirectory().getChildFile (link); + auto linkedFile = originalFile.getSiblingFile (link); if (linkedFile.existsAsFile()) inputStream = linkedFile.createInputStream();