irccd  3.0.3
Public Member Functions | List of all members
irccd::test::test_plugin_loader Class Reference

Special plugin loader for unit tests. More...

#include <test_plugin_loader.hpp>

Inheritance diagram for irccd::test::test_plugin_loader:
irccd::daemon::plugin_loader

Public Member Functions

auto open (std::string_view id, std::string_view file) -> std::shared_ptr< daemon::plugin > override
 
auto find (std::string_view id) -> std::shared_ptr< daemon::plugin > override
 
- Public Member Functions inherited from irccd::daemon::plugin_loader
 plugin_loader (std::vector< std::string > directories={}, std::vector< std::string > extensions={}) noexcept
 
virtual ~plugin_loader ()=default
 
virtual auto is_supported (std::string_view path) noexcept -> bool
 

Detailed Description

Special plugin loader for unit tests.

This class reimplements the functions find and open to return special plugin objects.

The following names are supported:

Member Function Documentation

◆ find()

auto irccd::test::test_plugin_loader::find ( std::string_view  id) -> std::shared_ptr< daemon::plugin >
overridevirtual

Search for a plugin named by this id.

Parameters
idthe plugin id
Returns
the plugin
Exceptions
plugin_erroron errors

Reimplemented from irccd::daemon::plugin_loader.

◆ open()

auto irccd::test::test_plugin_loader::open ( std::string_view  id,
std::string_view  file 
) -> std::shared_ptr< daemon::plugin >
overridevirtual

Try to open the plugin specified by path.

The implementation must test if the plugin is suitable for opening, by testing extension for example.

Parameters
idthe plugin identifier
filethe file path
Returns
the plugin
Exceptions
plugin_erroron errors

Implements irccd::daemon::plugin_loader.


The documentation for this class was generated from the following file: