SourceMod SDK  1.7
SourceMod::IGameConfigManager Class Referenceabstract

Manages game config files. More...

#include <public/IGameConfigs.h>

Inheritance diagram for SourceMod::IGameConfigManager:
SourceMod::SMInterface

Public Member Functions

const char * GetInterfaceName ()
 Must return a string defining the interface's unique name.
 
unsigned int GetInterfaceVersion ()
 Must return an integer defining the interface's version.
 
virtual bool LoadGameConfigFile (const char *file, IGameConfig **pConfig, char *error, size_t maxlength)=0
 Loads or finds an already loaded game config file. More...
 
virtual void CloseGameConfigFile (IGameConfig *cfg)=0
 Closes an IGameConfig pointer. Since a file can be loaded more than once, the file will not actually be removed from memory until it is closed once for each call to LoadGameConfigfile(). More...
 
virtual IGameConfigReadHandle (Handle_t hndl, IdentityToken_t *ident, HandleError *err)=0
 Reads an GameConfig Handle. More...
 
virtual void AddUserConfigHook (const char *sectionname, ITextListener_SMC *listener)=0
 Adds a custom gamedata section hook. More...
 
virtual void RemoveUserConfigHook (const char *sectionname, ITextListener_SMC *listener)=0
 Removes a custom gamedata section hook. More...
 
virtual void AcquireLock ()=0
 Does nothing.
 
virtual void ReleaseLock ()=0
 Does nothing.
 
- Public Member Functions inherited from SourceMod::SMInterface
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...
 

Detailed Description

Manages game config files.

Member Function Documentation

virtual void SourceMod::IGameConfigManager::AddUserConfigHook ( const char *  sectionname,
ITextListener_SMC listener 
)
pure virtual

Adds a custom gamedata section hook.

Parameters
sectionnameSection name to hook.
listenerListener callback.
virtual void SourceMod::IGameConfigManager::CloseGameConfigFile ( IGameConfig cfg)
pure virtual

Closes an IGameConfig pointer. Since a file can be loaded more than once, the file will not actually be removed from memory until it is closed once for each call to LoadGameConfigfile().

Parameters
cfgPointer to the IGameConfig to close.
virtual bool SourceMod::IGameConfigManager::LoadGameConfigFile ( const char *  file,
IGameConfig **  pConfig,
char *  error,
size_t  maxlength 
)
pure virtual

Loads or finds an already loaded game config file.

Parameters
fileFile to load. The path must be relative to the 'gamedata' folder and the extension should be omitted.
pConfigPointer to store the game config pointer. Pointer will be valid even on failure.
errorOptional error message buffer.
maxlengthMaximum length of the error buffer.
Returns
True on success, false if the file failed.
virtual IGameConfig* SourceMod::IGameConfigManager::ReadHandle ( Handle_t  hndl,
IdentityToken_t *  ident,
HandleError *  err 
)
pure virtual

Reads an GameConfig Handle.

Parameters
hndlHandle to read.
identIdentity of the owner (can be NULL).
errOptional error buffer.
Returns
IGameConfig pointer on success, NULL otherwise.
virtual void SourceMod::IGameConfigManager::RemoveUserConfigHook ( const char *  sectionname,
ITextListener_SMC listener 
)
pure virtual

Removes a custom gamedata section hook.

Parameters
sectionnameSection name to unhook.
listenerListener callback.

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