From becc44a098a8a2f15b728e5a10c809cf5fcb682a Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Sun, 21 Apr 2024 10:40:43 +0200 Subject: [PATCH] add separated list with a prefix --- include/config.hpp | 2 ++ include/config_def.hpp | 4 +++- include/osuparser.hpp | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/config.hpp b/include/config.hpp index a8645fe..971e50d 100644 --- a/include/config.hpp +++ b/include/config.hpp @@ -44,6 +44,7 @@ #define VAR_LIST(section, name, type) std::vector name; #define VAR_LIST_SEP(section, name, type, sep) std::vector name; +#define VAR_LIST_SEP_P(section, name, type, sep, prefix) std::vector name; #define VAR_LIST_NUMBERED(section, name, type) std::vector name; #define ENUM(name, ...) \ @@ -162,4 +163,5 @@ #undef VAR_LIST #undef VAR_LIST_SEP +#undef VAR_LIST_SEP_P #undef VAR_LIST_NUMBERED diff --git a/include/config_def.hpp b/include/config_def.hpp index 46e28f5..733f14f 100644 --- a/include/config_def.hpp +++ b/include/config_def.hpp @@ -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 diff --git a/include/osuparser.hpp b/include/osuparser.hpp index c89ff16..457be8b 100644 --- a/include/osuparser.hpp +++ b/include/osuparser.hpp @@ -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 @@ -80,4 +81,5 @@ namespace fs = std::filesystem; #undef VAR_LIST #undef VAR_LIST_SEP +#undef VAR_LIST_SEP_P #undef VAR_LIST_NUMBERED