From 22277c6ffe91189cbb5d7a7d8572bf829e3a2610 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 24 Feb 2009 01:31:48 +0000 Subject: Just committing some in-progress code. It may report some warnings, but it doesn't inhibit building. These'll be in good working shape in no time. --- src/httpget.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/httpget.h (limited to 'src/httpget.h') diff --git a/src/httpget.h b/src/httpget.h new file mode 100644 index 0000000..25f5ab1 --- /dev/null +++ b/src/httpget.h @@ -0,0 +1,54 @@ +#ifndef BU_HTTP_GET_H +#define BU_HTTP_GET_H + +#include "bu/stream.h" +#include "bu/fstring.h" +#include "bu/url.h" +#include "bu/socket.h" + +namespace Bu +{ + class HttpGet : public Bu::Stream + { + public: + HttpGet( const Bu::Url &uSrc, const Bu::FString &sMethod="GET" ); + virtual ~HttpGet(); + + void get(); + + // From Bu::Stream + virtual void close(); + virtual size_t read( void *pBuf, size_t nBytes ); + virtual size_t write( const void *pBuf, size_t nBytes ); + using Stream::write; + + virtual long tell(); + virtual void seek( long offset ); + virtual void setPos( long pos ); + virtual void setPosEnd( long pos ); + virtual bool isEOS(); + virtual bool isOpen(); + + virtual void flush(); + + virtual bool canRead(); + virtual bool canWrite(); + + virtual bool isReadable(); + virtual bool isWritable(); + virtual bool isSeekable(); + + virtual bool isBlocking(); + virtual void setBlocking( bool bBlocking=true ); + + private: + Bu::Url uSrc; + Bu::FString sMethod; + Bu::Socket sSrv; + typedef Bu::Hash MimeHash; + MimeHash hMimeIn; + MimeHash hMimeOut; + }; +}; + +#endif -- cgit v1.2.3