SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWHttpHeaderBase Class Referenceabstract

Abstract base class from which all HTTP header classes derive. More...

#include <rw/http/RWHttpHeaderBase.h>

Inheritance diagram for RWHttpHeaderBase:
RWHttpAuthorizationHeaderBase RWHttpContentLengthHeader RWHttpContentTypeHeader RWHttpDateHeader RWHttpEntityTagHeaderBase RWHttpGenericHeader RWHttpHostHeader RWHttpRangeHeader

Public Member Functions

virtual bool append (const RWCString &str)
 
virtual RWCString asString (void) const
 
RWCString getLabel (void) const
 
RWHttpHeaderType getType (void) const
 
virtual RWCString getValue (void) const =0
 
bool operator!= (const RWHttpHeaderBase &) const
 
bool operator< (const RWHttpHeaderBase &hdr) const
 
bool operator== (const RWHttpHeaderBase &h) const
 

Static Public Member Functions

static unsigned hash (const RWHttpHeaderBase &)
 

Protected Member Functions

 RWHttpHeaderBase (const RWCString &label, RWHttpHeaderType type=RW_HTTP_ENTITY_HEADER)
 
 RWHttpHeaderBase (void)
 

Detailed Description

RWHttpHeaderBase is an abstract base class for all concrete header classes. These classes are helpers that ease header attachment and formatting to various HTTP requests.

Constructor & Destructor Documentation

◆ RWHttpHeaderBase() [1/2]

RWHttpHeaderBase::RWHttpHeaderBase ( void )
inlineprotected

Constructs a default RWHttpHeaderBase as part of a specific HTTP header object. The label of the header is set to an empty string, and the header type is set to RW_HTTP_ENTITY_HEADER.

◆ RWHttpHeaderBase() [2/2]

RWHttpHeaderBase::RWHttpHeaderBase ( const RWCString & label,
RWHttpHeaderType type = RW_HTTP_ENTITY_HEADER )
inlineprotected

Constructs an RWHttpHeaderBase as part of a specific HTTP header object. The label of the header is set to label, and the header type is set to type. The RWCString should contain 7-bit US-ASCII data.

Member Function Documentation

◆ append()

virtual bool RWHttpHeaderBase::append ( const RWCString & str)
virtual

Attempts to append str to the header as a new set of values, if the header supports appending of headers. Append returns true if it is successful in appending the headers. Otherwise it returns false. This function also returns false if it is not overridden in a derived class. The RWCString should contain 7-bit US-ASCII data.

◆ asString()

virtual RWCString RWHttpHeaderBase::asString ( void ) const
virtual

Concatenates the label and the value of the header into the format label: value and returns the result as an RWCString. The RWCString should contain 7-bit US-ASCII data.

◆ getLabel()

RWCString RWHttpHeaderBase::getLabel ( void ) const
inline

Returns the internal label of the header. The RWCString should contain 7-bit US-ASCII data.

◆ getType()

RWHttpHeaderType RWHttpHeaderBase::getType ( void ) const
inline

Returns the internal type of the header.

◆ getValue()

RWCString RWHttpHeaderBase::getValue ( void ) const
inlinepure virtual

Returns the value associated with the label of the header. This is a pure virtual function, so it must be overridden by a derived class. The RWCString should contain 7-bit US-ASCII data.

Implemented in RWHttpBasicAuthorizationHeader, RWHttpContentLengthHeader, RWHttpContentTypeHeader, RWHttpDateHeader, RWHttpEntityTagHeaderBase, RWHttpGenericHeader, RWHttpHostHeader, and RWHttpRangeHeader.

◆ hash()

unsigned RWHttpHeaderBase::hash ( const RWHttpHeaderBase & h)
inlinestatic

Returns the hash value of h.

◆ operator!=()

bool RWHttpHeaderBase::operator!= ( const RWHttpHeaderBase & h) const
inline

Returns true if the RWHttpHeaderBases are not equivalent.

◆ operator<()

bool RWHttpHeaderBase::operator< ( const RWHttpHeaderBase & hdr) const

Returns true if hdr is less than self. Otherwise returns false.

◆ operator==()

bool RWHttpHeaderBase::operator== ( const RWHttpHeaderBase & h) const
inline

Returns true if h is equal to self.

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