mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 17:01:08 +02:00
adding some curl helpers
Origin commit data
------------------
Branch: ni/coolstream
Commit: 25887007ac
Author: TangoCash <eric@loxat.de>
Date: 2018-08-19 (Sun, 19 Aug 2018)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -33,6 +33,9 @@
|
||||
#include <sys/types.h>
|
||||
#include <map>
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <curl/easy.h>
|
||||
|
||||
int my_system(const char * cmd);
|
||||
int my_system(int argc, const char *arg, ...); /* argc is number of arguments including command */
|
||||
|
||||
@@ -160,4 +163,20 @@ std::string readFile(std::string file);
|
||||
std::string iso_8859_1_to_utf8(std::string &str);
|
||||
bool utf8_check_is_valid(const std::string &str);
|
||||
|
||||
// curl
|
||||
struct MemoryStruct {
|
||||
char *memory;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
size_t CurlWriteToString(void *ptr, size_t size, size_t nmemb, void *data);
|
||||
size_t WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data);
|
||||
|
||||
std::string encodeUrl(std::string txt);
|
||||
std::string decodeUrl(std::string url);
|
||||
|
||||
bool getUrl(std::string &url, std::string &answer, const std::string userAgent = " ", unsigned int timeout = 60);
|
||||
bool downloadUrl(std::string url, std::string file, const std::string userAgent = " ", unsigned int timeout = 60);
|
||||
|
||||
//
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user