SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWHttpHostHeader Class Reference

Helper class that defines an HTTP Host header. More...

#include <rw/http/RWHttpHostHeader.h>

Inheritance diagram for RWHttpHostHeader:
RWHttpHeaderBase

Public Member Functions

 RWHttpHostHeader ()
 
 RWHttpHostHeader (const RWCString &host, int port=80)
 
 RWHttpHostHeader (const RWHttpGenericHeader &hdr)
 
RWCString getHost () const
 
int getPort () const
 
virtual RWCString getValue () const
 
void setHost (const RWCString &host)
 
void setPort (int port)
 
- Public Member Functions inherited from RWHttpHeaderBase
virtual bool append (const RWCString &str)
 
virtual RWCString asString (void) const
 
RWCString getLabel (void) const
 
RWHttpHeaderType getType (void) const
 
bool operator!= (const RWHttpHeaderBase &) const
 
bool operator< (const RWHttpHeaderBase &hdr) const
 
bool operator== (const RWHttpHeaderBase &h) const
 

Additional Inherited Members

- Static Public Member Functions inherited from RWHttpHeaderBase
static unsigned hash (const RWHttpHeaderBase &)
 
- Protected Member Functions inherited from RWHttpHeaderBase
 RWHttpHeaderBase (const RWCString &label, RWHttpHeaderType type=RW_HTTP_ENTITY_HEADER)
 
 RWHttpHeaderBase (void)
 

Detailed Description

RWHttpHostHeader is a specialization class of RWHttpHeaderBase that defines the HTTP Host header. It is a helper class that formats its contents as Host: uri, where uri is the host machine to contact.

Constructor & Destructor Documentation

◆ RWHttpHostHeader() [1/3]

RWHttpHostHeader::RWHttpHostHeader ( )
inline

Constructs a default RWHttpHostHeader object with the header label set to Host and its associated value set to an empty string.

◆ RWHttpHostHeader() [2/3]

RWHttpHostHeader::RWHttpHostHeader ( const RWCString & host,
int port = 80 )
inline

Constructs an RWHttpHostHeader object with the header label set to Host and its associated host set to host, and its associated port set to port. The RWCString should contain 7-bit US-ASCII data.

◆ RWHttpHostHeader() [3/3]

RWHttpHostHeader::RWHttpHostHeader ( const RWHttpGenericHeader & hdr)

Constructs an RWHttpHostHeader from an RWHttpGenericHeader object. If the constructor is not able to parse a complete RWHttpHostHeader from the RWHttpGenericHeader, an RWHttpHeaderParseError exception is thrown.

Member Function Documentation

◆ getHost()

RWCString RWHttpHostHeader::getHost ( ) const
inline

Returns a copy of the internal host value. The RWCString should contain 7-bit US-ASCII data.

◆ getPort()

int RWHttpHostHeader::getPort ( ) const
inline

Returns a copy of the internal port value.

◆ getValue()

virtual RWCString RWHttpHostHeader::getValue ( ) const
virtual

Returns host:port as an RWCString. The RWCString should contain 7-bit US-ASCII data.

Implements RWHttpHeaderBase.

◆ setHost()

void RWHttpHostHeader::setHost ( const RWCString & host)
inline

Assigns host to the internal host value. The RWCString should contain 7-bit US-ASCII data.

◆ setPort()

void RWHttpHostHeader::setPort ( int port)
inline

Assigns port to the internal port value.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.