Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

ost::URLStream Class Reference

A URL processing version of TCPStream. C++ url processing stream class. More...

#include <url.h>

Inheritance diagram for ost::URLStream::

ost::TCPStream ost::Socket std::streambuf std::iostream List of all members.

Public Methods

 URLStream ()
 Construct an instance of URL stream. More...

URLStream & getline (char *buffer, size_t len)
 Line parsing with conversion. More...

urlerror_t Get (const char *path, int buffer=512)
 Get URL data from a named stream of a known buffer size. More...

urlerror_t Submit (const char *path, const char **vars, int buffer=512)
 Submit URL with vars passed as argument array. More...

urlerror_t Post (const char *path, const char **vars, int buffer=512)
 Post URL vars with post method. More...

urlerror_t Head (const char *path, int buffer=512)
 Used to fetch header information for a resource. More...

void Close ()
 Close the URL stream for a new connection. More...

void setReferer (const char *str)
 Set the referer url. More...

void setCookie (const char *str)
 Set the cookie to pass. More...

void setUser (const char *str)
 Set user id for the url. More...

void setPassword (const char *str)
 Set password for the url. More...

void setAuthentication (urlauth_t a, const char *str=NULL)
 Set authentication type for the url. More...

void setPragma (const char *str)
 Set the pragmas. More...

void setProxy (const char *host, tpport_t port)
 Set the proxy server used. More...

void setAgent (const char *str)
 Set the agent. More...

urlmethod_t getMethod (void)
 Get url method (and protocol) employed. More...

void setTimeout (timeout_t to)
 Set socket timeout characteristics for processing URL requests. More...

void setFollow (bool enable)
 Specify url following. More...

void setProtocol (urlprotocol_t pro)
 Specify http protocol level being used. More...


Protected Methods

urlerror_t sendHTTPHeader (const char *path, const char **vars, int bufsize)
int underflow (void)
virtual void httpHeader (const char *header, const char *value)
 Derived method to receive and parse http "headers". More...

virtual char ** extraHeader (void)
 A virtual to insert additional header info into the request. More...


Detailed Description

A URL processing version of TCPStream. C++ url processing stream class.

Author:
David Sugar <dyfet@ostel.com>


Constructor & Destructor Documentation

ost::URLStream::URLStream  
 

Construct an instance of URL stream.


Member Function Documentation

void ost::URLStream::Close void  
 

Close the URL stream for a new connection.

urlerror_t ost::URLStream::Get const char *   path,
int   buffer = 512
 

Get URL data from a named stream of a known buffer size.

Returns:
url error code.
Parameters:
name   of resource.
size   of buffer.

urlerror_t ost::URLStream::Head const char *   path,
int   buffer = 512
 

Used to fetch header information for a resource.

Returns:
url error code.
Parameters:
anme   of resource.
size   of buffer.

urlerror_t ost::URLStream::Post const char *   path,
const char **   vars,
int   buffer = 512
 

Post URL vars with post method.

Returns:
url error code.
Parameters:
name   of resource.
vars   to set.
size   of buffer.

urlerror_t ost::URLStream::Submit const char *   path,
const char **   vars,
int   buffer = 512
 

Submit URL with vars passed as argument array.

This submit assumes "GET" method. Use "Post" member to perform post.

Returns:
url error code.
Parameters:
name   of resource.
vars   to set.
size   of buffer.

virtual char** ost::URLStream::extraHeader void   [inline, protected, virtual]
 

A virtual to insert additional header info into the request.

Returns:
array of header attributes to add.

urlmethod_t ost::URLStream::getMethod void   [inline]
 

Get url method (and protocol) employed.

Returns:
url method in effect.

URLStream& ost::URLStream::getline char *   buffer,
size_t   len
 

Line parsing with conversion.

Returns:
URLStream object.
Parameters:
buffer   to store.
maximum   buffer size.

virtual void ost::URLStream::httpHeader const char *   header,
const char *   value
[inline, protected, virtual]
 

Derived method to receive and parse http "headers".

Parameters:
header   keyword.
header   keyword value.

urlerror_t ost::URLStream::sendHTTPHeader const char *   path,
const char **   vars,
int   bufsize
[protected]
 

void ost::URLStream::setAgent const char *   str [inline]
 

Set the agent.

Parameters:
agent   value.

void ost::URLStream::setAuthentication urlauth_t   a,
const char *   str = NULL
 

Set authentication type for the url.

Parameters:
authentication.  

void ost::URLStream::setCookie const char *   str [inline]
 

Set the cookie to pass.

Parameters:
cookie   string.

void ost::URLStream::setFollow bool   enable [inline]
 

Specify url following.

Set to false to disable following of relocation requests.

Parameters:
true   to enable following.

void ost::URLStream::setPassword const char *   str [inline]
 

Set password for the url.

Parameters:
password.  

void ost::URLStream::setPragma const char *   str [inline]
 

Set the pragmas.

Parameters:
pragma   setting.

void ost::URLStream::setProtocol urlprotocol_t   pro [inline]
 

Specify http protocol level being used.

Parameters:
protocol   level.

void ost::URLStream::setProxy const char *   host,
tpport_t   port
 

Set the proxy server used.

Parameters:
proxy   host.
proxy   port.

void ost::URLStream::setReferer const char *   str
 

Set the referer url.

Parameters:
referer   string.

void ost::URLStream::setTimeout timeout_t   to [inline]
 

Set socket timeout characteristics for processing URL requests.

Set to 0 for no default timeouts.

Parameters:
timeout   to set.

Reimplemented from ost::TCPStream.

void ost::URLStream::setUser const char *   str [inline]
 

Set user id for the url.

Parameters:
user   id.

int ost::URLStream::underflow void   [protected, virtual]
 

Reimplemented from ost::TCPStream.


The documentation for this class was generated from the following file:
Generated at Fri Jan 4 18:51:52 2002 for CommonC++ by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001