libnick 2024.9.2
A cross-platform base for native Nickvision applications.
Loading...
Searching...
No Matches
web.h
Go to the documentation of this file.
1
23#ifndef WEB_H
24#define WEB_H
25
26#include <filesystem>
27#include <string>
28#include <boost/json.hpp>
29#include "curleasy.h"
30
32{
38 bool getWebsiteExists(const std::string& url);
44 boost::json::value fetchJson(const std::string& url);
57 bool downloadFile(const std::string& url, const std::filesystem::path& path, const CurlProgressFunction& progress = {}, bool overwrite = true);
58}
59
60#endif //WEB_H
Definition web.h:32
bool downloadFile(const std::string &url, const std::filesystem::path &path, const CurlProgressFunction &progress={}, bool overwrite=true)
Downloads a file to disk.
bool getWebsiteExists(const std::string &url)
Gets whether or not a url points to a valid website.
boost::json::value fetchJson(const std::string &url)
Fetches a json string from a url.
std::function< int(curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow)> CurlProgressFunction
Definition curleasy.h:34