diff --git a/include/behaviortree_cpp/basic_types.h b/include/behaviortree_cpp/basic_types.h index bceef4fd9..b61d49c16 100644 --- a/include/behaviortree_cpp/basic_types.h +++ b/include/behaviortree_cpp/basic_types.h @@ -183,6 +183,10 @@ template <> template <> [[nodiscard]] std::vector convertFromString>(StringView str); +// Boolean values separated by the character ";" +template <> +[[nodiscard]] std::vector convertFromString>(StringView str); + // Strings separated by the character ";" template <> [[nodiscard]] std::vector diff --git a/src/basic_types.cpp b/src/basic_types.cpp index 6cc4bc668..ab5e016bb 100644 --- a/src/basic_types.cpp +++ b/src/basic_types.cpp @@ -237,6 +237,19 @@ std::vector convertFromString>(StringView str) return output; } +template <> +std::vector convertFromString>(StringView str) +{ + auto parts = splitString(str, ';'); + std::vector output; + output.reserve(parts.size()); + for(const StringView& part : parts) + { + output.push_back(convertFromString(part)); + } + return output; +} + template <> std::vector convertFromString>(StringView str) {