Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

wvhttp.h

Go to the documentation of this file.
00001 /* -*- Mode: C++ -*-
00002  * Worldvisions Weaver Software:
00003  *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
00004  *
00005  */ 
00006 #ifndef __WVHTTP_H
00007 #define __WVHTTP_H
00008 
00009 #include "wvurl.h"
00010 #include "wvtcp.h"
00011 #include "wvstreamclone.h"
00012 #include "wvresolver.h"
00013 #include "wvhashtable.h"
00014 
00015 
00016 struct WvHTTPHeader
00017 {
00018     WvString name, value;
00019     
00020     WvHTTPHeader(WvStringParm _name, WvStringParm _value)
00021         : name(_name), value(_value) 
00022                 {}
00023 };
00024 
00025 
00026 DeclareWvDict(WvHTTPHeader, WvString, name);
00027 
00028 /** 
00029  * WvHTTPStream connects to an HTTP server and allows the requested file
00030  * to be retrieved using the usual WvStream-style calls.
00031  */
00032 class WvHTTPStream : public WvStreamClone
00033 {
00034 public:
00035     enum State {Resolving = 0, Connecting, ReadHeader1, ReadHeader, ReadData,
00036                 Done};
00037     WvHTTPHeaderDict headers;
00038     WvHTTPHeaderDict client_headers;
00039     size_t num_received;
00040     WvTCPConn *tcp;
00041 
00042     /**
00043      * Changed: now we copy _url in the constructor, so you can (and must)
00044      * delete it whenever you want.
00045      */
00046     WvHTTPStream(const WvURL &_url);
00047 
00048     virtual bool isok() const;
00049     virtual int geterr() const;
00050     virtual WvString errstr() const;
00051     virtual bool pre_select(SelectInfo &si);
00052     virtual size_t uread(void *buf, size_t count);
00053 
00054 public:
00055     WvURL url;
00056     State state;
00057 };
00058 
00059 #endif // __WVHTTP_H

Generated on Sat Feb 21 21:05:28 2004 for WvStreams by doxygen 1.3.5