Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

CascadeHTTPStream Class Reference

imepments http based streams More...

#include <cascade/util/CascadeHTTPStream.h>

Inheritance diagram for CascadeHTTPStream:

CascadeStream CascadeObject List of all members.

Public Member Functions

 CascadeHTTPStream ()
 CascadeHTTPStream (const char *pURL)
virtual ~CascadeHTTPStream ()
virtual bool Open (const char *pURL)
virtual bool Close ()
void SetConnectTimeout (u32 inMicroseconds)
void SetSendTimeout (u32 inMicroseconds)
void SetReceiveTimeout (u32 inMicroseconds)
void SetUserAgent (const CascadeString &inUserAgentString)
bool GetResponseHeaderValue (const char *pResponseHeaderKey, CascadeString &value) const
virtual u64 GetSize ()
virtual u64 GetPosition ()
virtual bool SeekToPosition (u64 nPosition)
virtual u32 ReadBytes (u32 nBytes, void *pBuff)
virtual bool ForceSeekToPosition (u64 nPosition)

Protected Member Functions

virtual void AddHeaders (CascadeHTTPClient *inClient)
virtual void OnHTTPConnectionEstablished (CascadeHTTPClient *inClient)

Detailed Description

imepments http based streams

Skip the description

CascadeHTTPStream allows streams to be read from http. The main purpose of CascadeHTTPStream is allow you to use http when a CascadeStream object is required.


class CascadeHTTPStream


Constructor & Destructor Documentation

CascadeHTTPStream::CascadeHTTPStream  ) 
 

default constructor

This constructor is light weight.

CascadeHTTPStream::CascadeHTTPStream const char *  pURL  ) 
 

parameterized constructor

This constructor creates an http connection and attaches it to the stream when constructed.

Parameters:
pURL is a string containing any URL supported by CascadeHTTPClient

virtual CascadeHTTPStream::~CascadeHTTPStream  )  [virtual]
 

the destructor

This destructor is light weight.


Member Function Documentation

virtual void CascadeHTTPStream::AddHeaders CascadeHTTPClient inClient  )  [inline, protected, virtual]
 

virtual bool CascadeHTTPStream::Close  )  [virtual]
 

closes the http connection if open

Returns:
whether or not the close was successful.

virtual bool CascadeHTTPStream::ForceSeekToPosition u64  nPosition  )  [virtual]
 

virtual u64 CascadeHTTPStream::GetPosition  )  [virtual]
 

returns the current position in the stream

Returns the current position in the stream.

Returns:
the current position in the stream

Implements CascadeStream.

bool CascadeHTTPStream::GetResponseHeaderValue const char *  pResponseHeaderKey,
CascadeString value
const
 

gets the value of the supplied response header

Sets the string value to the contents of the response header named in pResponseHeaderKey. The stream must have been opened successfully.

Parameters:
pResponseHeaderKey the name of the desired header
value the string to fill with the value of the header
Returns:
true if the header was found and the value string updated false otherwise

virtual u64 CascadeHTTPStream::GetSize  )  [virtual]
 

returns the size of the stream

Returns number of total bytes in the stream. The size doesn't change as bytes are read or the position is seeked to.

Returns:
the size of the data stream in bytes

Implements CascadeStream.

virtual void CascadeHTTPStream::OnHTTPConnectionEstablished CascadeHTTPClient inClient  )  [inline, protected, virtual]
 

virtual bool CascadeHTTPStream::Open const char *  pURL  )  [virtual]
 

creates an http connection and attaches it to the stream

Parameters:
pURL is a string containing any URL supported by CascadeHTTPClient
Returns:
whether or not the attachment was successful.

virtual u32 CascadeHTTPStream::ReadBytes u32  nBytes,
void *  pBuff
[virtual]
 

reads bytes from the stream

Reads bytes from the stream.

Returns:
the number of bytes actually read from the stream

Implements CascadeStream.

virtual bool CascadeHTTPStream::SeekToPosition u64  nPosition  )  [virtual]
 

seeks to a position in the stream

SeekToPositions seeks to a byte position in the stream.

Returns:
whether or not the seek succeeded

Implements CascadeStream.

void CascadeHTTPStream::SetConnectTimeout u32  inMicroseconds  ) 
 

sets the connect timeout for this stream

Sets the connect timeout for this stream. By default, the timeout is zero, meaning that network accesses are blocking calls.

Parameters:
inMicroseconds The timeout value, in microseconds. Pass 0 for blocking call.

void CascadeHTTPStream::SetReceiveTimeout u32  inMicroseconds  ) 
 

sets the receive timeout for this stream

Sets the receive timeout for this stream. By default, the timeout is zero, meaning that network accesses are blocking calls.

Parameters:
inMicroseconds The timeout value, in microseconds. Pass 0 for blocking call.

void CascadeHTTPStream::SetSendTimeout u32  inMicroseconds  ) 
 

sets the send timeout for this stream

Sets the send timeout for this stream. By default, the timeout is zero, meaning that network accesses are blocking calls.

Parameters:
inMicroseconds The timeout value, in microseconds. Pass 0 for blocking call.

void CascadeHTTPStream::SetUserAgent const CascadeString inUserAgentString  ) 
 

sets the user agent string for this stream

Sets the user agent string for this stream.

Parameters:
inUserAgentString The user agent string.


The documentation for this class was generated from the following file:
Generated on Sun Jul 24 14:27:19 2005 for Cascade Library by  doxygen 1.4.1