diff options
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 |