add separated list with a prefix

This commit is contained in:
jacekpoz 2024-04-21 10:40:43 +02:00
parent 019d55afd2
commit becc44a098
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8
3 changed files with 7 additions and 1 deletions

View file

@ -44,6 +44,7 @@
#define VAR_LIST(section, name, type) std::vector<type> name;
#define VAR_LIST_SEP(section, name, type, sep) std::vector<type> name;
#define VAR_LIST_SEP_P(section, name, type, sep, prefix) std::vector<type> name;
#define VAR_LIST_NUMBERED(section, name, type) std::vector<type> name;
#define ENUM(name, ...) \
@ -162,4 +163,5 @@
#undef VAR_LIST
#undef VAR_LIST_SEP
#undef VAR_LIST_SEP_P
#undef VAR_LIST_NUMBERED

View file

@ -44,6 +44,7 @@
#define VAR_LIST(section, name, type)
#define VAR_LIST_SEP(section, name, type, sep)
#define VAR_LIST_SEP_P(section, name, type, sep, prefix)
#define VAR_LIST_NUMBERED(section, name, type)
#endif // CONFIG
@ -149,7 +150,7 @@ CONFIG(Difficulty,
VAR_STRING(.metadata, creator)
VAR_STRING(.metadata, version)
VAR_STRING(.metadata, source)
VAR_LIST_SEP(.metadata, tags, std::string, " ")
VAR_LIST_SEP_P(.metadata, tags, std::string, " ", "Tags")
VAR_UINT(.metadata, beatmapID)
VAR_UINT(.metadata, beatmapSetID)
)
@ -264,5 +265,6 @@ STRUCT_OUTPUT_STREAM_OP(Difficulty,
#undef VAR_LIST
#undef VAR_LIST_SEP
#undef VAR_LIST_SEP_P
#undef VAR_LIST_NUMBERED
#endif // CONFIG_DEFINED

View file

@ -41,6 +41,7 @@ namespace fs = std::filesystem;
#define VAR_LIST(section, name, type)
#define VAR_LIST_SEP(section, name, type, sep)
#define VAR_LIST_SEP_P(section, name, type, sep)
#define VAR_LIST_NUMBERED(section, name, type)
#include <config_def.hpp>
@ -80,4 +81,5 @@ namespace fs = std::filesystem;
#undef VAR_LIST
#undef VAR_LIST_SEP
#undef VAR_LIST_SEP_P
#undef VAR_LIST_NUMBERED