gdSnarfHttp.h

Go to the documentation of this file.
00001 // gdSnarfHttp.cpp -- Version 0.2
00002 
00003 #ifndef X_GDSNARFHTTP_H
00004 #define X_GDSNARFHTTP_H
00005 
00006 #include "gdSnarfCommon.h"
00007 #include "gBHttp.h"
00008 ////////////////////////////////////////////////////////////
00009 class gdHttpURI : public gURI {
00010 public:
00011     gdHttpURI (gURI& aURI, gString& sInProxy, t_gPort myPort=80) ;
00012     gdHttpURI (gURI& aURI) ;
00013     virtual ~gdHttpURI () ;
00014 
00015     virtual bool IsOk () ;
00016 
00017     virtual gString& ConnectHost () {
00018         return sConnectHost;
00019     }
00020 
00021     virtual char* ConnectHostStr () {
00022         return sConnectHost.Str();
00023     }
00024 
00025     virtual gString& ContentHost () {
00026         return sContentHost;
00027     }
00028 
00029     virtual char* ContentHostStr () {
00030         return sContentHost.Str();
00031     }
00032 
00033     virtual gString& Path () {
00034         return sPath;
00035     }
00036 
00037     virtual char* PathStr () {
00038         return sPath.Str();
00039     }
00040 
00041     virtual t_gPort Port () {
00042         return uPort;
00043     }
00044 
00045     // Special methods
00046     virtual char* ParseProxyStr (gString& sInProxy, bool& isProxyOk, sOptProxy& resultProxy) ;
00047 
00048 protected:
00049     gString sConnectHost;
00050     gString sContentHost;
00051     gString sPath;
00052     sOptProxy proxy;
00053     t_gPort uPort;
00054 
00055     int thisProcessHttpURI (gURI& aURI, gString& sInProxy, t_gPort& myPort) ;
00056 
00057 private:
00058     bool isHttpOk;
00059 
00060     // Operators,empty
00061     gdHttpURI (gdHttpURI& ) ; //empty
00062     gdHttpURI& operator= (gdHttpURI& ) ; //empty
00063 };
00064 ////////////////////////////////////////////////////////////
00065 class gdHttpSnarf : public gXHttpCont {
00066 public:
00067     gdHttpSnarf (gTcpConnect& connection) ;
00068     virtual ~gdHttpSnarf () ;
00069 
00070     // Get methods
00071     virtual gString& GetReply () ;
00072 
00073     virtual gBigBuffer::eBufferKind BufferKind () {
00074         return GetBuffer().GetBufferKind();
00075     }
00076 
00077     virtual t_uchar* UBuffer () {
00078         return GetBaseBuffer().uBuf;
00079     }
00080 
00081     virtual int HttpCode () ;
00082 
00083     virtual char* HttpCodeStr () {
00084         return replyHeader.kindsL.Str(1);
00085     }
00086 
00087     virtual unsigned GetHeaderLines (char* sKind, gList& resultL) ;
00088 
00089     // Special methods
00090     virtual bool SnarfContent (gString& sHost, gString& sPath) ;
00091 
00092     virtual int FileInOut (gFileTemp& fT, FILE* fOut) ;
00093 
00094     // Show methods
00095     virtual int DoPrint (FILE* fOut) ;
00096 
00097 protected:
00098     t_uint64 usedSize;
00099     gString sReply;
00100 
00101 private:
00102     // Operators,empty
00103     gdHttpSnarf (gdHttpSnarf& ) ; //empty
00104     gdHttpSnarf& operator= (gdHttpSnarf& ) ; //empty
00105 };
00106 ////////////////////////////////////////////////////////////
00107 #endif //X_GDSNARFHTTP_H
00108 

Generated on Sat Aug 18 02:40:52 2007 for xpfweb_v2x lib by  doxygen 1.4.2