Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F8309745
FROG_Net.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
727 B
Subscribers
None
FROG_Net.h
View Options
#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
Details
Attached
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)
Attached To
rFROGSVN frogsvn
Event Timeline
Log In to Comment