3 * ===============================================================
4 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
5 * ===============================================================
7 * This file is not open source and may not be copied without explicit
8 * written permission of AlliedModders LLC. This file may not be redistributed
9 * in whole or significant part.
10 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
15 #ifndef _INCLUDE_SOURCEMOD_CGAMECONFIGS_H_
16 #define _INCLUDE_SOURCEMOD_CGAMECONFIGS_H_
18 #include <IGameConfigs.h>
19 #include <ITextParsers.h>
22 #include "sm_globals.h"
23 #include "sm_memtable.h"
25 using namespace SourceMod;
26 using namespace SourceHook;
31 public ITextListener_SMC,
35 CGameConfig(const char *file);
38 bool Reparse(char *error, size_t maxlength);
39 public: //ITextListener_SMC
40 SMCParseResult ReadSMC_NewSection(const char *name, bool opt_quotes);
41 SMCParseResult ReadSMC_KeyValue(const char *key, const char *value, bool key_quotes, bool value_quotes);
42 SMCParseResult ReadSMC_LeavingSection();
44 const char *GetKeyValue(const char *key);
45 bool GetOffset(const char *key, int *value);
46 SendProp *GetSendProp(const char *key);
49 unsigned int DecRefCount();
51 BaseStringTable *m_pStrings;
56 unsigned int m_RefCount;
59 unsigned int m_IgnoreLevel;
66 class GameConfigManager :
67 public IGameConfigManager,
73 public: //IGameConfigManager
74 bool LoadGameConfigFile(const char *file, IGameConfig **pConfig, char *error, size_t maxlength);
75 void CloseGameConfigFile(IGameConfig *cfg);
76 public: //SMGlobalClass
77 void OnSourceModStartup(bool late);
78 void OnSourceModAllInitialized();
79 void OnSourceModAllShutdown();
81 List<CGameConfig *> m_cfgs;
85 extern GameConfigManager g_GameConfigs;
86 extern IGameConfig *g_pGameConf;
88 #endif //_INCLUDE_SOURCEMOD_CGAMECONFIGS_H_