Joedb
9.1.4
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
src
joedb
journal
CURL_File.h
Go to the documentation of this file.
1
#ifndef joedb_CURL_File_declared
2
#define joedb_CURL_File_declared
3
4
#include "
joedb/journal/Buffered_File.h
"
5
6
#define CURL_NO_OLDIES
7
#include <curl/curl.h>
8
9
namespace
joedb
10
{
11
class
CURL_Easy
12
{
13
protected
:
14
CURL *
const
curl
;
15
16
public
:
17
CURL_Easy
();
18
CURL_Easy
(
const
CURL_Easy
&) =
delete
;
19
CURL_Easy
&
operator=
(
const
CURL_Easy
&) =
delete
;
20
~CURL_Easy
();
21
};
22
23
/// @ingroup journal
24
class
CURL_File
:
public
CURL_Easy
,
public
Buffered_File
25
{
26
private
:
27
static
void
error_check(
CURLcode
code
);
28
29
struct
pread_Callback_Data
30
{
31
char
*
const
buffer;
32
const
size_t
size;
33
size_t
offset;
34
35
size_t
copy(
char
*
contents
,
size_t
real_size
);
36
};
37
38
static
size_t
pread_callback
39
(
40
void
*
contents
,
41
size_t
size,
42
size_t
nmemb
,
43
void
*p
44
);
45
46
static
size_t
copy_callback
47
(
48
void
*
contents
,
49
size_t
size,
50
size_t
nmemb
,
51
void
*p
52
);
53
54
void
perform_range(
int64_t
start,
int64_t
size)
const
;
55
56
size_t
pread(
char
*buffer,
size_t
size,
int64_t
offset)
const override
;
57
void
copy_to(
Buffered_File
&
destination
,
int64_t
start,
int64_t
size)
override
;
58
59
public
:
60
CURL_File
(
const
char
*
url
,
bool
verbose
);
61
};
62
}
63
64
#endif
Buffered_File.h
joedb::Buffered_File
Definition
Buffered_File.h:18
joedb::Buffered_File::read
T read()
Definition
Buffered_File.h:156
joedb::CURL_Easy
Definition
CURL_File.h:12
joedb::CURL_Easy::CURL_Easy
CURL_Easy(const CURL_Easy &)=delete
joedb::CURL_Easy::CURL_Easy
CURL_Easy()
Definition
CURL_File.cpp:112
joedb::CURL_Easy::operator=
CURL_Easy & operator=(const CURL_Easy &)=delete
joedb::CURL_Easy::~CURL_Easy
~CURL_Easy()
Definition
CURL_File.cpp:120
joedb::CURL_Easy::curl
CURL *const curl
Definition
CURL_File.h:14
joedb::CURL_File
Definition
CURL_File.h:25
joedb
Definition
Blob.h:7
Generated by
1.9.8