diff --git a/doc/generated/atlas.cpp b/doc/generated/atlas.cpp index 1452e1d05..a9024c2d4 100644 --- a/doc/generated/atlas.cpp +++ b/doc/generated/atlas.cpp @@ -124,7 +124,7 @@ int main() { } { constexpr Float displaySizeDivisor = 1.0f; - Containers::Optional> sizeData = Utility::Path::read(Utility::Path::join(Utility::Path::split(__FILE__).first(), "../../src/Magnum/TextureTools/Test/AtlasTestFiles/oxygen-glyphs.bin")); + Containers::Optional> sizeData = Utility::Path::read(Utility::Path::join(Utility::Path::path(__FILE__), "../../src/Magnum/TextureTools/Test/AtlasTestFiles/oxygen-glyphs.bin")); CORRADE_INTERNAL_ASSERT(sizeData); auto sizes16 = Containers::arrayCast(*sizeData); diff --git a/src/Magnum/DebugTools/CompareImage.cpp b/src/Magnum/DebugTools/CompareImage.cpp index bba9786b4..3bc929ef7 100644 --- a/src/Magnum/DebugTools/CompareImage.cpp +++ b/src/Magnum/DebugTools/CompareImage.cpp @@ -783,7 +783,7 @@ void ImageComparatorBase::saveDiagnostic(TestSuite::ComparisonStatusFlags, Utili } const ImageView2D image{PixelStorage{}.setAlignment(1), _state->actualFormat, Vector2i{Int(pixels.size()[1]), Int(pixels.size()[0])}, data}; - const Containers::String filename = Utility::Path::join(path, Utility::Path::split(_state->expectedFilename).second()); + const Containers::String filename = Utility::Path::join(path, Utility::Path::filename(_state->expectedFilename)); /* Export the data the base view/view comparator saved. Ignore failures, we're in the middle of a fail anyway (and everything will print messages diff --git a/src/Magnum/GL/Test/RendererGLTest.cpp b/src/Magnum/GL/Test/RendererGLTest.cpp index f50bf8d7a..ba54fed67 100644 --- a/src/Magnum/GL/Test/RendererGLTest.cpp +++ b/src/Magnum/GL/Test/RendererGLTest.cpp @@ -116,7 +116,7 @@ RendererGLTest::RendererGLTest() { && std::getenv("SIMULATOR_UDID") #endif ) { - _testDir = Utility::Path::join(Utility::Path::split(*Utility::Path::executableLocation()).first(), "RendererGLTestFiles"); + _testDir = Utility::Path::join(Utility::Path::path(*Utility::Path::executableLocation()), "RendererGLTestFiles"); } else #endif { diff --git a/src/Magnum/SceneTools/sceneconverter.cpp b/src/Magnum/SceneTools/sceneconverter.cpp index 3a7f4e350..a860087b7 100644 --- a/src/Magnum/SceneTools/sceneconverter.cpp +++ b/src/Magnum/SceneTools/sceneconverter.cpp @@ -586,7 +586,7 @@ well, the IDs reference attributes of the first mesh.)") PluginManager::Manager importerManager{ #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT args.value("plugin-dir").empty() ? Containers::String{} : - Utility::Path::join(args.value("plugin-dir"), Utility::Path::split(Trade::AbstractImporter::pluginSearchPaths().back()).second()) + Utility::Path::join(args.value("plugin-dir"), Utility::Path::filename(Trade::AbstractImporter::pluginSearchPaths().back())) #endif }; @@ -596,7 +596,7 @@ well, the IDs reference attributes of the first mesh.)") PluginManager::Manager imageConverterManager{ #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT args.value("plugin-dir").empty() ? Containers::String{} : - Utility::Path::join(args.value("plugin-dir"), Utility::Path::split(Trade::AbstractImageConverter::pluginSearchPaths().back()).second()) + Utility::Path::join(args.value("plugin-dir"), Utility::Path::filename(Trade::AbstractImageConverter::pluginSearchPaths().back())) #endif }; @@ -604,7 +604,7 @@ well, the IDs reference attributes of the first mesh.)") PluginManager::Manager converterManager{ #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT args.value("plugin-dir").empty() ? Containers::String{} : - Utility::Path::join(args.value("plugin-dir"), Utility::Path::split(Trade::AbstractSceneConverter::pluginSearchPaths().back()).second()) + Utility::Path::join(args.value("plugin-dir"), Utility::Path::filename(Trade::AbstractSceneConverter::pluginSearchPaths().back())) #endif }; converterManager.registerExternalManager(imageConverterManager); diff --git a/src/Magnum/ShaderTools/shaderconverter.cpp b/src/Magnum/ShaderTools/shaderconverter.cpp index c74b16360..e13d16fd5 100644 --- a/src/Magnum/ShaderTools/shaderconverter.cpp +++ b/src/Magnum/ShaderTools/shaderconverter.cpp @@ -369,7 +369,7 @@ see documentation of a particular converter for more information.)") PluginManager::Manager converterManager{ #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT args.value("plugin-dir").empty() ? Containers::String{} : - Utility::Path::join(args.value("plugin-dir"), Utility::Path::split(ShaderTools::AbstractConverter::pluginSearchPaths().back()).second()) + Utility::Path::join(args.value("plugin-dir"), Utility::Path::filename(ShaderTools::AbstractConverter::pluginSearchPaths().back())) #endif }; diff --git a/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp b/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp index e8cdcb199..3d321f239 100644 --- a/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp +++ b/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp @@ -35,11 +35,6 @@ #include #include -#ifdef CORRADE_TARGET_APPLE -#include -#include /* isSandboxed() */ -#endif - #include "Magnum/Image.h" #include "Magnum/ImageView.h" #include "Magnum/PixelFormat.h" @@ -395,7 +390,7 @@ DistanceFieldVectorGLTest::DistanceFieldVectorGLTest() { && std::getenv("SIMULATOR_UDID") #endif ) { - _testDir = Utility::Path::split(*Utility::Path::executableLocation()).first(); + _testDir = Utility::Path::path(*Utility::Path::executableLocation()); } else #endif { diff --git a/src/Magnum/Shaders/Test/FlatGLTest.cpp b/src/Magnum/Shaders/Test/FlatGLTest.cpp index d7748adf5..66609aee0 100644 --- a/src/Magnum/Shaders/Test/FlatGLTest.cpp +++ b/src/Magnum/Shaders/Test/FlatGLTest.cpp @@ -36,11 +36,6 @@ #include #include -#ifdef CORRADE_TARGET_APPLE -#include -#include /* isSandboxed() */ -#endif - #include "Magnum/Image.h" #include "Magnum/ImageView.h" #include "Magnum/PixelFormat.h" @@ -1174,7 +1169,7 @@ FlatGLTest::FlatGLTest() { && std::getenv("SIMULATOR_UDID") #endif ) { - _testDir = Utility::Path::split(*Utility::Path::executableLocation()).first(); + _testDir = Utility::Path::path(*Utility::Path::executableLocation()); } else #endif { diff --git a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp index 9f1134b0f..e4c98458b 100644 --- a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp +++ b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp @@ -37,11 +37,6 @@ #include #include -#ifdef CORRADE_TARGET_APPLE -#include -#include /* isSandboxed() */ -#endif - #include "Magnum/DebugTools/ColorMap.h" #include "Magnum/DebugTools/CompareImage.h" #include "Magnum/GL/Context.h" @@ -1765,7 +1760,7 @@ MeshVisualizerGLTest::MeshVisualizerGLTest() { && std::getenv("SIMULATOR_UDID") #endif ) { - _testDir = Utility::Path::split(*Utility::Path::executableLocation()).first(); + _testDir = Utility::Path::path(*Utility::Path::executableLocation()); } else #endif { diff --git a/src/Magnum/Shaders/Test/PhongGLTest.cpp b/src/Magnum/Shaders/Test/PhongGLTest.cpp index 9d6703496..c2416ce3f 100644 --- a/src/Magnum/Shaders/Test/PhongGLTest.cpp +++ b/src/Magnum/Shaders/Test/PhongGLTest.cpp @@ -37,10 +37,6 @@ #include #include -#ifdef CORRADE_TARGET_APPLE -#include -#endif - #include "Magnum/Image.h" #include "Magnum/ImageView.h" #include "Magnum/PixelFormat.h" @@ -1557,7 +1553,7 @@ PhongGLTest::PhongGLTest() { && std::getenv("SIMULATOR_UDID") #endif ) { - _testDir = Utility::Path::split(*Utility::Path::executableLocation()).first(); + _testDir = Utility::Path::path(*Utility::Path::executableLocation()); } else #endif { diff --git a/src/Magnum/Shaders/Test/VectorGLTest.cpp b/src/Magnum/Shaders/Test/VectorGLTest.cpp index 9dd0c7a85..9c4278397 100644 --- a/src/Magnum/Shaders/Test/VectorGLTest.cpp +++ b/src/Magnum/Shaders/Test/VectorGLTest.cpp @@ -35,11 +35,6 @@ #include #include -#ifdef CORRADE_TARGET_APPLE -#include -#include /* isSandboxed() */ -#endif - #include "Magnum/Image.h" #include "Magnum/ImageView.h" #include "Magnum/PixelFormat.h" @@ -391,7 +386,7 @@ VectorGLTest::VectorGLTest() { && std::getenv("SIMULATOR_UDID") #endif ) { - _testDir = Utility::Path::split(*Utility::Path::executableLocation()).first(); + _testDir = Utility::Path::path(*Utility::Path::executableLocation()); } else #endif { diff --git a/src/Magnum/Shaders/Test/VertexColorGLTest.cpp b/src/Magnum/Shaders/Test/VertexColorGLTest.cpp index 098bc1d2f..e930df2c7 100644 --- a/src/Magnum/Shaders/Test/VertexColorGLTest.cpp +++ b/src/Magnum/Shaders/Test/VertexColorGLTest.cpp @@ -34,11 +34,6 @@ #include #include -#ifdef CORRADE_TARGET_APPLE -#include -#include /* isSandboxed() */ -#endif - #include "Magnum/DebugTools/CompareImage.h" #include "Magnum/Image.h" #include "Magnum/ImageView.h" @@ -344,7 +339,7 @@ VertexColorGLTest::VertexColorGLTest() { && std::getenv("SIMULATOR_UDID") #endif ) { - _testDir = Utility::Path::split(*Utility::Path::executableLocation()).first(); + _testDir = Utility::Path::path(*Utility::Path::executableLocation()); } else #endif { diff --git a/src/Magnum/Text/fontconverter.cpp b/src/Magnum/Text/fontconverter.cpp index 905fef4ce..56d15d97e 100644 --- a/src/Magnum/Text/fontconverter.cpp +++ b/src/Magnum/Text/fontconverter.cpp @@ -24,7 +24,6 @@ DEALINGS IN THE SOFTWARE. */ -#include #include #include #include @@ -165,7 +164,7 @@ int FontConverter::exec() { PluginManager::Manager imageConverterManager{ #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT args.value("plugin-dir").empty() ? Containers::String{} : - Utility::Path::join(args.value("plugin-dir"), Utility::Path::split(Trade::AbstractImageConverter::pluginSearchPaths().back()).second()) + Utility::Path::join(args.value("plugin-dir"), Utility::Path::filename(Trade::AbstractImageConverter::pluginSearchPaths().back())) #endif }; @@ -173,7 +172,7 @@ int FontConverter::exec() { PluginManager::Manager fontManager{ #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT args.value("plugin-dir").empty() ? Containers::String{} : - Utility::Path::join(args.value("plugin-dir"), Utility::Path::split(AbstractFont::pluginSearchPaths().back()).second()) + Utility::Path::join(args.value("plugin-dir"), Utility::Path::filename(AbstractFont::pluginSearchPaths().back())) #endif }; Containers::Pointer font = fontManager.loadAndInstantiate(args.value("font")); @@ -184,7 +183,7 @@ int FontConverter::exec() { PluginManager::Manager converterManager{ #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT args.value("plugin-dir").empty() ? Containers::String{} : - Utility::Path::join(args.value("plugin-dir"), Utility::Path::split(AbstractFontConverter::pluginSearchPaths().back()).second()) + Utility::Path::join(args.value("plugin-dir"), Utility::Path::filename(AbstractFontConverter::pluginSearchPaths().back())) #endif }; converterManager.registerExternalManager(imageConverterManager); diff --git a/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp b/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp index 4c7d4b91d..4026de0df 100644 --- a/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp +++ b/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp @@ -31,7 +31,6 @@ #include #ifdef CORRADE_TARGET_APPLE -#include #include /* isSandboxed() */ #endif @@ -125,7 +124,7 @@ DistanceFieldGLTest::DistanceFieldGLTest() { && std::getenv("SIMULATOR_UDID") #endif ) { - _testDir = Utility::Path::join(Utility::Path::split(*Utility::Path::executableLocation()).first(), "DistanceFieldGLTestFiles"); + _testDir = Utility::Path::join(Utility::Path::path(*Utility::Path::executableLocation()), "DistanceFieldGLTestFiles"); } else #endif { diff --git a/src/Magnum/TextureTools/distancefieldconverter.cpp b/src/Magnum/TextureTools/distancefieldconverter.cpp index 0b29e38be..0044588ab 100644 --- a/src/Magnum/TextureTools/distancefieldconverter.cpp +++ b/src/Magnum/TextureTools/distancefieldconverter.cpp @@ -25,7 +25,6 @@ */ #include -#include #include #include /** @todo remove once Arguments is std::string-free */ #include @@ -165,7 +164,7 @@ int DistanceFieldConverter::exec() { PluginManager::Manager importerManager{ #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT args.value("plugin-dir").empty() ? Containers::String{} : - Utility::Path::join(args.value("plugin-dir"), Utility::Path::split(Trade::AbstractImporter::pluginSearchPaths().back()).second()) + Utility::Path::join(args.value("plugin-dir"), Utility::Path::filename(Trade::AbstractImporter::pluginSearchPaths().back())) #endif }; Containers::Pointer importer = importerManager.loadAndInstantiate(args.value("importer")); @@ -175,7 +174,7 @@ int DistanceFieldConverter::exec() { PluginManager::Manager converterManager{ #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT args.value("plugin-dir").empty() ? Containers::String{} : - Utility::Path::join(args.value("plugin-dir"), Utility::Path::split(Trade::AbstractImageConverter::pluginSearchPaths().back()).second()) + Utility::Path::join(args.value("plugin-dir"), Utility::Path::filename(Trade::AbstractImageConverter::pluginSearchPaths().back())) #endif }; Containers::Pointer converter = converterManager.loadAndInstantiate(args.value("converter")); diff --git a/src/Magnum/Trade/imageconverter.cpp b/src/Magnum/Trade/imageconverter.cpp index 1dff9d0e5..aa30e9296 100644 --- a/src/Magnum/Trade/imageconverter.cpp +++ b/src/Magnum/Trade/imageconverter.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -523,13 +522,13 @@ no -C / --converter is specified, AnyImageConverter is used.)") PluginManager::Manager importerManager{ #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT args.value("plugin-dir").empty() ? Containers::String{} : - Utility::Path::join(args.value("plugin-dir"), Utility::Path::split(Trade::AbstractImporter::pluginSearchPaths().back()).second()) + Utility::Path::join(args.value("plugin-dir"), Utility::Path::filename(Trade::AbstractImporter::pluginSearchPaths().back())) #endif }; PluginManager::Manager converterManager{ #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT args.value("plugin-dir").empty() ? Containers::String{} : - Utility::Path::join(args.value("plugin-dir"), Utility::Path::split(Trade::AbstractImageConverter::pluginSearchPaths().back()).second()) + Utility::Path::join(args.value("plugin-dir"), Utility::Path::filename(Trade::AbstractImageConverter::pluginSearchPaths().back())) #endif }; diff --git a/src/MagnumPlugins/AnyShaderConverter/AnyConverter.cpp b/src/MagnumPlugins/AnyShaderConverter/AnyConverter.cpp index 14b967fc0..4bc004e6b 100644 --- a/src/MagnumPlugins/AnyShaderConverter/AnyConverter.cpp +++ b/src/MagnumPlugins/AnyShaderConverter/AnyConverter.cpp @@ -125,7 +125,7 @@ Containers::StringView stringForFormat(const Format format) { Format formatForExtension(const char* prefix, const Containers::StringView filename) { /* Can't reliably lowercase just the extension as we detect double extensions as well. But we can lowercase just the filename, at least. */ - const Containers::String normalized = Utility::String::lowercase(Utility::Path::split(filename).second()); + const Containers::String normalized = Utility::String::lowercase(Utility::Path::filename(filename)); /* https://github.com/KhronosGroup/SPIRV-Tools/blob/a715b1b4053519ad0f2bdb2d22ace35d35867cff/README.md#command-line-tools "It's a convention to name SPIR-V assembly and binary files with suffix diff --git a/src/MagnumPlugins/MagnumFont/MagnumFont.cpp b/src/MagnumPlugins/MagnumFont/MagnumFont.cpp index 9446e3021..1ab71c37d 100644 --- a/src/MagnumPlugins/MagnumFont/MagnumFont.cpp +++ b/src/MagnumPlugins/MagnumFont/MagnumFont.cpp @@ -139,7 +139,7 @@ auto MagnumFont::doOpenData(const Containers::ArrayView data, const auto MagnumFont::doOpenFile(const Containers::StringView filename, const Float size) -> Properties { _opened.emplace(); - _opened->filePath.emplace(Utility::Path::split(filename).first()); + _opened->filePath.emplace(Utility::Path::path(filename)); return AbstractFont::doOpenFile(filename, size); } diff --git a/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp b/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp index 32dc6ab4b..eb820018d 100644 --- a/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp +++ b/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp @@ -79,7 +79,7 @@ std::vector>> MagnumFontConverter Utility::Configuration configuration; configuration.setValue("version", 1); - configuration.setValue("image", Utility::Path::split(filename).second() + ".tga"); + configuration.setValue("image", Utility::Path::filename(filename) + ".tga"); configuration.setValue("originalImageSize", cache.size().xy()); configuration.setValue("padding", cache.padding()); configuration.setValue("fontSize", font.size());