diff --git a/src/headers/argparse b/src/headers/argparse index d9376cd..ff8e28f 100644 --- a/src/headers/argparse +++ b/src/headers/argparse @@ -2,6 +2,8 @@ #ifndef ARGPARSE_HPP #define ARGPARSE_HPP #include +#include +#include #include "macros.h" #ifdef __linux__ diff --git a/src/headers/parser/parser_v3.hpp b/src/headers/parser/argument_builder.hpp similarity index 100% rename from src/headers/parser/parser_v3.hpp rename to src/headers/parser/argument_builder.hpp diff --git a/src/headers/parser/parsing_traits/traits.hpp b/src/headers/parser/parsing_traits/traits.hpp index c88664c..5e6bbfe 100644 --- a/src/headers/parser/parsing_traits/traits.hpp +++ b/src/headers/parser/parsing_traits/traits.hpp @@ -5,7 +5,7 @@ #include namespace argument_parser::parsing_traits { - using hint_type = const char *; + using hint_type = const char*; template struct parser_trait { using type = T_; @@ -50,6 +50,42 @@ namespace argument_parser::parsing_traits { static constexpr hint_type format_hint = "3.14"; static constexpr hint_type purpose_hint = "double precision floating point number"; }; + + + + constexpr hint_type comma = ","; + template + struct hint_provider { + static constexpr hint_type value = *PtrAddr; + }; + + template + struct joiner { + static constexpr auto get_combined() { + constexpr size_t total_len = (std::string_view{Providers::value}.length() + ... + 0); + + std::array arr{}; + size_t offset = 0; + + auto append = [&](hint_type s) { + std::string_view sv{s}; + for (char c : sv) arr[offset++] = c; + return 0; + }; + + (append(Providers::value), ...); + + arr[total_len] = '\0'; + return arr; + } + + static constexpr auto storage = get_combined(); + static constexpr hint_type value = storage.data(); + }; + + template + constexpr hint_type concat = joiner::value; + } // namespace argument_parser::parsing_traits #endif