libnick 2024.12.0
A cross-platform base for native Nickvision applications.
|
Functions | |
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. | |
bool | downloadFile (const std::string &url, const std::filesystem::path &path, const CurlProgressFunction &progress={}, bool overwrite=true) |
Downloads a file to disk. | |
bool Nickvision::Network::Web::downloadFile | ( | const std::string & | url, |
const std::filesystem::path & | path, | ||
const CurlProgressFunction & | progress = {}, | ||
bool | overwrite = true ) |
Downloads a file to disk.
url | The url of the file to download |
path | The path on disk to save the file |
progress | An optional function to receive progress on the download std::function<int(curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow)> dltotal - The total number of bytes to be downloaded dlnow - The total number of bytes currently downloaded ultotal - The total number of bytes to be uploaded (will always be 0) ulnow - The total number of bytes currently uploaded (will always be 0) |
overwrite | Whether or not to overwrite existing files on disk |
boost::json::value Nickvision::Network::Web::fetchJson | ( | const std::string & | url | ) |
Fetches a json string from a url.
url | The url of the json string |
bool Nickvision::Network::Web::getWebsiteExists | ( | const std::string & | url | ) |
Gets whether or not a url points to a valid website.
url | The url to check |