]> git.mxchange.org Git - simgear.git/blob - simgear/io/HTTPClient.hxx
Make it compile with gcc-4.6
[simgear.git] / simgear / io / HTTPClient.hxx
1 #ifndef SG_HTTP_CLIENT_HXX
2 #define SG_HTTP_CLIENT_HXX
3
4 #include <map>
5
6 #include <simgear/io/HTTPRequest.hxx>
7
8 namespace simgear
9 {
10
11 namespace HTTP
12 {
13
14 class Connection;
15
16 class Client
17 {
18 public:
19     Client();
20     
21     void makeRequest(const Request_ptr& r);
22     
23     void setUserAgent(const std::string& ua);
24     void setProxy(const std::string& proxy, const std::string& auth = "");
25     
26     const std::string& userAgent() const
27         { return _userAgent; }
28         
29     const std::string& proxyHost() const
30         { return _proxy; }
31         
32     const std::string& proxyAuth() const
33         { return _proxyAuth; }
34 private:
35     void requestFinished(Connection* con);
36     
37     friend class Connection;
38     
39     std::string _userAgent;
40     std::string _proxy;
41     std::string _proxyAuth;
42     
43 // connections by host
44     std::map<std::string, Connection*> _connections;
45 };
46
47 } // of namespace HTTP
48
49 } // of namespace simgear
50
51 #endif // of SG_HTTP_CLIENT_HXX