Freeciv21
Develop your civilization from humble roots to a global empire
netfile.h
Go to the documentation of this file.
1 /**************************************************************************
2  Copyright (c) 1996-2020 Freeciv21 and Freeciv contributors. This file is
3  __ __ part of Freeciv21. Freeciv21 is free software: you can
4 / \\..// \ redistribute it and/or modify it under the terms of the GNU
5  ( oo ) General Public License as published by the Free Software
6  \__/ Foundation, either version 3 of the License, or (at your
7  option) any later version. You should have received
8  a copy of the GNU General Public License along with Freeciv21. If not,
9  see https://www.gnu.org/licenses/.
10 **************************************************************************/
11 
12 #pragma once
13 
14 #include <functional>
15 
16 // Forward declarations
17 class QJsonDocument;
18 class QString;
19 class QUrl;
20 
21 struct section_file;
22 
23 using nf_errmsg = std::function<void(const QString &message)>;
24 
25 QJsonDocument netfile_get_json_file(const QUrl &url, const nf_errmsg &cb);
26 
27 section_file *netfile_get_section_file(const QUrl &url, const nf_errmsg &cb);
28 
29 bool netfile_download_file(const QUrl &url, const char *filename,
30  const nf_errmsg &cb);
section_file * netfile_get_section_file(const QUrl &url, const nf_errmsg &cb)
Fetch section file from net.
Definition: netfile.cpp:122
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: netfile.cpp:139
QJsonDocument netfile_get_json_file(const QUrl &url, const nf_errmsg &cb)
Fetch a JSON file from the net.
Definition: netfile.cpp:98
std::function< void(const QString &message)> nf_errmsg
Definition: netfile.h:23