38 const auto exts = aPlugin.GetFileExtensions();
40 for(
const auto& ext : exts )
42 std::regex ext_reg( ext );
44 if( std::regex_match( aExt, ext_reg ) )
72 "Scalable Vector Graphics",
91 for(
const auto& ext : c.m_exts )
94 "Plugin '" << plugin->GetName() <<
"' handles extension: " << ext );
109 for(
const auto& ext : c.m_exts )
121 BOOST_CHECK_EQUAL( c.m_name, plugin->GetName() );
Manage vector graphics importers.
GFX_FILE_T
< List of handled file types.
std::unique_ptr< GRAPHICS_IMPORT_PLUGIN > GetPluginByExt(const wxString &aExtension) const
Returns a plugin instance for a specific file type.
std::unique_ptr< GRAPHICS_IMPORT_PLUGIN > GetPlugin(GFX_FILE_T aType) const
Interface for vector graphics import plugins.
std::vector< std::string > m_exts
The list of extensions we expect this plugin to handle.
GRAPHICS_IMPORT_MGR::GFX_FILE_T m_type
std::string m_name
The name of the plugin.
BOOST_CHECK(box.ClosestPointTo(VECTOR2D(0, 0))==VECTOR2D(1, 2))
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_CASE(SelectByType)
Check we can look a plugin up by type and get the right one.
static bool pluginHandlesExt(const GRAPHICS_IMPORT_PLUGIN &aPlugin, const std::string &aExt)
Declares a struct as the Boost test fixture.
static const std::vector< TYPE_TO_EXTS > type_to_ext_cases
BOOST_AUTO_TEST_SUITE_END()