SourceMod::IExtensionManager Class Reference

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

#include <public/IExtensionSys.h>

Inherits SourceMod::SMInterface.

Inheritance diagram for SourceMod::IExtensionManager:

[legend]
Collaboration diagram for SourceMod::IExtensionManager:
[legend]
List of all members.

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.
virtual IExtensionLoadExtension (const char *path, char *error, size_t maxlength)=0
 Loads a extension into the extension system.
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.
virtual bool UnloadExtension (IExtension *pExt)=0
 Attempts to unload an extension. External extensions must call this before unloading.

Detailed Description

Manages the loading/unloading of extensions.

Definition at line 340 of file IExtensionSys.h.


Member Function Documentation

virtual bool SourceMod::IExtensionManager::IsVersionCompatible ( unsigned int  version  )  [inline, virtual]

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.

Definition at line 351 of file IExtensionSys.h.

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:
pExt IExtension pointer.
Returns:
True if successful, false otherwise.


The documentation for this class was generated from the following file:
Generated on Fri Nov 21 06:10:04 2008 for SourceMod SDK by  doxygen 1.5.1