xrootd
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
XrdCl::URL Class Reference

URL representation. More...

#include <XrdClURL.hh>

Public Types

typedef std::map< std::string, std::string > ParamsMap
 

Public Member Functions

 URL ()
 Default constructor.
 
 URL (const std::string &url)
 
 URL (const char *url)
 
bool IsValid () const
 Is the url valid.
 
bool IsMetalink () const
 Is it a URL to a metalink.
 
bool IsLocalFile () const
 
bool IsSecure () const
 Does the protocol indicate encryption.
 
bool IsTPC () const
 Is the URL used in TPC context.
 
std::string GetURL () const
 Get the URL.
 
std::string GetHostId () const
 Get the host part of the URL (user:password@host:port)
 
std::string GetChannelId () const
 
std::string GetLocation () const
 Get location (protocol://host:port/path)
 
const std::string & GetProtocol () const
 Get the protocol.
 
void SetProtocol (const std::string &protocol)
 Set protocol.
 
const std::string & GetUserName () const
 Get the username.
 
void SetUserName (const std::string &userName)
 Set the username.
 
const std::string & GetPassword () const
 Get the password.
 
void SetPassword (const std::string &password)
 Set the password.
 
const std::string & GetHostName () const
 Get the name of the target host.
 
void SetHostName (const std::string &hostName)
 Set the host name.
 
int GetPort () const
 Get the target port.
 
void SetPort (int port)
 
void SetHostPort (const std::string &hostName, int port)
 
const std::string & GetPath () const
 Get the path.
 
void SetPath (const std::string &path)
 Set the path.
 
std::string GetPathWithParams () const
 Get the path with params.
 
std::string GetPathWithFilteredParams () const
 Get the path with params, filteres out 'xrdcl.'.
 
const ParamsMapGetParams () const
 Get the URL params.
 
std::string GetParamsAsString () const
 Get the URL params as string.
 
std::string GetLoginToken () const
 Get the login token if present in the opaque info.
 
std::string GetParamsAsString (bool filter) const
 
void SetParams (const std::string &params)
 Set params.
 
void SetParams (const ParamsMap &params)
 Set params.
 
bool FromString (const std::string &url)
 Parse a string and fill the URL fields.
 
void Clear ()
 Clear the url.
 

Private Member Functions

bool ParseHostInfo (const std::string hhostInfo)
 
bool ParsePath (const std::string &path)
 
void ComputeHostId ()
 
void ComputeURL ()
 
bool PathEndsWith (const std::string &sufix) const
 

Private Attributes

std::string pHostId
 
std::string pProtocol
 
std::string pUserName
 
std::string pPassword
 
std::string pHostName
 
int pPort
 
std::string pPath
 
ParamsMap pParams
 
std::string pURL
 

Detailed Description

URL representation.

Member Typedef Documentation

◆ ParamsMap

typedef std::map<std::string, std::string> XrdCl::URL::ParamsMap

Map of get params

Constructor & Destructor Documentation

◆ URL() [1/3]

XrdCl::URL::URL ( )

Default constructor.

◆ URL() [2/3]

XrdCl::URL::URL ( const std::string &  url)

Constructor

Parameters
urlan url in format: protocol://user:password@host:port/path?param1=x&param2=y

◆ URL() [3/3]

XrdCl::URL::URL ( const char *  url)

Constructor

Parameters
urlan url in format: protocol://user:password@host:port/path?param1=x&param2=y

Member Function Documentation

◆ Clear()

void XrdCl::URL::Clear ( )

Clear the url.

◆ ComputeHostId()

void XrdCl::URL::ComputeHostId ( )
private

◆ ComputeURL()

void XrdCl::URL::ComputeURL ( )
private

◆ FromString()

bool XrdCl::URL::FromString ( const std::string &  url)

Parse a string and fill the URL fields.

◆ GetChannelId()

std::string XrdCl::URL::GetChannelId ( ) const

Get the host part of the URL (user:password@host:port) plus channel specific CGI (xrdcl.identity & xrd.gsiusrpxy)

◆ GetHostId()

std::string XrdCl::URL::GetHostId ( ) const
inline

◆ GetHostName()

const std::string & XrdCl::URL::GetHostName ( ) const
inline

Get the name of the target host.

References pHostName.

◆ GetLocation()

std::string XrdCl::URL::GetLocation ( ) const

Get location (protocol://host:port/path)

Referenced by XrdCl::RedirectEntry::ToString().

◆ GetLoginToken()

std::string XrdCl::URL::GetLoginToken ( ) const

Get the login token if present in the opaque info.

◆ GetParams()

const ParamsMap & XrdCl::URL::GetParams ( ) const
inline

Get the URL params.

References pParams.

Referenced by XrdCl::CopyProcess::MarkTPC().

◆ GetParamsAsString() [1/2]

std::string XrdCl::URL::GetParamsAsString ( ) const

Get the URL params as string.

◆ GetParamsAsString() [2/2]

std::string XrdCl::URL::GetParamsAsString ( bool  filter) const

Get the URL params as string

Parameters
filter: if set to true filters out 'xrdcl.'

◆ GetPassword()

const std::string & XrdCl::URL::GetPassword ( ) const
inline

Get the password.

References pPassword.

◆ GetPath()

const std::string & XrdCl::URL::GetPath ( ) const
inline

◆ GetPathWithFilteredParams()

std::string XrdCl::URL::GetPathWithFilteredParams ( ) const

Get the path with params, filteres out 'xrdcl.'.

◆ GetPathWithParams()

std::string XrdCl::URL::GetPathWithParams ( ) const

Get the path with params.

◆ GetPort()

int XrdCl::URL::GetPort ( ) const
inline

Get the target port.

References pPort.

◆ GetProtocol()

const std::string & XrdCl::URL::GetProtocol ( ) const
inline

Get the protocol.

References pProtocol.

◆ GetURL()

std::string XrdCl::URL::GetURL ( ) const
inline

Get the URL.

References pURL.

Referenced by XrdCl::CopyProcess::MarkTPC(), and XrdCl::PropertyList::Set().

◆ GetUserName()

const std::string & XrdCl::URL::GetUserName ( ) const
inline

Get the username.

References pUserName.

◆ IsLocalFile()

bool XrdCl::URL::IsLocalFile ( ) const

Is it a URL to a local file (file://localhost

Referenced by XrdCl::Utils::HasPgRW(), and XrdCl::Utils::HasXAttr().

◆ IsMetalink()

bool XrdCl::URL::IsMetalink ( ) const

Is it a URL to a metalink.

◆ IsSecure()

bool XrdCl::URL::IsSecure ( ) const

Does the protocol indicate encryption.

◆ IsTPC()

bool XrdCl::URL::IsTPC ( ) const

Is the URL used in TPC context.

◆ IsValid()

bool XrdCl::URL::IsValid ( ) const

◆ ParseHostInfo()

bool XrdCl::URL::ParseHostInfo ( const std::string  hhostInfo)
private

◆ ParsePath()

bool XrdCl::URL::ParsePath ( const std::string &  path)
private

◆ PathEndsWith()

bool XrdCl::URL::PathEndsWith ( const std::string &  sufix) const
private

◆ SetHostName()

void XrdCl::URL::SetHostName ( const std::string &  hostName)
inline

Set the host name.

References ComputeHostId(), ComputeURL(), and pHostName.

◆ SetHostPort()

void XrdCl::URL::SetHostPort ( const std::string &  hostName,
int  port 
)
inline

◆ SetParams() [1/2]

void XrdCl::URL::SetParams ( const ParamsMap params)
inline

Set params.

References ComputeURL(), and pParams.

◆ SetParams() [2/2]

void XrdCl::URL::SetParams ( const std::string &  params)

Set params.

Referenced by XrdCl::CopyProcess::MarkTPC().

◆ SetPassword()

void XrdCl::URL::SetPassword ( const std::string &  password)
inline

Set the password.

References ComputeURL(), and pPassword.

◆ SetPath()

void XrdCl::URL::SetPath ( const std::string &  path)
inline

Set the path.

References ComputeURL(), and pPath.

Referenced by XrdCl::ZipListHandler::ZipListHandler().

◆ SetPort()

void XrdCl::URL::SetPort ( int  port)
inline

References ComputeHostId(), ComputeURL(), and pPort.

◆ SetProtocol()

void XrdCl::URL::SetProtocol ( const std::string &  protocol)
inline

Set protocol.

References ComputeURL(), and pProtocol.

◆ SetUserName()

void XrdCl::URL::SetUserName ( const std::string &  userName)
inline

Set the username.

References ComputeHostId(), ComputeURL(), and pUserName.

Member Data Documentation

◆ pHostId

std::string XrdCl::URL::pHostId
private

Referenced by GetHostId().

◆ pHostName

std::string XrdCl::URL::pHostName
private

◆ pParams

ParamsMap XrdCl::URL::pParams
private

Referenced by GetParams(), and SetParams().

◆ pPassword

std::string XrdCl::URL::pPassword
private

Referenced by GetPassword(), and SetPassword().

◆ pPath

std::string XrdCl::URL::pPath
private

Referenced by GetPath(), and SetPath().

◆ pPort

int XrdCl::URL::pPort
private

Referenced by GetPort(), SetHostPort(), and SetPort().

◆ pProtocol

std::string XrdCl::URL::pProtocol
private

Referenced by GetProtocol(), and SetProtocol().

◆ pURL

std::string XrdCl::URL::pURL
private

Referenced by GetURL().

◆ pUserName

std::string XrdCl::URL::pUserName
private

Referenced by GetUserName(), and SetUserName().


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