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 (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 63 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 69 of file MediaUserAuth.h.

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

Definition at line 72 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 78 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 41 of file MediaUserAuth.cc.

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

Referenced by zypp::media::MediaCurl::getDoesFileExist(), and zypp::media::MediaCurl::getFileCopy().

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 95 of file MediaUserAuth.h.

References _auth_type, _auth_type_str, and auth_type_str2long().

Referenced by zypp::media::MediaCurl::getDoesFileExist(), and zypp::media::MediaCurl::getFileCopy().

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

Definition at line 105 of file MediaUserAuth.h.

References _auth_type, _auth_type_str, and auth_type_long2str().

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

Definition at line 111 of file MediaUserAuth.h.

References _auth_type.

Referenced by zypp::media::MediaCurl::getDoesFileExist(), and zypp::media::MediaCurl::getFileCopy().

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

Definition at line 112 of file MediaUserAuth.h.

References _auth_type_str.

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

Definition at line 114 of file MediaUserAuth.h.

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

Referenced by zypp::media::MediaCurl::getDoesFileExist(), and zypp::media::MediaCurl::getFileCopy().

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 54 of file MediaUserAuth.cc.

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

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

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 106 of file MediaUserAuth.cc.

References zypp::url::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 47 of file MediaUserAuth.cc.

References _auth_type, _auth_type_str, and zypp::media::AuthData::dumpOn().

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


Member Data Documentation

std::string zypp::media::CurlAuthData::_auth_type_str [private]

Definition at line 137 of file MediaUserAuth.h.

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

long zypp::media::CurlAuthData::_auth_type [private]

Definition at line 138 of file MediaUserAuth.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Sep 25 19:23:21 2007 for libzypp by  doxygen 1.5.3