home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wxos2233.zip / wxOS2-2_3_3.zip / wxWindows-2.3.3 / include / wx / protocol / http.h < prev    next >
C/C++ Source or Header  |  2002-01-07  |  2KB  |  62 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name:        http.h
  3. // Purpose:     HTTP protocol
  4. // Author:      Guilhem Lavaux
  5. // Modified by:
  6. // Created:     August 1997
  7. // RCS-ID:      $Id: http.h,v 1.6 2002/01/03 17:18:38 VZ Exp $
  8. // Copyright:   (c) 1997, 1998 Guilhem Lavaux
  9. // Licence:     wxWindows license
  10. /////////////////////////////////////////////////////////////////////////////
  11. #ifndef _WX_HTTP_H
  12. #define _WX_HTTP_H
  13.  
  14. #include "wx/defs.h"
  15.  
  16. #if wxUSE_PROTOCOL_HTTP
  17.  
  18. #include "wx/list.h"
  19. #include "wx/protocol/protocol.h"
  20.  
  21. class WXDLLEXPORT wxHTTP : public wxProtocol {
  22.   DECLARE_DYNAMIC_CLASS(wxHTTP)
  23.   DECLARE_PROTOCOL(wxHTTP)
  24. protected:
  25.   wxProtocolError m_perr;
  26.   wxList m_headers;
  27.   bool m_read, m_proxy_mode;
  28.   wxSockAddress *m_addr;
  29. public:
  30.   wxHTTP();
  31.   ~wxHTTP();
  32.  
  33.   bool Connect(const wxString& host);
  34.   bool Connect(wxSockAddress& addr, bool wait);
  35.   bool Abort();
  36.   wxInputStream *GetInputStream(const wxString& path);
  37.   inline wxProtocolError GetError() { return m_perr; }
  38.   wxString GetContentType();
  39.  
  40.   void SetHeader(const wxString& header, const wxString& h_data);
  41.   wxString GetHeader(const wxString& header);
  42.  
  43.   void SetProxyMode(bool on);
  44.  
  45. protected:
  46.   typedef enum {
  47.     wxHTTP_GET,
  48.     wxHTTP_HEAD
  49.   } wxHTTP_Req;
  50.   bool BuildRequest(const wxString& path, wxHTTP_Req req);
  51.   void SendHeaders();
  52.   bool ParseHeaders();
  53.  
  54.   // deletes the header value strings
  55.   void ClearHeaders();
  56. };
  57.  
  58. #endif // wxUSE_PROTOCOL_HTTP
  59.  
  60. #endif // _WX_HTTP_H
  61.  
  62.