diff options
Diffstat (limited to 'include/tgbot/net/HttpReqArg.h')
-rw-r--r-- | include/tgbot/net/HttpReqArg.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/tgbot/net/HttpReqArg.h b/include/tgbot/net/HttpReqArg.h index f0e4492..5056e6c 100644 --- a/include/tgbot/net/HttpReqArg.h +++ b/include/tgbot/net/HttpReqArg.h @@ -24,6 +24,7 @@ #define TGBOT_HTTPPARAMETER_H #include <string> +#include <vector> #include <boost/lexical_cast.hpp> @@ -42,6 +43,22 @@ public: { } + template<typename T> + HttpReqArg(const std::string& name, const std::vector<T>& list, function<std::string (const T&)> parsingFunction){ + this->name = name; + value = "["; + for (const T& item : list){ + value += parsingFunction(item); + value += ','; + } + value.erase(this->value.length() - 1); + value += ']'; + + isFile = false; + mimeType = "text/plain"; + fileName = ""; + } + /** * Name of an argument. */ |