rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWHttpBasicAuthorizationHeader Class Reference
[HTTP]

Helper class that defines an Authorization header for Basic Access Authentication. More...

#include <rw/http/RWHttpBasicAuthorizationHeader.h>

Inheritance diagram for RWHttpBasicAuthorizationHeader:
RWHttpAuthorizationHeaderBase RWHttpHeaderBase

List of all members.

Public Member Functions

 RWHttpBasicAuthorizationHeader ()
 RWHttpBasicAuthorizationHeader (const RWCString &username, const RWCString &password, bool padding=false)
 RWHttpBasicAuthorizationHeader (const RWHttpGenericHeader &hdr)
void setUsername (const RWCString &username)
void setPassword (const RWCString &password)
RWCString getUsername () const
RWCString getPassword () const
virtual RWCString getValue () const

Static Protected Member Functions

static RWCString encodeString (const RWCString &str, bool padding)
static RWCString decodeString (const RWCString &str)

Detailed Description

RWHttpBasicAuthorizationHeader is a specialization class of RWHttpAuthorizationHeaderBase. It is a helper class that formats and encodes its contents as Authorization: basic header_value, where header_value is the username and password used for basic authentication.


Constructor & Destructor Documentation

RWHttpBasicAuthorizationHeader::RWHttpBasicAuthorizationHeader (  )  [inline]

Constructs a default RWHttpBasicAuthorizationHeader object with the label Authorization and the username and password set to empty strings.

RWHttpBasicAuthorizationHeader::RWHttpBasicAuthorizationHeader ( const RWCString username,
const RWCString password,
bool  padding = false 
) [inline]

Constructs a RWHttpBasicAuthorizationHeader object with the label Authorization, a username of username, and a password of password.

RWHttpBasicAuthorizationHeader::RWHttpBasicAuthorizationHeader ( const RWHttpGenericHeader hdr  ) 

Constructs an RWHttpBasicAuthorizationHeader object from an RWHttpGenericHeader representing a basic Authorization HTTP header. If the RWHttpGenericHeader does not represent a basic Authorization HTTP header or if the value of the RWHttpGenericHeader does not conform to the formatting of a basic Authorization value, an RWHttpHeaderParseError exception is thrown.


Member Function Documentation

static RWCString RWHttpBasicAuthorizationHeader::decodeString ( const RWCString str  )  [static, protected]

Returns a RWCString representing the plain text version of the base64 encoded string str. The RWCString should contain 7-bit US-ASCII data.

static RWCString RWHttpBasicAuthorizationHeader::encodeString ( const RWCString str,
bool  padding 
) [static, protected]

Returns a RWCString representing the base64 encoded version of str. The RWCString should contain 7-bit US-ASCII data.

RWCString RWHttpBasicAuthorizationHeader::getPassword ( void   )  const [inline]

Returns the internal value of password as a RWCString.

RWCString RWHttpBasicAuthorizationHeader::getUsername ( void   )  const [inline]

Returns the internal value of username as a RWCString.

virtual RWCString RWHttpBasicAuthorizationHeader::getValue (  )  const [virtual]

Returns a RWCString consisting of the word Basic followed by a base64 encoded string representing username:password.

Implements RWHttpHeaderBase.

void RWHttpBasicAuthorizationHeader::setPassword ( const RWCString password  )  [inline]

Assigns password to the internal password.

void RWHttpBasicAuthorizationHeader::setUsername ( const RWCString username  )  [inline]

Assigns username to the internal username.

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.