diff options
author | Oleg Morozenkov <m@oleg.rocks> | 2018-07-23 02:35:50 +0300 |
---|---|---|
committer | Oleg Morozenkov <m@oleg.rocks> | 2018-07-23 02:35:50 +0300 |
commit | 98b8b7e4338b71ee46c4301b0bf2ae667be9a99d (patch) | |
tree | 32f8b0d32048b2d83b57773c0efa3db9600b8701 /include/tgbot/net/HttpReqArg.h | |
parent | 1dd3affe306793d2129f121c11e43c45ae8690da (diff) | |
parent | 167e3e7607e43a0f06c7f87ced94f481e6525b0e (diff) |
Merge branch 'master' into nicholascw-master
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; }; } |