Freeciv21
Develop your civilization from humble roots to a global empire
netfile.cpp File Reference
#include <fc_config.h>
#include <memory>
#include <QBuffer>
#include <QEventLoop>
#include <QJsonDocument>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QSaveFile>
#include "fcintl.h"
#include "log.h"
#include "registry_ini.h"
#include "version.h"
#include "netfile.h"
+ Include dependency graph for netfile.cpp:

Go to the source code of this file.

Functions

static bool netfile_download_file_core (const QUrl &url, QIODevice *out, const nf_errmsg &cb)
 Fetch file from given URL to given file stream. More...
 
QJsonDocument netfile_get_json_file (const QUrl &url, const nf_errmsg &cb)
 Fetch a JSON file from the net. More...
 
section_filenetfile_get_section_file (const QUrl &url, const nf_errmsg &cb)
 Fetch section file from net. More...
 
bool netfile_download_file (const QUrl &url, const char *filename, const nf_errmsg &cb)
 Fetch file from given URL and save as given filename. More...
 

Function Documentation

◆ netfile_download_file()

bool netfile_download_file ( const QUrl &  url,
const char *  filename,
const nf_errmsg cb 
)

Fetch file from given URL and save as given filename.

Definition at line 139 of file netfile.cpp.

Referenced by download_modpack().

◆ netfile_download_file_core()

static bool netfile_download_file_core ( const QUrl &  url,
QIODevice *  out,
const nf_errmsg cb 
)
static

Fetch file from given URL to given file stream.

This is core function of netfile module.

Definition at line 39 of file netfile.cpp.

Referenced by netfile_download_file(), netfile_get_json_file(), and netfile_get_section_file().

◆ netfile_get_json_file()

QJsonDocument netfile_get_json_file ( const QUrl &  url,
const nf_errmsg cb 
)

Fetch a JSON file from the net.

Definition at line 98 of file netfile.cpp.

Referenced by download_modpack(), and download_modpack_list().

◆ netfile_get_section_file()

section_file* netfile_get_section_file ( const QUrl &  url,
const nf_errmsg cb 
)

Fetch section file from net.

Definition at line 122 of file netfile.cpp.