SourceMod::ISourceMod Class Reference

Contains miscellaneous helper functions. More...

#include <public/ISourceMod.h>

Inherits SourceMod::SMInterface.

Inheritance diagram for SourceMod::ISourceMod:

[legend]
Collaboration diagram for SourceMod::ISourceMod:
[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 const char * GetGamePath () const=0
 Returns the full path to the game directory.
virtual const char * GetSourceModPath () const=0
 Returns the full path to the SourceMod directory.
virtual size_t BuildPath (PathType type, char *buffer, size_t maxlength, const char *format,...)=0
 Builds a platform path for a specific target base path.
virtual void LogMessage (IExtension *pExt, const char *format,...)=0
 Logs a message to the SourceMod logs.
virtual void LogError (IExtension *pExt, const char *format,...)=0
 Logs a message to the SourceMod error logs.
virtual size_t FormatString (char *buffer, size_t maxlength, SourcePawn::IPluginContext *pContext, const cell_t *params, unsigned int param)=0
 Formats a string from a native.
virtual IDataPackCreateDataPack ()=0
 Creates a data pack object.
virtual void FreeDataPack (IDataPack *pack)=0
 Releases a data pack's resources so it can be re-used.
virtual HandleType_t GetDataPackHandleType (bool readonly=false)=0
 Not implemented, do not use.
virtual KeyValues * ReadKeyValuesHandle (Handle_t hndl, HandleError *err=NULL, bool root=false)=0
 Retrieves a KeyValues pointer from a handle.
virtual const char * GetGameFolderName () const=0
 Returns the name of the game directory.
virtual SourcePawn::ISourcePawnEngineGetScriptingEngine ()=0
 Returns the scripting engine interface.
virtual SourcePawn::IVirtualMachine * GetScriptingVM ()=0
 Deprecated, do not use.
virtual time_t GetAdjustedTime ()=0
 Returns the adjusted server time.
virtual unsigned int SetGlobalTarget (unsigned int index)=0
 Sets the global client SourceMod will use for assisted translations (that is, t).
virtual unsigned int GetGlobalTarget () const=0
 Returns the global client SourceMod is currently using for assisted translations (that is, t).
virtual void AddGameFrameHook (GAME_FRAME_HOOK hook)=0
 Adds a function to be called each game frame.
virtual void RemoveGameFrameHook (GAME_FRAME_HOOK hook)=0
 Removes one game frame hook matching the given function.

Detailed Description

Contains miscellaneous helper functions.

Definition at line 76 of file ISourceMod.h.


Member Function Documentation

virtual const char* SourceMod::ISourceMod::GetGamePath (  )  const [pure virtual]

Returns the full path to the game directory.

Returns:
A string containing the full game path.

virtual const char* SourceMod::ISourceMod::GetSourceModPath (  )  const [pure virtual]

Returns the full path to the SourceMod directory.

Returns:
A string containing the full SourceMod path.

virtual size_t SourceMod::ISourceMod::BuildPath ( PathType  type,
char *  buffer,
size_t  maxlength,
const char *  format,
  ... 
) [pure virtual]

Builds a platform path for a specific target base path.

If the path starts with the string "file://" and the PathType is not relative, then the "file://" portion is stripped off, and the rest of the path is used without any modification (except for correcting slashes). This can be used to override the path builder to supply alternate absolute paths. Examples:

file://C:/Temp/file.txt file:///tmp/file.txt

Parameters:
type Type of path to use as a base.
buffer Buffer to write to.
maxlength Size of buffer.
format Format string.
... Format arguments.
Returns:
Number of bytes written.

virtual void SourceMod::ISourceMod::LogMessage ( IExtension pExt,
const char *  format,
  ... 
) [pure virtual]

Logs a message to the SourceMod logs.

Parameters:
pExt Extension calling this function.
format Message format.
... Message format parameters.

virtual void SourceMod::ISourceMod::LogError ( IExtension pExt,
const char *  format,
  ... 
) [pure virtual]

Logs a message to the SourceMod error logs.

Parameters:
pExt Extension calling this function.
format Message format.
... Message format parameters.

virtual size_t SourceMod::ISourceMod::FormatString ( char *  buffer,
size_t  maxlength,
SourcePawn::IPluginContext pContext,
const cell_t params,
unsigned int  param 
) [pure virtual]

Formats a string from a native.

Parameters:
buffer Buffer to store message.
maxlength Maximum length of buffer (including null terminator).
pContext Pointer to the plugin's context.
params Parameter array that was passed to the native.
param Parameter index where format string and variable arguments begin. Note: parameter indexes start at 1.
Returns:
Number of bytes written, not including the null terminator.

virtual IDataPack* SourceMod::ISourceMod::CreateDataPack (  )  [pure virtual]

Creates a data pack object.

Returns:
A new IDataPack object.

virtual void SourceMod::ISourceMod::FreeDataPack ( IDataPack pack  )  [pure virtual]

Releases a data pack's resources so it can be re-used.

Parameters:
pack An IDataPack object to release.

virtual HandleType_t SourceMod::ISourceMod::GetDataPackHandleType ( bool  readonly = false  )  [pure virtual]

Not implemented, do not use.

Parameters:
readonly Ignored
Returns:
0

virtual KeyValues* SourceMod::ISourceMod::ReadKeyValuesHandle ( Handle_t  hndl,
HandleError err = NULL,
bool  root = false 
) [pure virtual]

Retrieves a KeyValues pointer from a handle.

Parameters:
hndl Handle_t from which to retrieve contents.
err Optional address to store a possible handle error.
root If true it will return the root KeyValues pointer for the whole structure.
Returns:
The KeyValues pointer, or NULL for any error encountered.

virtual const char* SourceMod::ISourceMod::GetGameFolderName (  )  const [pure virtual]

Returns the name of the game directory.

Returns:
A string containing the name of the game directory.

virtual SourcePawn::ISourcePawnEngine* SourceMod::ISourceMod::GetScriptingEngine (  )  [pure virtual]

Returns the scripting engine interface.

Returns:
A pointer to the scripting engine interface.

virtual SourcePawn::IVirtualMachine* SourceMod::ISourceMod::GetScriptingVM (  )  [pure virtual]

Deprecated, do not use.

Returns:
NULL.

virtual time_t SourceMod::ISourceMod::GetAdjustedTime (  )  [pure virtual]

Returns the adjusted server time.

Returns:
Adjusted server time.

virtual unsigned int SourceMod::ISourceMod::SetGlobalTarget ( unsigned int  index  )  [pure virtual]

Sets the global client SourceMod will use for assisted translations (that is, t).

Parameters:
index Client index.
Deprecated:
Use ITranslator::GetGlobalTarget() instead.
Returns:
Old global client value.

virtual unsigned int SourceMod::ISourceMod::GetGlobalTarget (  )  const [pure virtual]

Returns the global client SourceMod is currently using for assisted translations (that is, t).

Deprecated:
Use ITranslator::GetGlobalTarget() instead.
Returns:
Global client value.

virtual void SourceMod::ISourceMod::AddGameFrameHook ( GAME_FRAME_HOOK  hook  )  [pure virtual]

Adds a function to be called each game frame.

Parameters:
hook Hook function.

virtual void SourceMod::ISourceMod::RemoveGameFrameHook ( GAME_FRAME_HOOK  hook  )  [pure virtual]

Removes one game frame hook matching the given function.

Parameters:
hook Hook function.


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