From 13d04fdc383404ba3872d789175cfc799cbfb2b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 14 Mar 2022 19:18:08 +0100 Subject: [PATCH] Adapt to Corrade PluginManager changes. --- doc/snippets/MagnumShaderTools.cpp | 1 + src/Magnum/Audio/AbstractImporter.cpp | 31 +++++++++++++---- src/Magnum/Audio/AbstractImporter.h | 15 +++++++-- src/Magnum/Audio/configure.h.cmake | 6 ++-- src/Magnum/SceneTools/sceneconverter.cpp | 6 ++-- src/Magnum/ShaderTools/AbstractConverter.cpp | 28 +++++++++++++--- src/Magnum/ShaderTools/AbstractConverter.h | 15 +++++++-- src/Magnum/ShaderTools/configure.h.cmake | 6 ++-- src/Magnum/ShaderTools/shaderconverter.cpp | 3 +- src/Magnum/Text/AbstractFont.cpp | 31 +++++++++++++---- src/Magnum/Text/AbstractFont.h | 15 +++++++-- src/Magnum/Text/AbstractFontConverter.cpp | 29 ++++++++++++---- src/Magnum/Text/AbstractFontConverter.h | 15 +++++++-- src/Magnum/Text/configure.h.cmake | 10 +++--- src/Magnum/Trade/AbstractImageConverter.cpp | 27 ++++++++++++--- src/Magnum/Trade/AbstractImageConverter.h | 15 +++++++-- src/Magnum/Trade/AbstractImporter.cpp | 31 +++++++++++++---- src/Magnum/Trade/AbstractImporter.h | 16 +++++++-- src/Magnum/Trade/AbstractSceneConverter.cpp | 33 +++++++++++++++---- src/Magnum/Trade/AbstractSceneConverter.h | 15 +++++++-- src/Magnum/Trade/configure.h.cmake | 14 ++++---- src/Magnum/Trade/imageconverter.cpp | 5 ++- src/MagnumPlugins/ObjImporter/ObjImporter.cpp | 2 +- src/MagnumPlugins/ObjImporter/ObjImporter.h | 2 +- .../Test/TgaImageConverterTest.cpp | 1 + .../TgaImageConverter/TgaImageConverter.cpp | 2 +- .../TgaImageConverter/TgaImageConverter.h | 2 +- src/MagnumPlugins/TgaImporter/TgaImporter.cpp | 2 +- src/MagnumPlugins/TgaImporter/TgaImporter.h | 2 +- .../WavAudioImporter/WavImporter.cpp | 2 +- .../WavAudioImporter/WavImporter.h | 2 +- 31 files changed, 290 insertions(+), 94 deletions(-) diff --git a/doc/snippets/MagnumShaderTools.cpp b/doc/snippets/MagnumShaderTools.cpp index 5f8aa6f6e..a98ae5915 100644 --- a/doc/snippets/MagnumShaderTools.cpp +++ b/doc/snippets/MagnumShaderTools.cpp @@ -23,6 +23,7 @@ DEALINGS IN THE SOFTWARE. */ +#include /** @todo drop when file callbacks are -free */ #include #include #include diff --git a/src/Magnum/Audio/AbstractImporter.cpp b/src/Magnum/Audio/AbstractImporter.cpp index cc0159b9b..11cca8e5f 100644 --- a/src/Magnum/Audio/AbstractImporter.cpp +++ b/src/Magnum/Audio/AbstractImporter.cpp @@ -29,27 +29,44 @@ #include #include #include -#include /** @todo remove once PluginManager is -free */ +#include /** @todo remove once AbstractImporter is -free */ +#include #include -#include +#include /** @todo remove once AbstractImporter is -free */ #include #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT #include "Magnum/Audio/configure.h" #endif +namespace Corrade { namespace PluginManager { + +/* On non-MinGW Windows the instantiations are already marked with extern + template. However Clang-CL doesn't propagate the export from the extern + template, it seems. */ +#if !defined(CORRADE_TARGET_WINDOWS) || defined(CORRADE_TARGET_MINGW) || defined(CORRADE_TARGET_CLANG_CL) +#define MAGNUM_AUDIO_EXPORT_HPP MAGNUM_AUDIO_EXPORT +#else +#define MAGNUM_AUDIO_EXPORT_HPP +#endif +template class MAGNUM_AUDIO_EXPORT_HPP Manager; + +}} + namespace Magnum { namespace Audio { -std::string AbstractImporter::pluginInterface() { +using namespace Containers::Literals; + +Containers::StringView AbstractImporter::pluginInterface() { return /* [interface] */ -"cz.mosra.magnum.Audio.AbstractImporter/0.1" +"cz.mosra.magnum.Audio.AbstractImporter/0.1"_s /* [interface] */ ; } #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT -std::vector AbstractImporter::pluginSearchPaths() { +Containers::Array AbstractImporter::pluginSearchPaths() { const Containers::Optional libraryLocation = Utility::Path::libraryLocation(&pluginInterface); return PluginManager::implicitPluginSearchPaths( #ifndef MAGNUM_BUILD_STATIC @@ -67,7 +84,7 @@ std::vector AbstractImporter::pluginSearchPaths() { #else "magnum/" #endif - "audioimporters"); + "audioimporters"_s); } #endif @@ -75,7 +92,7 @@ AbstractImporter::AbstractImporter() = default; AbstractImporter::AbstractImporter(PluginManager::Manager& manager): PluginManager::AbstractManagingPlugin{manager} {} -AbstractImporter::AbstractImporter(PluginManager::AbstractManager& manager, const std::string& plugin): PluginManager::AbstractManagingPlugin{manager, plugin} {} +AbstractImporter::AbstractImporter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin): PluginManager::AbstractManagingPlugin{manager, plugin} {} bool AbstractImporter::openData(Containers::ArrayView data) { CORRADE_ASSERT(features() & ImporterFeature::OpenData, diff --git a/src/Magnum/Audio/AbstractImporter.h b/src/Magnum/Audio/AbstractImporter.h index fcc1db62d..cd6e2777c 100644 --- a/src/Magnum/Audio/AbstractImporter.h +++ b/src/Magnum/Audio/AbstractImporter.h @@ -125,7 +125,7 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractManagi * * @snippet Magnum/Audio/AbstractImporter.cpp interface */ - static std::string pluginInterface(); + static Containers::StringView pluginInterface(); #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT /** @@ -141,7 +141,7 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractManagi * Not defined on platforms without * @ref CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT "dynamic plugin support". */ - static std::vector pluginSearchPaths(); + static Containers::Array pluginSearchPaths(); #endif /** @brief Default constructor */ @@ -151,7 +151,10 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractManagi explicit AbstractImporter(PluginManager::Manager& manager); /** @brief Plugin manager constructor */ - explicit AbstractImporter(PluginManager::AbstractManager& manager, const std::string& plugin); + /* The plugin name is passed as a const& to make it possible for people + to implement plugins without even having to include the StringView + header. */ + explicit AbstractImporter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin); /** @brief Features supported by this importer */ ImporterFeatures features() const { return doFeatures(); } @@ -232,4 +235,10 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractManagi }} +#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) +namespace Corrade { namespace PluginManager { + extern template class MAGNUM_AUDIO_EXPORT Manager; +}} +#endif + #endif diff --git a/src/Magnum/Audio/configure.h.cmake b/src/Magnum/Audio/configure.h.cmake index 83ed9fa3d..567254528 100644 --- a/src/Magnum/Audio/configure.h.cmake +++ b/src/Magnum/Audio/configure.h.cmake @@ -23,5 +23,7 @@ DEALINGS IN THE SOFTWARE. */ -#define MAGNUM_PLUGINS_AUDIOIMPORTER_DIR "${MAGNUM_PLUGINS_AUDIOIMPORTER_DIR}" -#define MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_DIR "${MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_DIR}" +/* StringView literals, so they expect the Literals namespace to be used at the + point of use */ +#define MAGNUM_PLUGINS_AUDIOIMPORTER_DIR "${MAGNUM_PLUGINS_AUDIOIMPORTER_DIR}"_s +#define MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_DIR "${MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_DIR}"_s diff --git a/src/Magnum/SceneTools/sceneconverter.cpp b/src/Magnum/SceneTools/sceneconverter.cpp index e380bd909..e732e8f21 100644 --- a/src/Magnum/SceneTools/sceneconverter.cpp +++ b/src/Magnum/SceneTools/sceneconverter.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include "Magnum/PixelFormat.h" #include "Magnum/Implementation/converterUtilities.h" @@ -199,6 +198,7 @@ magnum-sceneconverter chair.obj --converter MeshOptimizerSceneConverter -c simpl } using namespace Magnum; +using namespace Containers::Literals; namespace { @@ -314,7 +314,7 @@ is specified as well, the IDs reference attributes of the first mesh.)") Containers::Pointer importer = importerManager.loadAndInstantiate(args.value("importer")); if(!importer) { - Debug{} << "Available importer plugins:" << Utility::String::join(importerManager.aliasList(), ", "); + Debug{} << "Available importer plugins:" << ", "_s.join(importerManager.aliasList()); return 1; } @@ -1112,7 +1112,7 @@ is specified as well, the IDs reference attributes of the first mesh.)") "AnySceneConverter" : args.arrayValue("converter", i); Containers::Pointer converter = converterManager.loadAndInstantiate(converterName); if(!converter) { - Debug{} << "Available converter plugins:" << Utility::String::join(converterManager.aliasList(), ", "); + Debug{} << "Available converter plugins:" << ", "_s.join(converterManager.aliasList()); return 2; } diff --git a/src/Magnum/ShaderTools/AbstractConverter.cpp b/src/Magnum/ShaderTools/AbstractConverter.cpp index 20d946315..3d46fe7d1 100644 --- a/src/Magnum/ShaderTools/AbstractConverter.cpp +++ b/src/Magnum/ShaderTools/AbstractConverter.cpp @@ -25,11 +25,13 @@ #include "AbstractConverter.h" +#include /** @todo remove once file callbacks are -free */ #include #include #include #include #include /** @todo remove once file callbacks are -free */ +#include #include #include "Magnum/FileCallback.h" @@ -38,18 +40,34 @@ #include "Magnum/ShaderTools/configure.h" #endif +namespace Corrade { namespace PluginManager { + +/* On non-MinGW Windows the instantiations are already marked with extern + template. However Clang-CL doesn't propagate the export from the extern + template, it seems. */ +#if !defined(CORRADE_TARGET_WINDOWS) || defined(CORRADE_TARGET_MINGW) || defined(CORRADE_TARGET_CLANG_CL) +#define MAGNUM_SHADERTOOLS_EXPORT_HPP MAGNUM_SHADERTOOLS_EXPORT +#else +#define MAGNUM_SHADERTOOLS_EXPORT_HPP +#endif +template class MAGNUM_SHADERTOOLS_EXPORT_HPP Manager; + +}} + namespace Magnum { namespace ShaderTools { -std::string AbstractConverter::pluginInterface() { +using namespace Containers::Literals; + +Containers::StringView AbstractConverter::pluginInterface() { return /* [interface] */ -"cz.mosra.magnum.ShaderTools.AbstractConverter/0.1" +"cz.mosra.magnum.ShaderTools.AbstractConverter/0.1"_s /* [interface] */ ; } #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT -std::vector AbstractConverter::pluginSearchPaths() { +Containers::Array AbstractConverter::pluginSearchPaths() { const Containers::Optional libraryLocation = Utility::Path::libraryLocation(&pluginInterface); return PluginManager::implicitPluginSearchPaths( #ifndef MAGNUM_BUILD_STATIC @@ -67,7 +85,7 @@ std::vector AbstractConverter::pluginSearchPaths() { #else "magnum/" #endif - "shaderconverters"); + "shaderconverters"_s); } #endif @@ -75,7 +93,7 @@ AbstractConverter::AbstractConverter() = default; AbstractConverter::AbstractConverter(PluginManager::Manager& manager): PluginManager::AbstractManagingPlugin{manager} {} -AbstractConverter::AbstractConverter(PluginManager::AbstractManager& manager, const std::string& plugin): PluginManager::AbstractManagingPlugin{manager, plugin} {} +AbstractConverter::AbstractConverter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin): PluginManager::AbstractManagingPlugin{manager, plugin} {} ConverterFeatures AbstractConverter::features() const { const ConverterFeatures features = doFeatures(); diff --git a/src/Magnum/ShaderTools/AbstractConverter.h b/src/Magnum/ShaderTools/AbstractConverter.h index e40d884bf..0b29904bc 100644 --- a/src/Magnum/ShaderTools/AbstractConverter.h +++ b/src/Magnum/ShaderTools/AbstractConverter.h @@ -465,7 +465,7 @@ class MAGNUM_SHADERTOOLS_EXPORT AbstractConverter: public PluginManager::Abstrac * * @snippet Magnum/ShaderTools/AbstractConverter.cpp interface */ - static std::string pluginInterface(); + static Containers::StringView pluginInterface(); #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT /** @@ -481,7 +481,7 @@ class MAGNUM_SHADERTOOLS_EXPORT AbstractConverter: public PluginManager::Abstrac * Not defined on platforms without * @ref CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT "dynamic plugin support". */ - static std::vector pluginSearchPaths(); + static Containers::Array pluginSearchPaths(); #endif /** @brief Default constructor */ @@ -491,7 +491,10 @@ class MAGNUM_SHADERTOOLS_EXPORT AbstractConverter: public PluginManager::Abstrac explicit AbstractConverter(PluginManager::Manager& manager); /** @brief Plugin manager constructor */ - explicit AbstractConverter(PluginManager::AbstractManager& manager, const std::string& plugin); + /* The plugin name is passed as a const& to make it possible for people + to implement plugins without even having to include the StringView + header. */ + explicit AbstractConverter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin); /** @brief Features supported by this converter */ ConverterFeatures features() const; @@ -1145,4 +1148,10 @@ template void AbstractConverter::setInputFileCallback(C }} +#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) +namespace Corrade { namespace PluginManager { + extern template class MAGNUM_SHADERTOOLS_EXPORT Manager; +}} +#endif + #endif diff --git a/src/Magnum/ShaderTools/configure.h.cmake b/src/Magnum/ShaderTools/configure.h.cmake index 66d8b4ee7..e1030ecc9 100644 --- a/src/Magnum/ShaderTools/configure.h.cmake +++ b/src/Magnum/ShaderTools/configure.h.cmake @@ -23,5 +23,7 @@ DEALINGS IN THE SOFTWARE. */ -#define MAGNUM_PLUGINS_SHADERCONVERTER_DIR "${MAGNUM_PLUGINS_SHADERCONVERTER_DIR}" -#define MAGNUM_PLUGINS_SHADERCONVERTER_DEBUG_DIR "${MAGNUM_PLUGINS_SHADERCONVERTER_DEBUG_DIR}" +/* StringView literals, so they expect the Literals namespace to be used at the + point of use */ +#define MAGNUM_PLUGINS_SHADERCONVERTER_DIR "${MAGNUM_PLUGINS_SHADERCONVERTER_DIR}"_s +#define MAGNUM_PLUGINS_SHADERCONVERTER_DEBUG_DIR "${MAGNUM_PLUGINS_SHADERCONVERTER_DEBUG_DIR}"_s diff --git a/src/Magnum/ShaderTools/shaderconverter.cpp b/src/Magnum/ShaderTools/shaderconverter.cpp index f0f9c2b8c..8159fad45 100644 --- a/src/Magnum/ShaderTools/shaderconverter.cpp +++ b/src/Magnum/ShaderTools/shaderconverter.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include "Magnum/Implementation/converterUtilities.h" #include "Magnum/Math/Functions.h" @@ -365,7 +364,7 @@ see documentation of a particular converter for more information.)") args.arrayValue("converter", i) : "AnyShaderConverter"; Containers::Pointer converter = converterManager.loadAndInstantiate(converterName); if(!converter) { - Debug{} << "Available converter plugins:" << Utility::String::join(converterManager.aliasList(), ", "); + Debug{} << "Available converter plugins:" << ", "_s.join(converterManager.aliasList()); return 7; } diff --git a/src/Magnum/Text/AbstractFont.cpp b/src/Magnum/Text/AbstractFont.cpp index fed358e17..44d989e0c 100644 --- a/src/Magnum/Text/AbstractFont.cpp +++ b/src/Magnum/Text/AbstractFont.cpp @@ -29,8 +29,9 @@ #include #include #include -#include /** @todo remove once PluginManager is -free */ -#include +#include /** @todo remove once file callbacks are -free */ +#include +#include /** @todo remove once AbstractFont is -free */ #include #include @@ -42,18 +43,34 @@ #include "Magnum/Text/configure.h" #endif +namespace Corrade { namespace PluginManager { + +/* On non-MinGW Windows the instantiations are already marked with extern + template. However Clang-CL doesn't propagate the export from the extern + template, it seems. */ +#if !defined(CORRADE_TARGET_WINDOWS) || defined(CORRADE_TARGET_MINGW) || defined(CORRADE_TARGET_CLANG_CL) +#define MAGNUM_TEXT_EXPORT_HPP MAGNUM_TEXT_EXPORT +#else +#define MAGNUM_TEXT_EXPORT_HPP +#endif +template class MAGNUM_TEXT_EXPORT_HPP Manager; + +}} + namespace Magnum { namespace Text { -std::string AbstractFont::pluginInterface() { +using namespace Containers::Literals; + +Containers::StringView AbstractFont::pluginInterface() { return /* [interface] */ -"cz.mosra.magnum.Text.AbstractFont/0.3" +"cz.mosra.magnum.Text.AbstractFont/0.3"_s /* [interface] */ ; } #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT -std::vector AbstractFont::pluginSearchPaths() { +Containers::Array AbstractFont::pluginSearchPaths() { const Containers::Optional libraryLocation = Utility::Path::libraryLocation(&pluginInterface); return PluginManager::implicitPluginSearchPaths( #ifndef MAGNUM_BUILD_STATIC @@ -71,13 +88,13 @@ std::vector AbstractFont::pluginSearchPaths() { #else "magnum/" #endif - "fonts"); + "fonts"_s); } #endif AbstractFont::AbstractFont() = default; -AbstractFont::AbstractFont(PluginManager::AbstractManager& manager, const std::string& plugin): AbstractPlugin{manager, plugin} {} +AbstractFont::AbstractFont(PluginManager::AbstractManager& manager, const Containers::StringView& plugin): AbstractPlugin{manager, plugin} {} void AbstractFont::setFileCallback(Containers::Optional>(*callback)(const std::string&, InputFileCallbackPolicy, void*), void* const userData) { CORRADE_ASSERT(!isOpened(), "Text::AbstractFont::setFileCallback(): can't be set while a font is opened", ); diff --git a/src/Magnum/Text/AbstractFont.h b/src/Magnum/Text/AbstractFont.h index bfc8af238..d983e5b00 100644 --- a/src/Magnum/Text/AbstractFont.h +++ b/src/Magnum/Text/AbstractFont.h @@ -187,7 +187,7 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { * * @snippet Magnum/Text/AbstractFont.cpp interface */ - static std::string pluginInterface(); + static Containers::StringView pluginInterface(); #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT /** @@ -203,14 +203,17 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { * Not defined on platforms without * @ref CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT "dynamic plugin support". */ - static std::vector pluginSearchPaths(); + static Containers::Array pluginSearchPaths(); #endif /** @brief Default constructor */ explicit AbstractFont(); /** @brief Plugin manager constructor */ - explicit AbstractFont(PluginManager::AbstractManager& manager, const std::string& plugin); + /* The plugin name is passed as a const& to make it possible for people + to implement plugins without even having to include the StringView + header. */ + explicit AbstractFont(PluginManager::AbstractManager& manager, const Containers::StringView& plugin); /** @brief Features supported by this font */ FontFeatures features() const { return doFeatures(); } @@ -646,4 +649,10 @@ template void AbstractFont::setFileCallback(Callback ca }} +#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) +namespace Corrade { namespace PluginManager { + extern template class MAGNUM_TEXT_EXPORT Manager; +}} +#endif + #endif diff --git a/src/Magnum/Text/AbstractFontConverter.cpp b/src/Magnum/Text/AbstractFontConverter.cpp index b4c62694e..1957f3160 100644 --- a/src/Magnum/Text/AbstractFontConverter.cpp +++ b/src/Magnum/Text/AbstractFontConverter.cpp @@ -30,9 +30,10 @@ #include #include #include -#include /** @todo remove once PluginManager and AbstractFontConverter is -free */ +#include /** @todo remove once AbstractFontConverter is -free */ +#include #include -#include +#include /** @todo remove once AbstractFontConverter is -free */ #include #include @@ -42,8 +43,24 @@ #include "Magnum/Text/configure.h" #endif +namespace Corrade { namespace PluginManager { + +/* On non-MinGW Windows the instantiations are already marked with extern + template. However Clang-CL doesn't propagate the export from the extern + template, it seems. */ +#if !defined(CORRADE_TARGET_WINDOWS) || defined(CORRADE_TARGET_MINGW) || defined(CORRADE_TARGET_CLANG_CL) +#define MAGNUM_TEXT_EXPORT_HPP MAGNUM_TEXT_EXPORT +#else +#define MAGNUM_TEXT_EXPORT_HPP +#endif +template class MAGNUM_TEXT_EXPORT_HPP Manager; + +}} + namespace Magnum { namespace Text { +using namespace Containers::Literals; + namespace { std::u32string uniqueUnicode(const std::string& characters) @@ -60,16 +77,16 @@ std::u32string uniqueUnicode(const std::string& characters) } -std::string AbstractFontConverter::pluginInterface() { +Containers::StringView AbstractFontConverter::pluginInterface() { return /* [interface] */ -"cz.mosra.magnum.Text.AbstractFontConverter/0.2" +"cz.mosra.magnum.Text.AbstractFontConverter/0.2"_s /* [interface] */ ; } #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT -std::vector AbstractFontConverter::pluginSearchPaths() { +Containers::Array AbstractFontConverter::pluginSearchPaths() { const Containers::Optional libraryLocation = Utility::Path::libraryLocation(&pluginInterface); return PluginManager::implicitPluginSearchPaths( #ifndef MAGNUM_BUILD_STATIC @@ -93,7 +110,7 @@ std::vector AbstractFontConverter::pluginSearchPaths() { AbstractFontConverter::AbstractFontConverter() = default; -AbstractFontConverter::AbstractFontConverter(PluginManager::AbstractManager& manager, const std::string& plugin): PluginManager::AbstractPlugin{manager, plugin} {} +AbstractFontConverter::AbstractFontConverter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin): PluginManager::AbstractPlugin{manager, plugin} {} std::vector>> AbstractFontConverter::exportFontToData(AbstractFont& font, AbstractGlyphCache& cache, const std::string& filename, const std::string& characters) const { CORRADE_ASSERT(features() >= (FontConverterFeature::ExportFont|FontConverterFeature::ConvertData), diff --git a/src/Magnum/Text/AbstractFontConverter.h b/src/Magnum/Text/AbstractFontConverter.h index 2cc7728d3..58e39c1c6 100644 --- a/src/Magnum/Text/AbstractFontConverter.h +++ b/src/Magnum/Text/AbstractFontConverter.h @@ -178,7 +178,7 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl * * @snippet Magnum/Text/AbstractFontConverter.cpp interface */ - static std::string pluginInterface(); + static Containers::StringView pluginInterface(); #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT /** @@ -194,14 +194,17 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl * Not defined on platforms without * @ref CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT "dynamic plugin support". */ - static std::vector pluginSearchPaths(); + static Containers::Array pluginSearchPaths(); #endif /** @brief Default constructor */ explicit AbstractFontConverter(); /** @brief Plugin manager constructor */ - explicit AbstractFontConverter(PluginManager::AbstractManager& manager, const std::string& plugin); + /* The plugin name is passed as a const& to make it possible for people + to implement plugins without even having to include the StringView + header. */ + explicit AbstractFontConverter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin); /** @brief Features supported by this converter */ FontConverterFeatures features() const { return doFeatures(); } @@ -407,4 +410,10 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl }} +#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) +namespace Corrade { namespace PluginManager { + extern template class MAGNUM_TEXT_EXPORT Manager; +}} +#endif + #endif diff --git a/src/Magnum/Text/configure.h.cmake b/src/Magnum/Text/configure.h.cmake index bd456344a..a87d555a3 100644 --- a/src/Magnum/Text/configure.h.cmake +++ b/src/Magnum/Text/configure.h.cmake @@ -23,7 +23,9 @@ DEALINGS IN THE SOFTWARE. */ -#define MAGNUM_PLUGINS_FONT_DIR "${MAGNUM_PLUGINS_FONT_DIR}" -#define MAGNUM_PLUGINS_FONT_DEBUG_DIR "${MAGNUM_PLUGINS_FONT_DEBUG_DIR}" -#define MAGNUM_PLUGINS_FONTCONVERTER_DIR "${MAGNUM_PLUGINS_FONTCONVERTER_DIR}" -#define MAGNUM_PLUGINS_FONTCONVERTER_DEBUG_DIR "${MAGNUM_PLUGINS_FONTCONVERTER_DEBUG_DIR}" +/* StringView literals, so they expect the Literals namespace to be used at the + point of use */ +#define MAGNUM_PLUGINS_FONT_DIR "${MAGNUM_PLUGINS_FONT_DIR}"_s +#define MAGNUM_PLUGINS_FONT_DEBUG_DIR "${MAGNUM_PLUGINS_FONT_DEBUG_DIR}"_s +#define MAGNUM_PLUGINS_FONTCONVERTER_DIR "${MAGNUM_PLUGINS_FONTCONVERTER_DIR}"_s +#define MAGNUM_PLUGINS_FONTCONVERTER_DEBUG_DIR "${MAGNUM_PLUGINS_FONTCONVERTER_DEBUG_DIR}"_s diff --git a/src/Magnum/Trade/AbstractImageConverter.cpp b/src/Magnum/Trade/AbstractImageConverter.cpp index 01602953e..e67505356 100644 --- a/src/Magnum/Trade/AbstractImageConverter.cpp +++ b/src/Magnum/Trade/AbstractImageConverter.cpp @@ -30,6 +30,7 @@ #include #include #include /** @todo remove once PluginManager is -free */ +#include #include #include #include @@ -43,18 +44,34 @@ #include "Magnum/Trade/configure.h" #endif +namespace Corrade { namespace PluginManager { + +/* On non-MinGW Windows the instantiations are already marked with extern + template. However Clang-CL doesn't propagate the export from the extern + template, it seems. */ +#if !defined(CORRADE_TARGET_WINDOWS) || defined(CORRADE_TARGET_MINGW) || defined(CORRADE_TARGET_CLANG_CL) +#define MAGNUM_TRADE_EXPORT_HPP MAGNUM_TRADE_EXPORT +#else +#define MAGNUM_TRADE_EXPORT_HPP +#endif +template class MAGNUM_TRADE_EXPORT_HPP Manager; + +}} + namespace Magnum { namespace Trade { -std::string AbstractImageConverter::pluginInterface() { +using namespace Containers::Literals; + +Containers::StringView AbstractImageConverter::pluginInterface() { return /* [interface] */ -"cz.mosra.magnum.Trade.AbstractImageConverter/0.3.1" +"cz.mosra.magnum.Trade.AbstractImageConverter/0.3.1"_s /* [interface] */ ; } #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT -std::vector AbstractImageConverter::pluginSearchPaths() { +Containers::Array AbstractImageConverter::pluginSearchPaths() { const Containers::Optional libraryLocation = Utility::Path::libraryLocation(&pluginInterface); return PluginManager::implicitPluginSearchPaths( #ifndef MAGNUM_BUILD_STATIC @@ -72,7 +89,7 @@ std::vector AbstractImageConverter::pluginSearchPaths() { #else "magnum/" #endif - "imageconverters"); + "imageconverters"_s); } #endif @@ -80,7 +97,7 @@ AbstractImageConverter::AbstractImageConverter() = default; AbstractImageConverter::AbstractImageConverter(PluginManager::Manager& manager): PluginManager::AbstractManagingPlugin{manager} {} -AbstractImageConverter::AbstractImageConverter(PluginManager::AbstractManager& manager, const std::string& plugin): PluginManager::AbstractManagingPlugin{manager, plugin} {} +AbstractImageConverter::AbstractImageConverter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin): PluginManager::AbstractManagingPlugin{manager, plugin} {} void AbstractImageConverter::setFlags(ImageConverterFlags flags) { _flags = flags; diff --git a/src/Magnum/Trade/AbstractImageConverter.h b/src/Magnum/Trade/AbstractImageConverter.h index 840345be6..61172cc15 100644 --- a/src/Magnum/Trade/AbstractImageConverter.h +++ b/src/Magnum/Trade/AbstractImageConverter.h @@ -621,7 +621,7 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract * * @snippet Magnum/Trade/AbstractImageConverter.cpp interface */ - static std::string pluginInterface(); + static Containers::StringView pluginInterface(); #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT /** @@ -637,7 +637,7 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract * Not defined on platforms without * @ref CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT "dynamic plugin support". */ - static std::vector pluginSearchPaths(); + static Containers::Array pluginSearchPaths(); #endif /** @brief Default constructor */ @@ -647,7 +647,10 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract explicit AbstractImageConverter(PluginManager::Manager& manager); /** @brief Plugin manager constructor */ - explicit AbstractImageConverter(PluginManager::AbstractManager& manager, const std::string& plugin); + /* The plugin name is passed as a const& to make it possible for people + to implement plugins without even having to include the StringView + header. */ + explicit AbstractImageConverter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin); /** @brief Features supported by this converter */ ImageConverterFeatures features() const { return doFeatures(); } @@ -1732,4 +1735,10 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract }} +#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) +namespace Corrade { namespace PluginManager { + extern template class MAGNUM_TRADE_EXPORT Manager; +}} +#endif + #endif diff --git a/src/Magnum/Trade/AbstractImporter.cpp b/src/Magnum/Trade/AbstractImporter.cpp index 95529a715..9a32e1096 100644 --- a/src/Magnum/Trade/AbstractImporter.cpp +++ b/src/Magnum/Trade/AbstractImporter.cpp @@ -29,9 +29,10 @@ #include #include #include -#include /** @todo remove once PluginManager is -free */ +#include /** @todo remove once file callbacks are -free */ +#include #include -#include +#include /** @todo remove once AbstractImporter is -free */ #include #include "Magnum/FileCallback.h" @@ -67,18 +68,34 @@ #include "Magnum/Trade/configure.h" #endif +namespace Corrade { namespace PluginManager { + +/* On non-MinGW Windows the instantiations are already marked with extern + template. However Clang-CL doesn't propagate the export from the extern + template, it seems. */ +#if !defined(CORRADE_TARGET_WINDOWS) || defined(CORRADE_TARGET_MINGW) || defined(CORRADE_TARGET_CLANG_CL) +#define MAGNUM_TRADE_EXPORT_HPP MAGNUM_TRADE_EXPORT +#else +#define MAGNUM_TRADE_EXPORT_HPP +#endif +template class MAGNUM_TRADE_EXPORT_HPP Manager; + +}} + namespace Magnum { namespace Trade { -std::string AbstractImporter::pluginInterface() { +using namespace Containers::Literals; + +Containers::StringView AbstractImporter::pluginInterface() { return /* [interface] */ -"cz.mosra.magnum.Trade.AbstractImporter/0.4" +"cz.mosra.magnum.Trade.AbstractImporter/0.4"_s /* [interface] */ ; } #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT -std::vector AbstractImporter::pluginSearchPaths() { +Containers::Array AbstractImporter::pluginSearchPaths() { const Containers::Optional libraryLocation = Utility::Path::libraryLocation(&pluginInterface); return PluginManager::implicitPluginSearchPaths( #ifndef MAGNUM_BUILD_STATIC @@ -96,7 +113,7 @@ std::vector AbstractImporter::pluginSearchPaths() { #else "magnum/" #endif - "importers"); + "importers"_s); } #endif @@ -104,7 +121,7 @@ AbstractImporter::AbstractImporter() = default; AbstractImporter::AbstractImporter(PluginManager::Manager& manager): PluginManager::AbstractManagingPlugin{manager} {} -AbstractImporter::AbstractImporter(PluginManager::AbstractManager& manager, const std::string& plugin): PluginManager::AbstractManagingPlugin{manager, plugin} {} +AbstractImporter::AbstractImporter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin): PluginManager::AbstractManagingPlugin{manager, plugin} {} #ifdef MAGNUM_BUILD_DEPRECATED /* These twp needed because of the Array member */ diff --git a/src/Magnum/Trade/AbstractImporter.h b/src/Magnum/Trade/AbstractImporter.h index 853374c09..f87a89c4a 100644 --- a/src/Magnum/Trade/AbstractImporter.h +++ b/src/Magnum/Trade/AbstractImporter.h @@ -29,6 +29,7 @@ * @brief Class @ref Magnum::Trade::AbstractImporter, enum @ref Magnum::Trade::ImporterFeature, enum set @ref Magnum::Trade::ImporterFeatures */ +#include /** @todo remove once openState() doesn't have a default std::string argument */ #include #include @@ -447,7 +448,7 @@ class MAGNUM_TRADE_EXPORT AbstractImporter: public PluginManager::AbstractManagi * * @snippet Magnum/Trade/AbstractImporter.cpp interface */ - static std::string pluginInterface(); + static Containers::StringView pluginInterface(); #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT /** @@ -463,7 +464,7 @@ class MAGNUM_TRADE_EXPORT AbstractImporter: public PluginManager::AbstractManagi * Not defined on platforms without * @ref CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT "dynamic plugin support". */ - static std::vector pluginSearchPaths(); + static Containers::Array pluginSearchPaths(); #endif /** @brief Default constructor */ @@ -473,7 +474,10 @@ class MAGNUM_TRADE_EXPORT AbstractImporter: public PluginManager::AbstractManagi explicit AbstractImporter(PluginManager::Manager& manager); /** @brief Plugin manager constructor */ - explicit AbstractImporter(PluginManager::AbstractManager& manager, const std::string& plugin); + /* The plugin name is passed as a const& to make it possible for people + to implement plugins without even having to include the StringView + header. */ + explicit AbstractImporter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin); #if defined(MAGNUM_BUILD_DEPRECATED) && !defined(DOXYGEN_GENERATING_OUTPUT) /* These twp needed because of the Array member @@ -2536,4 +2540,10 @@ template void AbstractImporter::setFileCallback(Callbac }} +#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) +namespace Corrade { namespace PluginManager { + extern template class MAGNUM_TRADE_EXPORT Manager; +}} +#endif + #endif diff --git a/src/Magnum/Trade/AbstractSceneConverter.cpp b/src/Magnum/Trade/AbstractSceneConverter.cpp index a2034e802..a0664eb7e 100644 --- a/src/Magnum/Trade/AbstractSceneConverter.cpp +++ b/src/Magnum/Trade/AbstractSceneConverter.cpp @@ -29,28 +29,49 @@ #include #include #include -#include /** @todo remove once PluginManager is -free */ +#include #include #include "Magnum/Trade/ArrayAllocator.h" #include "Magnum/Trade/MeshData.h" +#ifdef MAGNUM_BUILD_DEPRECATED +/* needed by deprecated convertToFile() that takes a std::string */ +#include +#endif + #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT #include "Magnum/Trade/configure.h" #endif +namespace Corrade { namespace PluginManager { + +/* On non-MinGW Windows the instantiations are already marked with extern + template. However Clang-CL doesn't propagate the export from the extern + template, it seems. */ +#if !defined(CORRADE_TARGET_WINDOWS) || defined(CORRADE_TARGET_MINGW) || defined(CORRADE_TARGET_CLANG_CL) +#define MAGNUM_TRADE_EXPORT_HPP MAGNUM_TRADE_EXPORT +#else +#define MAGNUM_TRADE_EXPORT_HPP +#endif +template class MAGNUM_TRADE_EXPORT_HPP Manager; + +}} + namespace Magnum { namespace Trade { -std::string AbstractSceneConverter::pluginInterface() { +using namespace Containers::Literals; + +Containers::StringView AbstractSceneConverter::pluginInterface() { return /* [interface] */ -"cz.mosra.magnum.Trade.AbstractSceneConverter/0.1.1" +"cz.mosra.magnum.Trade.AbstractSceneConverter/0.1.1"_s /* [interface] */ ; } #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT -std::vector AbstractSceneConverter::pluginSearchPaths() { +Containers::Array AbstractSceneConverter::pluginSearchPaths() { const Containers::Optional libraryLocation = Utility::Path::libraryLocation(&pluginInterface); return PluginManager::implicitPluginSearchPaths( #ifndef MAGNUM_BUILD_STATIC @@ -68,7 +89,7 @@ std::vector AbstractSceneConverter::pluginSearchPaths() { #else "magnum/" #endif - "sceneconverters"); + "sceneconverters"_s); } #endif @@ -76,7 +97,7 @@ AbstractSceneConverter::AbstractSceneConverter() = default; AbstractSceneConverter::AbstractSceneConverter(PluginManager::Manager& manager): PluginManager::AbstractManagingPlugin{manager} {} -AbstractSceneConverter::AbstractSceneConverter(PluginManager::AbstractManager& manager, const std::string& plugin): PluginManager::AbstractManagingPlugin{manager, plugin} {} +AbstractSceneConverter::AbstractSceneConverter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin): PluginManager::AbstractManagingPlugin{manager, plugin} {} SceneConverterFeatures AbstractSceneConverter::features() const { const SceneConverterFeatures features = doFeatures(); diff --git a/src/Magnum/Trade/AbstractSceneConverter.h b/src/Magnum/Trade/AbstractSceneConverter.h index 52f6f2710..4bcf873e1 100644 --- a/src/Magnum/Trade/AbstractSceneConverter.h +++ b/src/Magnum/Trade/AbstractSceneConverter.h @@ -272,7 +272,7 @@ class MAGNUM_TRADE_EXPORT AbstractSceneConverter: public PluginManager::Abstract * * @snippet Magnum/Trade/AbstractSceneConverter.cpp interface */ - static std::string pluginInterface(); + static Containers::StringView pluginInterface(); #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT /** @@ -288,7 +288,7 @@ class MAGNUM_TRADE_EXPORT AbstractSceneConverter: public PluginManager::Abstract * Not defined on platforms without * @ref CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT "dynamic plugin support". */ - static std::vector pluginSearchPaths(); + static Containers::Array pluginSearchPaths(); #endif /** @brief Default constructor */ @@ -298,7 +298,10 @@ class MAGNUM_TRADE_EXPORT AbstractSceneConverter: public PluginManager::Abstract explicit AbstractSceneConverter(PluginManager::Manager& manager); /** @brief Plugin manager constructor */ - explicit AbstractSceneConverter(PluginManager::AbstractManager& manager, const std::string& plugin); + /* The plugin name is passed as a const& to make it possible for people + to implement plugins without even having to include the StringView + header. */ + explicit AbstractSceneConverter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin); /** @brief Features supported by this converter */ SceneConverterFeatures features() const; @@ -447,4 +450,10 @@ class MAGNUM_TRADE_EXPORT AbstractSceneConverter: public PluginManager::Abstract }} +#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) +namespace Corrade { namespace PluginManager { + extern template class MAGNUM_TRADE_EXPORT Manager; +}} +#endif + #endif diff --git a/src/Magnum/Trade/configure.h.cmake b/src/Magnum/Trade/configure.h.cmake index 54422afc9..1d398a53c 100644 --- a/src/Magnum/Trade/configure.h.cmake +++ b/src/Magnum/Trade/configure.h.cmake @@ -23,9 +23,11 @@ DEALINGS IN THE SOFTWARE. */ -#define MAGNUM_PLUGINS_IMPORTER_DIR "${MAGNUM_PLUGINS_IMPORTER_DIR}" -#define MAGNUM_PLUGINS_IMPORTER_DEBUG_DIR "${MAGNUM_PLUGINS_IMPORTER_DEBUG_DIR}" -#define MAGNUM_PLUGINS_IMAGECONVERTER_DIR "${MAGNUM_PLUGINS_IMAGECONVERTER_DIR}" -#define MAGNUM_PLUGINS_IMAGECONVERTER_DEBUG_DIR "${MAGNUM_PLUGINS_IMAGECONVERTER_DEBUG_DIR}" -#define MAGNUM_PLUGINS_SCENECONVERTER_DIR "${MAGNUM_PLUGINS_SCENECONVERTER_DIR}" -#define MAGNUM_PLUGINS_SCENECONVERTER_DEBUG_DIR "${MAGNUM_PLUGINS_SCENECONVERTER_DEBUG_DIR}" +/* StringView literals, so they expect the Literals namespace to be used at the + point of use */ +#define MAGNUM_PLUGINS_IMPORTER_DIR "${MAGNUM_PLUGINS_IMPORTER_DIR}"_s +#define MAGNUM_PLUGINS_IMPORTER_DEBUG_DIR "${MAGNUM_PLUGINS_IMPORTER_DEBUG_DIR}"_s +#define MAGNUM_PLUGINS_IMAGECONVERTER_DIR "${MAGNUM_PLUGINS_IMAGECONVERTER_DIR}"_s +#define MAGNUM_PLUGINS_IMAGECONVERTER_DEBUG_DIR "${MAGNUM_PLUGINS_IMAGECONVERTER_DEBUG_DIR}"_s +#define MAGNUM_PLUGINS_SCENECONVERTER_DIR "${MAGNUM_PLUGINS_SCENECONVERTER_DIR}"_s +#define MAGNUM_PLUGINS_SCENECONVERTER_DEBUG_DIR "${MAGNUM_PLUGINS_SCENECONVERTER_DEBUG_DIR}"_s diff --git a/src/Magnum/Trade/imageconverter.cpp b/src/Magnum/Trade/imageconverter.cpp index e4d0ea686..d10922fc5 100644 --- a/src/Magnum/Trade/imageconverter.cpp +++ b/src/Magnum/Trade/imageconverter.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include "Magnum/ImageView.h" #include "Magnum/PixelFormat.h" @@ -456,7 +455,7 @@ key=true; configuration subgroups are delimited with /.)") } else { Containers::Pointer importer = importerManager.loadAndInstantiate(args.value("importer")); if(!importer) { - Debug{} << "Available importer plugins:" << Utility::String::join(importerManager.aliasList(), ", "); + Debug{} << "Available importer plugins:" << ", "_s.join(importerManager.aliasList()); return 1; } @@ -905,7 +904,7 @@ key=true; configuration subgroups are delimited with /.)") Utility::Path::join(args.value("plugin-dir"), Trade::AbstractImageConverter::pluginSearchPaths()[0])}; Containers::Pointer converter = converterManager.loadAndInstantiate(args.value("converter")); if(!converter) { - Debug{} << "Available converter plugins:" << Utility::String::join(converterManager.aliasList(), ", "); + Debug{} << "Available converter plugins:" << ", "_s.join(converterManager.aliasList()); return 2; } diff --git a/src/MagnumPlugins/ObjImporter/ObjImporter.cpp b/src/MagnumPlugins/ObjImporter/ObjImporter.cpp index c832c4640..344c294aa 100644 --- a/src/MagnumPlugins/ObjImporter/ObjImporter.cpp +++ b/src/MagnumPlugins/ObjImporter/ObjImporter.cpp @@ -84,7 +84,7 @@ template Math::Vector extractFloatData(const std: ObjImporter::ObjImporter() = default; -ObjImporter::ObjImporter(PluginManager::AbstractManager& manager, const std::string& plugin): AbstractImporter{manager, plugin} {} +ObjImporter::ObjImporter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin): AbstractImporter{manager, plugin} {} ObjImporter::~ObjImporter() = default; diff --git a/src/MagnumPlugins/ObjImporter/ObjImporter.h b/src/MagnumPlugins/ObjImporter/ObjImporter.h index 9a151a23f..fdbb76dcd 100644 --- a/src/MagnumPlugins/ObjImporter/ObjImporter.h +++ b/src/MagnumPlugins/ObjImporter/ObjImporter.h @@ -105,7 +105,7 @@ class MAGNUM_OBJIMPORTER_EXPORT ObjImporter: public AbstractImporter { explicit ObjImporter(); /** @brief Plugin manager constructor */ - explicit ObjImporter(PluginManager::AbstractManager& manager, const std::string& plugin); + explicit ObjImporter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin); ~ObjImporter(); diff --git a/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp b/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp index 1c552b414..61eb52222 100644 --- a/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp +++ b/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp b/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp index b14600e16..6fba4e5f6 100644 --- a/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp +++ b/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp @@ -41,7 +41,7 @@ namespace Magnum { namespace Trade { TgaImageConverter::TgaImageConverter() = default; -TgaImageConverter::TgaImageConverter(PluginManager::AbstractManager& manager, const std::string& plugin): AbstractImageConverter{manager, plugin} {} +TgaImageConverter::TgaImageConverter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin): AbstractImageConverter{manager, plugin} {} ImageConverterFeatures TgaImageConverter::doFeatures() const { return ImageConverterFeature::Convert2DToData; } diff --git a/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.h b/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.h index 7a669c6d5..e377708e7 100644 --- a/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.h +++ b/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.h @@ -100,7 +100,7 @@ class MAGNUM_TGAIMAGECONVERTER_EXPORT TgaImageConverter: public AbstractImageCon explicit TgaImageConverter(); /** @brief Plugin manager constructor */ - explicit TgaImageConverter(PluginManager::AbstractManager& manager, const std::string& plugin); + explicit TgaImageConverter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin); private: ImageConverterFeatures MAGNUM_TGAIMAGECONVERTER_LOCAL doFeatures() const override; diff --git a/src/MagnumPlugins/TgaImporter/TgaImporter.cpp b/src/MagnumPlugins/TgaImporter/TgaImporter.cpp index 671e59585..65104f02f 100644 --- a/src/MagnumPlugins/TgaImporter/TgaImporter.cpp +++ b/src/MagnumPlugins/TgaImporter/TgaImporter.cpp @@ -40,7 +40,7 @@ namespace Magnum { namespace Trade { TgaImporter::TgaImporter() = default; -TgaImporter::TgaImporter(PluginManager::AbstractManager& manager, const std::string& plugin): AbstractImporter{manager, plugin} {} +TgaImporter::TgaImporter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin): AbstractImporter{manager, plugin} {} TgaImporter::~TgaImporter() = default; diff --git a/src/MagnumPlugins/TgaImporter/TgaImporter.h b/src/MagnumPlugins/TgaImporter/TgaImporter.h index 28ebca026..27bd5304a 100644 --- a/src/MagnumPlugins/TgaImporter/TgaImporter.h +++ b/src/MagnumPlugins/TgaImporter/TgaImporter.h @@ -105,7 +105,7 @@ class MAGNUM_TGAIMPORTER_EXPORT TgaImporter: public AbstractImporter { explicit TgaImporter(); /** @brief Plugin manager constructor */ - explicit TgaImporter(PluginManager::AbstractManager& manager, const std::string& plugin); + explicit TgaImporter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin); ~TgaImporter(); diff --git a/src/MagnumPlugins/WavAudioImporter/WavImporter.cpp b/src/MagnumPlugins/WavAudioImporter/WavImporter.cpp index 19a84a681..eac3417da 100644 --- a/src/MagnumPlugins/WavAudioImporter/WavImporter.cpp +++ b/src/MagnumPlugins/WavAudioImporter/WavImporter.cpp @@ -42,7 +42,7 @@ using Implementation::WavHeaderChunk; WavImporter::WavImporter() = default; -WavImporter::WavImporter(PluginManager::AbstractManager& manager, const std::string& plugin): AbstractImporter{manager, plugin} {} +WavImporter::WavImporter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin): AbstractImporter{manager, plugin} {} ImporterFeatures WavImporter::doFeatures() const { return ImporterFeature::OpenData; } diff --git a/src/MagnumPlugins/WavAudioImporter/WavImporter.h b/src/MagnumPlugins/WavAudioImporter/WavImporter.h index bd8c18c32..afd5b4a2f 100644 --- a/src/MagnumPlugins/WavAudioImporter/WavImporter.h +++ b/src/MagnumPlugins/WavAudioImporter/WavImporter.h @@ -115,7 +115,7 @@ class MAGNUM_WAVAUDIOIMPORTER_EXPORT WavImporter: public AbstractImporter { explicit WavImporter(); /** @brief Plugin manager constructor */ - explicit WavImporter(PluginManager::AbstractManager& manager, const std::string& plugin); + explicit WavImporter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin); private: MAGNUM_WAVAUDIOIMPORTER_LOCAL ImporterFeatures doFeatures() const override;