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  bool getCurrentProperties();
8 
9  off64_t getCurrentPosition() const;
10  off64_t setPositionRelativeToBeginning(off64_t offset) const;
11  off64_t setPositionRelativeToCurrent(off64_t offset) const;
12  off64_t setPositionRelativeToEnd(off64_t offset) const;
13 
14  char *getContents();
15  ssize_t getContents(unsigned char *buffer,size_t buffersize);
16 
17  static char *getContents(const char *name);
18  static ssize_t getContents(const char *name,
19  unsigned char *buffer,
20  size_t buffersize);
21 
22  protected:
23  bool lowLevelOpen(const char *name, int32_t flags,
24  mode_t perms, bool useperms);
25  int32_t lowLevelClose();
26 
27  ssize_t lowLevelRead(void *buffer, ssize_t size);
28  private:
29  void init();
30 
31  bool httpOpen(const char *urlname, const char *userpwd);
32  bool getChunkSize(bool bof);
33 
34  bool curlPerform();
35  static size_t curlReadData(void *buffer, size_t size,
36  size_t nmemb, void *userp);
37 
38  static bool initUrl();
39  static void shutDownUrl();
40 
41  urlprivate *pvt;
Definition: url.h:37