1 #ifndef _INCLUDE_SOURCEMOD_CORE_SYSTEM_PLUGININFODATABASE_H_
2 #define _INCLUDE_SOURCEMOD_CORE_SYSTEM_PLUGININFODATABASE_H_
5 * This file parses plugin_settings.cfg and stores the information in cached memory.
6 * It provides simplistic abstraction to retrieving the info.
7 * :TODO: currently untested
10 #include "sm_memtable.h"
11 #include "ITextParsers.h"
12 #include "IPluginSys.h"
13 #include "sm_globals.h"
32 class CPluginInfoDatabase : public ITextListener_SMC
35 CPluginInfoDatabase();
36 ~CPluginInfoDatabase();
37 public: //ITextListener_SMC
38 void ReadSMC_ParseStart();
39 SMCParseResult ReadSMC_NewSection(const char *name, bool opt_quotes);
40 SMCParseResult ReadSMC_KeyValue(const char *key, const char *value, bool key_quotes, bool value_quotes);
41 SMCParseResult ReadSMC_LeavingSection();
44 * Returns the number of plugin settings available.
46 unsigned int GetSettingsNum();
49 * Given an index, returns the plugin settings block if the filename matches.
50 * Otherwise, returns NULL.
52 PluginSettings *GetSettingsIfMatch(unsigned int index, const char *filename);
55 * Given a plugin settings struct and an index,
56 * returns the given JIT key/value option pair at that index.
57 * If the input is invalid, key and val will be set to NULL.
59 void GetOptionsForPlugin(PluginSettings *settings, unsigned int opt_num, const char **key, const char **val);
61 SMCParseResult MakeError(const char *fmt, ...);
63 BaseStringTable *m_strtab;
67 unsigned int m_infodb;
68 size_t m_infodb_count;
74 #endif //_INCLUDE_SOURCEMOD_CORE_SYSTEM_PLUGININFODATABASE_H_