|
UniqueId | GetId () const noexcept |
| Get the unique identifier of the language module.
|
|
std::string_view | GetName () const noexcept |
| Get the name of the language module.
|
|
std::string_view | GetLanguage () const noexcept |
| Get the language of the language module.
|
|
std::string_view | GetFriendlyName () const noexcept |
| Get the friendly name of the language module.
|
|
std::filesystem::path_view | GetFilePath () const noexcept |
| Get the file path of the language module.
|
|
std::filesystem::path_view | GetBaseDir () const noexcept |
| Get the base directory of the language module.
|
|
LanguageModuleDescriptorHandle | GetDescriptor () const noexcept |
| Get the descriptor of the language module.
|
|
ModuleState | GetState () const noexcept |
| Get the state of the language module.
|
|
std::string_view | GetError () const noexcept |
| Get the error message associated with the language module.
|
|
std::optional< std::filesystem::path_view > | FindResource (std::filesystem::path_view path) const |
| Find a resource file associated with the module.
|
|
Public Member Functions inherited from plugify::Handle< const Module > |
| Handle () noexcept |
| Default constructor. Initializes the handle with a null pointer.
|
|
| Handle (const Module &impl) noexcept |
| Constructs a Handle object from an instance of type T.
|
|
| Handle (const Handle &)=default |
| Copy constructor. Creates a new Handle object from another Handle object.
|
|
| Handle (Handle &&)=default |
| Move constructor. Transfers ownership from another Handle object.
|
|
auto | operator<=> (const Handle &) const=default |
| Comparison operator (<=>) for comparing two Handle objects.
|
|
Handle & | operator= (const Handle &) &=default |
| Copy assignment operator. Copies the handle from another Handle object.
|
|
Handle & | operator= (const Handle &) &&=delete |
| Copy assignment operator for rvalue references is deleted.
|
|
Handle & | operator= (Handle &&) &=default |
| Move assignment operator. Transfers ownership from another Handle object.
|
|
Handle & | operator= (Handle &&) &&=delete |
| Move assignment operator for rvalue references is deleted.
|
|
| operator bool () const noexcept |
| Explicit conversion operator to bool, indicating if the pointer is non-zero.
|
|
| operator uintptr_t () const noexcept |
| Converts the Handle object to a uintptr_t.
|
|
| operator void * () const noexcept |
| Converts the Handle object to a void pointer.
|
|
Handle wrapper to access language module's information.
Definition at line 39 of file module.hpp.
std::optional< std::filesystem::path_view > plugify::ModuleHandle::FindResource |
( |
std::filesystem::path_view |
path | ) |
const |
Find a resource file associated with the module.
This method attempts to find a resource file located within the module's directory structure. If the resource file is found, its path is returned. If the resource file does not exist within the module'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 = module.FindResource("configs/core.cfg");