Page MenuHomeHEPForge

FROG_Net.h
No OneTemporary

FROG_Net.h

#ifndef _FROG_NET_H__
#define _FROG_NET_H__
#include <stdio.h>
#include <iostream>
#include "curl/curl.h"
class FROG_Net {
public :
FROG_Net() {
session = curl_easy_init();
}
void connect(const char* address) {
printf("connecting %s\n",address);
curl_easy_setopt(session, CURLOPT_URL, address);
}
void write(const char* out_file) {
printf("opening %s\n",out_file);
FILE * fp = fopen(out_file, "wb");
curl_easy_setopt(session, CURLOPT_WRITEDATA, fp);
curl_easy_setopt(session, CURLOPT_WRITEFUNCTION, fwrite);
curl_easy_perform(session);
fclose(fp);
}
void close() {
curl_easy_cleanup(session);
}
private :
CURL* session;
};
#endif

File Metadata

Mime Type
text/x-c++
Expires
Sat, Dec 21, 4:24 PM (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4023434
Default Alt Text
FROG_Net.h (727 B)

Event Timeline