SourceMod SDK  1.7
SourceMod::IExtensionManager Class Referenceabstract

Manages the loading/unloading of extensions. More...

#include <public/IExtensionSys.h>

Inheritance diagram for SourceMod::IExtensionManager:
SourceMod::SMInterface

Public Member Functions

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 IExtensionLoadExtension (const char *path, char *error, size_t maxlength)=0
 Loads a extension into the extension system. More...
 
virtual IExtensionLoadExternal (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...
 

Detailed Description

Manages the loading/unloading of extensions.

Member Function Documentation

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
versionVersion 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
pathPath to extension file, relative to the extensions folder.
errorError buffer.
maxlengthMaximum 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
pInterfacePointer to an IExtensionInterface instance.
filepathRelative path to the extension's file, from mod folder.
filenameName 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.
errorBuffer to store error message.
maxlengthMaximum 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
pExtIExtension pointer.
Returns
True if successful, false otherwise.

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