- Added libcurl to mega-glest for mu;ti-purpose / multi-platform http and ftp requests

(for linux requires the following new dependency: sudo apt-get install libcurl4-dev)
This commit is contained in:
Mark Vejvoda
2010-05-11 05:39:00 +00:00
parent f7b6ef8450
commit 25b63b10e1
6 changed files with 130 additions and 10 deletions

View File

@@ -16,6 +16,7 @@
#include <fstream>
#include <map>
#include "thread.h"
#include <curl/curl.h>
using std::string;
using namespace Shared::Platform;
@@ -28,6 +29,11 @@ class SystemFlags
{
public:
struct httpMemoryStruct {
char *memory;
size_t size;
};
enum DebugType {
debugSystem,
debugNetwork,
@@ -100,11 +106,15 @@ protected:
public:
static CURL *curl_handle;
SystemFlags();
~SystemFlags();
static void init();
static SystemFlagsType & getSystemSettingType(DebugType type) { return debugLogFileList[type]; }
static size_t httpWriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data);
static std::string getHTTP(std::string URL);
// Let the macro call into this when require.. NEVER call it automatically.
static void handleDebug(DebugType type, const char *fmt, ...);