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_CORE_SYSTEM_PLUGININFODATABASE_H_
16 #define _INCLUDE_SOURCEMOD_CORE_SYSTEM_PLUGININFODATABASE_H_
19 * This file parses plugin_settings.cfg and stores the information in cached memory.
20 * It provides simplistic abstraction to retrieving the info.
21 * :TODO: currently untested
24 #include "sm_memtable.h"
25 #include "ITextParsers.h"
26 #include "IPluginSys.h"
27 #include "sm_globals.h"
46 class CPluginInfoDatabase : public ITextListener_SMC
49 CPluginInfoDatabase();
50 ~CPluginInfoDatabase();
51 public: //ITextListener_SMC
52 void ReadSMC_ParseStart();
53 SMCParseResult ReadSMC_NewSection(const char *name, bool opt_quotes);
54 SMCParseResult ReadSMC_KeyValue(const char *key, const char *value, bool key_quotes, bool value_quotes);
55 SMCParseResult ReadSMC_LeavingSection();
58 * Returns the number of plugin settings available.
60 unsigned int GetSettingsNum();
63 * Given an index, returns the plugin settings block if the filename matches.
64 * Otherwise, returns NULL.
66 PluginSettings *GetSettingsIfMatch(unsigned int index, const char *filename);
69 * Given a plugin settings struct and an index,
70 * returns the given JIT key/value option pair at that index.
71 * If the input is invalid, key and val will be set to NULL.
73 void GetOptionsForPlugin(PluginSettings *settings, unsigned int opt_num, const char **key, const char **val);
75 SMCParseResult MakeError(const char *fmt, ...);
77 BaseStringTable *m_strtab;
82 size_t m_infodb_count;
88 #endif //_INCLUDE_SOURCEMOD_CORE_SYSTEM_PLUGININFODATABASE_H_