Google

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

URLStream Class Reference

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

#include <url.h>

Inheritance diagram for URLStream:

TCPStream Socket streambuf iostream List of all members.

Public Methods

 URLStream ()
 Construct an instance of URL stream.

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.

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...


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...


Detailed Description

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

Author(s):
David Sugar <dyfet@ostel.com>


Constructor & Destructor Documentation

URLStream::URLStream ( )
 

Construct an instance of URL stream.


Member Function Documentation

void URLStream::Close ( )
 

Close the URL stream for a new connection.

urlerror_t 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 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 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 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.

urlmethod_t URLStream::getMethod ( void ) [inline]
 

Get url method (and protocol) employed.

Returns:
url method in effect.

URLStream & URLStream::getline ( char * buffer,
size_t len )
 

Line parsing with conversion.

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

void 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 URLStream::sendHTTPHeader ( const char * path,
const char ** vars,
int bufsize ) [protected]
 

void URLStream::setAgent ( const char * str ) [inline]
 

Set the agent.

Parameters:
agent   value.

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

Set authentication type for the url.

Parameters:
authentication.  

void URLStream::setCookie ( const char * str ) [inline]
 

Set the cookie to pass.

Parameters:
cookie   string.

void URLStream::setPassword ( const char * str ) [inline]
 

Set password for the url.

Parameters:
password.  

void URLStream::setPragma ( const char * str ) [inline]
 

Set the pragmas.

Parameters:
pragma   setting.

void URLStream::setProxy ( const char * host,
tpport_t port )
 

Set the proxy server used.

Parameters:
proxy   host.
proxy   port.

void URLStream::setReferer ( const char * str )
 

Set the referer url.

Parameters:
referer   string.

void 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.

void URLStream::setUser ( const char * str ) [inline]
 

Set user id for the url.

Parameters:
user   id.

int URLStream::underflow ( void ) [protected, virtual]
 

Reimplemented from TCPStream.


The documentation for this class was generated from the following file:
Generated at Fri Mar 23 10:47:57 2001 for CommonC++ by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000