diff options
Diffstat (limited to 'include/tgbot/net/HttpReqArg.h')
-rw-r--r-- | include/tgbot/net/HttpReqArg.h | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/include/tgbot/net/HttpReqArg.h b/include/tgbot/net/HttpReqArg.h index 7476366..a263224 100644 --- a/include/tgbot/net/HttpReqArg.h +++ b/include/tgbot/net/HttpReqArg.h @@ -24,6 +24,7 @@ #define TGBOT_HTTPPARAMETER_H #include <string> +#include <utility> #include <vector> #include <functional> @@ -39,36 +40,36 @@ namespace TgBot { class HttpReqArg { public: - template<typename T> - HttpReqArg(const std::string& name, const T& value, bool isFile = false, const std::string& mimeType = "text/plain", const std::string& fileName = "") : - name(name), value(boost::lexical_cast<std::string>(value)), isFile(isFile), mimeType(mimeType), fileName(fileName) - { - } + template<typename T> + HttpReqArg(std::string name, const T& value, bool isFile = false, std::string mimeType = "text/plain", std::string fileName = "") : + name(std::move(name)), value(boost::lexical_cast<std::string>(value)), isFile(isFile), mimeType(std::move(mimeType)), fileName(std::move(fileName)) + { + } - /** - * @brief Name of an argument. - */ - std::string name; + /** + * @brief Name of an argument. + */ + std::string name; - /** - * @brief Value of an argument. - */ - std::string value; + /** + * @brief Value of an argument. + */ + std::string value; - /** - * @brief Should be true if an argument value hold some file contents - */ - bool isFile = false; + /** + * @brief Should be true if an argument value hold some file contents + */ + bool isFile = false; - /** - * @brief Mime type of an argument value. This field makes sense only if isFile is true. - */ - std::string mimeType = "text/plain"; + /** + * @brief Mime type of an argument value. This field makes sense only if isFile is true. + */ + std::string mimeType = "text/plain"; - /** - * @brief Should be set if an argument value hold some file contents - */ - std::string fileName; + /** + * @brief Should be set if an argument value hold some file contents + */ + std::string fileName; }; } |