source: subversion/applications/lib/libosm/Client.h @ 11682

Last change on this file since 11682 was 11682, checked in by nienhueser, 11 years ago

No 'using xy' declarations in headers
Reorder includes with local files on top, and methods by decreasing publicity

File size: 746 bytes
Line 
1#include <string>
2#include <curl/curl.h>
3
4namespace OSM
5{
6
7typedef struct
8{
9        char *data;
10        int nbytes;
11} Data;
12
13class Client
14{
15public:
16        Client(const std::string& urlbase);
17        void setLoginDetails(const std::string& u, const std::string& p);
18        std::string grabOSM(const char *apicall, double west, double south,
19                        double east, double north);
20        std::string grabOSM(const char *apicall);
21        std::string putToOSM(char* apicall, char* idata);
22
23private:
24        std::string urlbase, username, password;
25
26        std::string grab(const char *url);
27        std::string doGrab(CURL *curl, const char *url);
28        static size_t responseCallback(void *ptr, size_t size, size_t nmemb,
29                        void *d);
30        static size_t putCallback(void *bufptr, size_t size, size_t nitems,
31                        void *userp);
32};
33
34}
Note: See TracBrowser for help on using the repository browser.