#pragma once #include #include #include #include #include #include #include #include #include "ParametersProvider.hpp" constexpr long curlTimeoutSeconds{5}; // View RFC 3501 and RFC 2192 for more details size_t cb(char *data, size_t size, size_t numberOfMembers, void *userdata); class CurlHandler : public QObject { Q_OBJECT public: CurlHandler(); ~CurlHandler(); void configure(const ParametersProvider::settings &sett); std::vector *fetch(); void query(std::string &c, size_t count); void setupCurl(CURL *ptr, std::string &m, const std::string &ur) const; signals: void threadFinished(size_t threadId, int uid); private: std::string url; std::unique_ptr initialCurl; CURLcode initialRes; std::string initialChunk; std::vector decodedMessages; std::vector messagesId; std::vector v; ParametersProvider::settings setts; };