Manages the loading/unloading of extensions.
More...
#include <public/IExtensionSys.h>
|
virtual const char * | GetInterfaceName () |
| Must return a string defining the interface's unique name.
|
|
virtual unsigned int | GetInterfaceVersion () |
| Must return an integer defining the interface's version.
|
|
virtual bool | IsVersionCompatible (unsigned int version) |
| Must return whether the requested version number is backwards compatible. Note: This can be overridden for breaking changes or custom versioning. More...
|
|
virtual IExtension * | LoadExtension (const char *path, char *error, size_t maxlength)=0 |
| Loads a extension into the extension system. More...
|
|
virtual IExtension * | LoadExternal (IExtensionInterface *pInterface, const char *filepath, const char *filename, char *error, size_t maxlength)=0 |
| Loads an extension into the extension system, directly, as an external extension. More...
|
|
virtual bool | UnloadExtension (IExtension *pExt)=0 |
| Attempts to unload an extension. External extensions must call this before unloading. More...
|
|
Manages the loading/unloading of extensions.
virtual bool SourceMod::IExtensionManager::IsVersionCompatible |
( |
unsigned int |
version | ) |
|
|
inlinevirtual |
Must return whether the requested version number is backwards compatible. Note: This can be overridden for breaking changes or custom versioning.
- Parameters
-
version | Version number to compare against. |
- Returns
- True if compatible, false otherwise.
Reimplemented from SourceMod::SMInterface.
virtual IExtension* SourceMod::IExtensionManager::LoadExtension |
( |
const char * |
path, |
|
|
char * |
error, |
|
|
size_t |
maxlength |
|
) |
| |
|
pure virtual |
Loads a extension into the extension system.
- Parameters
-
path | Path to extension file, relative to the extensions folder. |
error | Error buffer. |
maxlength | Maximum error buffer length. |
- Returns
- New IExtension on success, NULL on failure. If NULL is returned, the error buffer will be filled with a null-terminated string.
virtual IExtension* SourceMod::IExtensionManager::LoadExternal |
( |
IExtensionInterface * |
pInterface, |
|
|
const char * |
filepath, |
|
|
const char * |
filename, |
|
|
char * |
error, |
|
|
size_t |
maxlength |
|
) |
| |
|
pure virtual |
Loads an extension into the extension system, directly, as an external extension.
The extension receives all normal callbacks. However, it is never opened via LoadLibrary/dlopen or closed via FreeLibrary or dlclose.
- Parameters
-
pInterface | Pointer to an IExtensionInterface instance. |
filepath | Relative path to the extension's file, from mod folder. |
filename | Name to use to uniquely identify the extension. The name should be generic, without any platform-specific suffices. For example, sdktools.ext instead of sdktools.ext.so. This filename is used to detect if the extension is already loaded, and to verify plugins that require the same extension. |
error | Buffer to store error message. |
maxlength | Maximum size of the error buffer. |
- Returns
- IExtension pointer on success, NULL on failure. If NULL is returned, the error buffer will be filled with a null-terminated string.
virtual bool SourceMod::IExtensionManager::UnloadExtension |
( |
IExtension * |
pExt | ) |
|
|
pure virtual |
Attempts to unload an extension. External extensions must call this before unloading.
- Parameters
-
- Returns
- True if successful, false otherwise.
The documentation for this class was generated from the following file: