Vector Converter
-
template<typename T_Inner>
struct Converter<std::vector<T_Inner>> A partial specialisation of Converter<T> to allow the extraction of vectors.
Functionally, this acts as a wrapper, iteratively calling Converter<T_Inner> on the values extracted
Public Static Functions
-
static inline std::vector<T_Inner> internalConvert(std::string_view sv, typename std::enable_if_t<!std::is_same_v<T_Inner, char>>* = nullptr)
Calls internalConvert(std::string_view, std::string_view,typename) with the default delimiter (a comma)
-
static inline std::vector<T_Inner> internalConvert(std::string_view sv, std::string_view element_delimiter, typename std::enable_if_t<!std::is_same_v<T_Inner, char>>* = nullptr)
The iterative converter for vector types — loops over the split-vector and converts the internal types.
The
typenameargument allows the function to disable itself at compile time if T_Inner is a char, thus inducing a Substitution Failure. Through SFINAE principles, this allows std::string (internally a std::vector<char> in many ways) to be ignored by this, and thus picked up by the standard converter
-
static inline std::string_view StripEndCaps(std::string_view sv)
We allow vectors to be wrapped in either [], {} or (). This function removes them for internal use.
Warning
We do not do any form of parsing or checking to allow nested braces. End caps are purely for user readability.
-
static inline std::vector<T_Inner> internalConvert(std::string_view sv, typename std::enable_if_t<!std::is_same_v<T_Inner, char>>* = nullptr)