Reference wrapper to access for plugin's information.
More...
#include <plugin.hpp>
|
UniqueId | GetId () const noexcept |
| Get the unique identifier of the plugin. More...
|
|
std::string_view | GetName () const noexcept |
| Get the name of the plugin. More...
|
|
std::string_view | GetFriendlyName () const noexcept |
| Get the friendly name of the plugin. More...
|
|
std::filesystem::path_view | GetBaseDir () const noexcept |
| Get the base directory of the plugin. More...
|
|
PluginDescriptorRef | GetDescriptor () const noexcept |
| Get the descriptor of the plugin. More...
|
|
PluginState | GetState () const noexcept |
| Get the state of the plugin. More...
|
|
std::string_view | GetError () const noexcept |
| Get the error message associated with the plugin. More...
|
|
std::span< const MethodData > | GetMethods () const noexcept |
| Get the list of methods supported by the plugin. More...
|
|
std::optional< std::filesystem::path_view > | FindResource (std::filesystem::path_view path) const |
| Find a resource file associated with the plugin. More...
|
|
| Ref (const Plugin &impl) noexcept |
|
| Ref (Ref const &)=default |
|
| Ref (Ref &&)=default |
|
bool | operator== (const Ref &other) const noexcept |
|
bool | operator== (const const Plugin *impl) const noexcept |
|
Ref & | operator= (const Ref &) &=default |
|
Ref & | operator= (const Ref &) &&=delete |
|
Ref & | operator= (Ref &&) &=default |
|
Ref & | operator= (Ref &&) &&=delete |
|
| operator bool () const noexcept |
|
Reference wrapper to access for plugin's information.
Definition at line 52 of file plugin.hpp.
◆ FindResource()
std::optional<std::filesystem::path_view> plugify::PluginRef::FindResource |
( |
std::filesystem::path_view |
path | ) |
const |
Find a resource file associated with the plugin.
This method attempts to find a resource file located within the plugin's directory structure. If the resource file is found, its path is returned. If the resource file does not exist within the plugin's directory, std::nullopt is returned.
If a user-overridden file exists in the base directory of Plugify with the same name and path, the path returned by this function will direct to that overridden file.
- Parameters
-
path | The relative path to the resource file. |
- Returns
- An optional containing the absolute path to the resource file if found, or std::nullopt otherwise.
Example:
auto resourcePath = plugin.FindResource("configs/core.cfg");
◆ GetBaseDir()
std::filesystem::path_view plugify::PluginRef::GetBaseDir |
( |
| ) |
const |
|
noexcept |
Get the base directory of the plugin.
- Returns
- The base directory as a filesystem path.
◆ GetDescriptor()
Get the descriptor of the plugin.
- Returns
- The descriptor of the plugin.
◆ GetError()
std::string_view plugify::PluginRef::GetError |
( |
| ) |
const |
|
noexcept |
Get the error message associated with the plugin.
- Returns
- The error message.
◆ GetFriendlyName()
std::string_view plugify::PluginRef::GetFriendlyName |
( |
| ) |
const |
|
noexcept |
Get the friendly name of the plugin.
- Returns
- The friendly name of the plugin.
◆ GetId()
UniqueId plugify::PluginRef::GetId |
( |
| ) |
const |
|
noexcept |
Get the unique identifier of the plugin.
- Returns
- The unique identifier.
◆ GetMethods()
std::span<const MethodData> plugify::PluginRef::GetMethods |
( |
| ) |
const |
|
noexcept |
Get the list of methods supported by the plugin.
- Returns
- The list of method data.
◆ GetName()
std::string_view plugify::PluginRef::GetName |
( |
| ) |
const |
|
noexcept |
Get the name of the plugin.
- Returns
- The name of the plugin.
◆ GetState()
PluginState plugify::PluginRef::GetState |
( |
| ) |
const |
|
noexcept |
Get the state of the plugin.
- Returns
- The state of the plugin.
The documentation for this class was generated from the following file: