GlistEngine
Loading...
Searching...
No Matches
gHttpFile.h
Go to the documentation of this file.
1/*
2 * gHttpFile.h
3 *
4 * Created on: 10 Tem 2021
5 * Author: berka
6 */
7
8#ifndef UTILS_GHTTPFILE_H_
9#define UTILS_GHTTPFILE_H_
10
11#ifndef EMSCRIPTEN
12#include <curl/curl.h>
13#include <stdio.h>
14#include <iostream>
15#include <string>
16
17#include "gFile.h"
18#include "gObject.h"
19
20class gHttpFile : public gObject {
21public:
23 virtual ~gHttpFile();
28 static int progressCallback(ProgressData *p, double totaltodownload, double downloaded, double totaltoupload, double uploaded);
29 static size_t writeCallBack(char *contents, size_t size, size_t nmemb, void *userp);
30 void load(std::string url);
31 std::string getUrl();
32 void save(std::string filepath, bool isBinary = false);
33 std::string getHtml();
41 double getFileLength();
42
43private:
44 std::string filepath;
45 std::string url;
46 gFile file;
47 std::string html;
48 int statuscode;
49
50 void loadHtml();
51};
52
53#endif
54
55#endif /* UTILS_GHTTPFILE_H_ */
Definition gFile.h:33
Definition gHttpFile.h:20
double getFileLength()
static int progressCallback(ProgressData *p, double totaltodownload, double downloaded, double totaltoupload, double uploaded)
void save(std::string filepath, bool isBinary=false)
static size_t writeCallBack(char *contents, size_t size, size_t nmemb, void *userp)
double getProgressLength()
virtual ~gHttpFile()
int getStatusCode()
std::string getUrl()
struct gHttpFile::ProgressData prog
void load(std::string url)
std::string getHtml()
Definition gObject.h:33
Definition gHttpFile.h:24
double progresslength
Definition gHttpFile.h:25
double filelength
Definition gHttpFile.h:26