1717// функция инициализации section_name и line_name
1818
1919#define TEMPLATE_SPECIALIZATION \
20- template <u32 ITEM_REC_NUM, typename ITEM_DATA, typename T_ID, typename T_INDEX, typename T_INIT>
20+ template <bool ITEM_REC_NUM, typename ITEM_DATA, typename T_ID, typename T_INDEX, typename T_INIT>
2121#define CSINI_IdToIndex CIni_IdToIndex<ITEM_REC_NUM, ITEM_DATA, T_ID, T_INDEX, T_INIT>
2222
2323TEMPLATE_SPECIALIZATION
@@ -31,22 +31,25 @@ class CIni_IdToIndex
3131 typedef xr_vector<ITEM_DATA> T_VECTOR;
3232 static T_VECTOR* m_pItemDataVector;
3333
34- template <u32 NUM >
34+ template <bool isNum >
3535 static void LoadItemData (u32 count, LPCSTR cfgRecord)
3636 {
37- static_assert (NUM < 2 , " Specialization for LoadItemData in CIni_IdToIndex not found." ); // Xottab_DUTY: Is this correct?
3837 for (u32 k = 0 ; k < count; k += 1 )
3938 {
4039 string64 buf;
4140 LPCSTR id_str = _GetItem (cfgRecord, k, buf);
42- char * id_str_lwr = xr_strdup (id_str); // not used
41+ char * id_str_lwr = xr_strdup (id_str); // not used?
4342 xr_strlwr (id_str_lwr);
44- if constexpr (NUM == 0 ) {
43+
44+ if constexpr (!isNum)
45+ {
4546 ITEM_DATA item_data (T_INDEX (m_pItemDataVector->size ()), T_ID (id_str));
4647 m_pItemDataVector->push_back (item_data);
47- } else {
48+ }
49+ else
50+ {
4851 string64 buf1;
49- LPCSTR rec1 = _GetItem (cfgRecord, k + 1 , buf1);
52+ LPCSTR rec1 = _GetItem (cfgRecord, ++k , buf1);
5053 ITEM_DATA item_data (T_INDEX (m_pItemDataVector->size ()), T_ID (id_str), rec1);
5154 m_pItemDataVector->push_back (item_data);
5255 }
0 commit comments