SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions
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 () 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 (void)
 
 RWHttpHeaderBase (const RWCString &label, RWHttpHeaderType type=RW_HTTP_ENTITY_HEADER)
 

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

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.

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.

RWCString RWHttpHeaderBase::getLabel ( void  ) const
inline

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

RWHttpHeaderType RWHttpHeaderBase::getType ( void  ) const
inline

Returns the internal type of the header.

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, RWHttpDateHeader, RWHttpContentTypeHeader, RWHttpContentLengthHeader, RWHttpHostHeader, RWHttpRangeHeader, RWHttpGenericHeader, and RWHttpEntityTagHeaderBase.

unsigned RWHttpHeaderBase::hash ( const RWHttpHeaderBase h)
inlinestatic

Returns the hash value of h.

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

Returns true if the RWHttpHeaderBases are not equivalent.

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

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

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

Returns true if h is equal to self.

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