3 #include "system/h-type.h"
8 #include <initializer_list>
11 using cfg_values = std::vector<concptr>;
12 using cfg_map = std::unordered_map<cfg_key, cfg_values *>;
13 using key_name_func = concptr (*)(int, char *);
16 * @brief .cfgファイルの読み取り対象とCfgData格納先のキー指定
18 * "term_xtra()"の第1引数(action-type)、第2引数(action-val)をデータの格納キーとする。
19 * action-typeはaction_typeメンバで指定する。
20 * key_name_funcにより、action-valと.cfg内の読取対象キーの対応を取る。
21 * key_name_funcの引数にaction-valが渡され、対応する読取対象キーを返す。
22 * key_name_func引数のaction-valは0から1,2,3...と順に呼ばれ、key_name_funcがNULLを返すまで続ける。
26 //! The name of the section in cfg file
28 //! the "actions" value of "term_xtra()". see:z-term.h TERM_XTRA_xxxxx
31 * Returns a reference to the name of the key at a specified action-val* in the section.
32 * *action-val : the 2nd parameter of "term_xtra()"
47 concptr get_rand(int key1_type, int key2_val);
48 void insert(int key1_type, int key2_val, cfg_values *value);
56 CfgReader(concptr dir, std::initializer_list<concptr> files);
57 CfgData *read_sections(std::initializer_list<cfg_section> sections);
58 concptr get_cfg_path()
60 return cfg_path.c_str();