diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-12-01 18:05:16 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2019-12-01 18:05:16 +0100 |
commit | 6c7adadf6d5c85d5e280e965d4dee1563bf46821 (patch) | |
tree | fecdef2d933e0e83e23e0d87bf42139820490bbc /include/DownloadUtils.hpp | |
parent | 129d842030fa993e800009ec0ab170f109e8e899 (diff) |
Add 4chan posting
Diffstat (limited to 'include/DownloadUtils.hpp')
-rw-r--r-- | include/DownloadUtils.hpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/DownloadUtils.hpp b/include/DownloadUtils.hpp new file mode 100644 index 0000000..78fc859 --- /dev/null +++ b/include/DownloadUtils.hpp @@ -0,0 +1,25 @@ +#pragma once + +#include <string> +#include <vector> + +namespace QuickMedia { + enum class DownloadResult { + OK, + ERR, + NET_ERR + }; + + struct CommandArg { + std::string option; + std::string value; + }; + + struct FormData { + std::string key; + std::string value; + }; + + DownloadResult download_to_string(const std::string &url, std::string &result, const std::vector<CommandArg> &additional_args = {}, bool use_tor = false); + std::vector<CommandArg> create_command_args_from_form_data(const std::vector<FormData> &form_data); +}
\ No newline at end of file |