zypp::media::CurlAuthData Class Reference

Curl HTTP authentication data. More...

#include <MediaUserAuth.h>

Inheritance diagram for zypp::media::CurlAuthData:
[legend]

List of all members.

Public Member Functions

 CurlAuthData ()
 Default constructor.
 CurlAuthData (const AuthData &authData)
 CurlAuthData (std::string &username, std::string &password, std::string &auth_type)
 CurlAuthData (std::string &username, std::string &password, long auth_type)
virtual bool valid () const
 Checks validity of authentication data.
void setAuthType (std::string auth_type)
 Set HTTP authentication type(s) to use.
void setAuthType (long auth_type)
long authType ()
const std::string authTypeAsString ()
const std::string getUserPwd () const
virtual std::ostream & dumpOn (std::ostream &str) const

Static Public Member Functions

static long auth_type_str2long (std::string &auth_type_str)
 Converts a string of comma separated list of authetication type names into a long of ORed CURLAUTH_* identifiers.
static std::string auth_type_long2str (long auth_type)
 Converts a long of ORed CURLAUTH_* identifiers into a string of comma separated list of authentication type names.

Private Attributes

std::string _auth_type_str
long _auth_type


Detailed Description

Curl HTTP authentication data.

Definition at line 76 of file MediaUserAuth.h.


Constructor & Destructor Documentation

zypp::media::CurlAuthData::CurlAuthData (  )  [inline]

Default constructor.

Initializes username and password to empty strings and authetication type to CURLAUTH_NONE.

Definition at line 82 of file MediaUserAuth.h.

zypp::media::CurlAuthData::CurlAuthData ( const AuthData authData  )  [inline]

Definition at line 85 of file MediaUserAuth.h.

zypp::media::CurlAuthData::CurlAuthData ( std::string &  username,
std::string &  password,
std::string &  auth_type 
) [inline]

Definition at line 91 of file MediaUserAuth.h.

References _auth_type, and auth_type_str2long().

zypp::media::CurlAuthData::CurlAuthData ( std::string &  username,
std::string &  password,
long  auth_type 
) [inline]

Definition at line 97 of file MediaUserAuth.h.

References _auth_type_str, and auth_type_long2str().


Member Function Documentation

bool zypp::media::CurlAuthData::valid (  )  const [virtual]

Checks validity of authentication data.

Returns:
true if the object contains non-empty username, non-empty password, and specifies authentication type; false otherwise.

Reimplemented from zypp::media::AuthData.

Definition at line 67 of file MediaUserAuth.cc.

References zypp::media::AuthData::password(), and zypp::media::AuthData::username().

void zypp::media::CurlAuthData::setAuthType ( std::string  auth_type  )  [inline]

Set HTTP authentication type(s) to use.

Parameters:
comma separated list of HTTP authentication type names

Definition at line 114 of file MediaUserAuth.h.

References _auth_type, _auth_type_str, and auth_type_str2long().

void zypp::media::CurlAuthData::setAuthType ( long  auth_type  )  [inline]

Definition at line 124 of file MediaUserAuth.h.

References _auth_type, _auth_type_str, and auth_type_long2str().

long zypp::media::CurlAuthData::authType (  )  [inline]

Definition at line 130 of file MediaUserAuth.h.

References _auth_type.

const std::string zypp::media::CurlAuthData::authTypeAsString (  )  [inline]

Definition at line 131 of file MediaUserAuth.h.

References _auth_type_str.

const std::string zypp::media::CurlAuthData::getUserPwd (  )  const [inline]

long zypp::media::CurlAuthData::auth_type_str2long ( std::string &  auth_type_str  )  [static]

Converts a string of comma separated list of authetication type names into a long of ORed CURLAUTH_* identifiers.

The method also automatically leaves out any auth types declared not supported by curl_version_info().

Exceptions:
MediaException if an invalid authentication type name is encountered.

Definition at line 80 of file MediaUserAuth.cc.

References _, zypp::str::split(), and ZYPP_THROW.

Referenced by CurlAuthData(), zypp::media::fillSettingsFromUrl(), setAuthType(), and zypp::media::MediaCurl::setupEasy().

std::string zypp::media::CurlAuthData::auth_type_long2str ( long  auth_type  )  [static]

Converts a long of ORed CURLAUTH_* identifiers into a string of comma separated list of authentication type names.

Definition at line 132 of file MediaUserAuth.cc.

References zypp::str::join().

Referenced by CurlAuthData(), zypp::media::MediaCurl::getAuthHint(), and setAuthType().

std::ostream & zypp::media::CurlAuthData::dumpOn ( std::ostream &  str  )  const [virtual]

Reimplemented from zypp::media::AuthData.

Definition at line 73 of file MediaUserAuth.cc.

References _auth_type, and _auth_type_str.

Referenced by zypp::media::operator<<().


Member Data Documentation

Definition at line 156 of file MediaUserAuth.h.

Referenced by authTypeAsString(), CurlAuthData(), dumpOn(), and setAuthType().

Definition at line 157 of file MediaUserAuth.h.

Referenced by authType(), CurlAuthData(), dumpOn(), and setAuthType().


The documentation for this class was generated from the following files:

doxygen