Rudiments
url.h
1 // Copyright (c) 2015 David Muse
2 // See the COPYING file for more information
3 
4  url(const url &u);
5  url &operator=(const url &u);
6 
7  char *getContents();
8  ssize_t getContents(unsigned char *buffer,size_t buffersize);
9 
10  static char *getContents(const char *name);
11  static ssize_t getContents(const char *name,
12  unsigned char *buffer,
13  size_t buffersize);
14 
15  protected:
16  bool lowLevelOpen(const char *name, int32_t flags,
17  mode_t perms, bool useperms);
18  int32_t lowLevelClose();
19 
20  ssize_t lowLevelRead(void *buffer, ssize_t size);
21  private:
22  void init();
23 
24  bool httpOpen(const char *urlname, const char *userpwd);
25  bool getChunkSize(bool bof);
26 
27  bool curlPerform();
28  static size_t curlReadData(void *buffer, size_t size,
29  size_t nmemb, void *userp);
30 
31  static bool initUrl();
32  static void shutDownUrl();
33 
34  urlprivate *pvt;
Definition: url.h:37