Rudiments
url.h
1// Copyright (c) 1999-2018 David Muse
2// See the COPYING file for more information
3
4 url(url &u) {};
5 url &operator=(url &u) { return *this; };
6
7 bool getCurrentProperties();
8
9 char *getContents();
10 ssize_t getContents(byte_t *buffer,size_t buffersize);
11
12 static char *getContents(const char *name);
13 static ssize_t getContents(const char *name,
14 byte_t *buffer,
15 size_t buffersize);
16
17 void enableOpenTimings();
18 void disableOpenTimings();
19 void getOpenTimings(uint64_t *build,
20 uint64_t *connect,
21 uint64_t *send,
22 uint64_t *wait,
23 uint64_t *recv);
24
25 protected:
26 bool lowLevelOpen(const char *name, int32_t flags,
27 mode_t perms, bool useperms);
28 int32_t lowLevelClose();
29
30 ssize_t lowLevelRead(void *buffer, size_t size);
31 private:
32 void init();
33
34 bool httpOpen(const char *urlname, char *userpwd);
35 bool curlOpen(const char *urlname, char *userpwd);
36 bool getChunkSize(bool bof);
37
38 bool curlPerform();
39 static size_t curlReadData(void *buffer, size_t size,
40 size_t nmemb, void *userp);
41
42 static bool initUrl();
43 static void shutDownUrl();
44
45 uint64_t interval();
46
47 urlprivate *pvt;
Definition avltree.h:11
Definition url.h:35