diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-06-17 02:46:55 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-06-17 02:46:55 -0400 |
commit | 4ee7025ab09b606a2556bf9f42c1218d7fd72843 (patch) | |
tree | 4b7747da4be59e672d649e254474d09cab0f01c0 /src/http.hpp | |
parent | d0fa308f6e339b94044d39bf0e76b8221da48c3a (diff) | |
download | abaddon-portaudio-4ee7025ab09b606a2556bf9f42c1218d7fd72843.tar.gz abaddon-portaudio-4ee7025ab09b606a2556bf9f42c1218d7fd72843.zip |
add file upload via dnd + rework http
Diffstat (limited to 'src/http.hpp')
-rw-r--r-- | src/http.hpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/http.hpp b/src/http.hpp index 0c570db..a6f479d 100644 --- a/src/http.hpp +++ b/src/http.hpp @@ -1,9 +1,9 @@ #pragma once #include <array> +#include <set> #include <string> #include <curl/curl.h> - -// i regret not using snake case for everything oh well +#include <giomm/file.h> namespace http { enum EStatusCode : int { @@ -115,7 +115,7 @@ struct request { void set_body(const std::string &data); void set_user_agent(const std::string &data); void make_form(); - void add_file(std::string_view name, std::string_view file_path, std::string_view filename); + void add_file(std::string_view name, const Glib::RefPtr<Gio::File> &file, std::string_view filename); void add_field(std::string_view name, const char *data, size_t size); response execute(); @@ -129,6 +129,8 @@ private: curl_slist *m_header_list = nullptr; std::array<char, CURL_ERROR_SIZE> m_error_buf = { 0 }; curl_mime *m_form = nullptr; + + std::set<Glib::RefPtr<Gio::FileInputStream>> m_read_streams; }; using response_type = response; |