-#define ADD_TEXT(a, b, c, d) \
- if (b[0] != '\0') \
- { \
- LoadStringW(hInst, a, szText, _countof(szText)); \
- InsertRichEditText(szText, c); \
- InsertRichEditText(b, d); \
- } \
-
-#define ADD_TEXT_NEWL(a, b) \
- LoadStringW(hInst, a, szText, _countof(szText)); \
- InsertRichEditText(L"\n", 0); \
- InsertRichEditText(szText, b); \
- InsertRichEditText(L"\n", 0);
-
-#define GET_STRING1(a, b) \
- if (!ParserGetString(a, b, _countof(b), FindFileData.cFileName)) \
- continue;
-
-#define GET_STRING2(a, b) \
- if (!ParserGetString(a, b, _countof(b), FindFileData.cFileName)) \
- b[0] = '\0';
+
+template<typename T, size_t N, size_t N2>
+inline void _AddText(T (&szText)[N], UINT a, T (&b)[N2], DWORD c, DWORD d) {
+ if (b[0] != '\0')
+ {
+ LoadStringW(hInst, a, szText, N);
+ InsertRichEditText(szText, c);
+ InsertRichEditText(b, d);
+ }
+}
+
+template<typename T, size_t N>
+inline void _AddTextNewl(T (&szText)[N], UINT a, DWORD b) {
+ LoadStringW(hInst, a, szText, N);
+ InsertRichEditText(L"\n", 0);
+ InsertRichEditText(szText, b);
+ InsertRichEditText(L"\n", 0);
+}
+
+template<typename T, size_t N, size_t N2>
+inline BOOL _GetString(LPCWSTR a, T(&b)[N], T (&cFileName)[N2]) {
+ return ParserGetString(a, b, N, cFileName);
+}
+
+template<typename T, size_t N, size_t N2>
+inline void _GetStringNullFailure(LPCWSTR a, T(&b)[N], T (&cFileName)[N2]) {
+ if (!_GetString(a, b, cFileName)) {
+ b[0] = '\0';
+ }
+}