xrootd
|
#include <XrdClURL.hh>
Public Types | |
typedef std::map< std::string, std::string > | ParamsMap |
Public Member Functions | |
URL () | |
Default constructor. More... | |
URL (const std::string &url) | |
URL (const char *url) | |
bool | IsValid () const |
Is the url valid. More... | |
bool | IsMetalink () const |
Is it a URL to a metalink. More... | |
bool | IsLocalFile () const |
bool | IsSecure () const |
Does the protocol indicate encryption. More... | |
bool | IsTPC () const |
Is the URL used in TPC context. More... | |
std::string | GetURL () const |
Get the URL. More... | |
std::string | GetHostId () const |
Get the host part of the URL (user:password@host:port) More... | |
std::string | GetChannelId () const |
std::string | GetLocation () const |
Get location (protocol://host:port/path) More... | |
const std::string & | GetProtocol () const |
Get the protocol. More... | |
void | SetProtocol (const std::string &protocol) |
Set protocol. More... | |
const std::string & | GetUserName () const |
Get the username. More... | |
void | SetUserName (const std::string &userName) |
Set the username. More... | |
const std::string & | GetPassword () const |
Get the password. More... | |
void | SetPassword (const std::string &password) |
Set the password. More... | |
const std::string & | GetHostName () const |
Get the name of the target host. More... | |
void | SetHostName (const std::string &hostName) |
Set the host name. More... | |
int | GetPort () const |
Get the target port. More... | |
void | SetPort (int port) |
void | SetHostPort (const std::string &hostName, int port) |
const std::string & | GetPath () const |
Get the path. More... | |
void | SetPath (const std::string &path) |
Set the path. More... | |
std::string | GetPathWithParams () const |
Get the path with params. More... | |
std::string | GetPathWithFilteredParams () const |
Get the path with params, filteres out 'xrdcl.'. More... | |
const ParamsMap & | GetParams () const |
Get the URL params. More... | |
std::string | GetParamsAsString () const |
Get the URL params as string. More... | |
std::string | GetParamsAsString (bool filter) const |
void | SetParams (const std::string ¶ms) |
Set params. More... | |
void | SetParams (const ParamsMap ¶ms) |
Set params. More... | |
bool | FromString (const std::string &url) |
Parse a string and fill the URL fields. More... | |
void | Clear () |
Clear the url. More... | |
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 |
URL representation.
typedef std::map<std::string, std::string> XrdCl::URL::ParamsMap |
Map of get params
XrdCl::URL::URL | ( | ) |
Default constructor.
XrdCl::URL::URL | ( | const std::string & | url | ) |
Constructor
url | an url in format: protocol://user:password@host:port/path?param1=x¶m2=y |
XrdCl::URL::URL | ( | const char * | url | ) |
Constructor
url | an url in format: protocol://user:password@host:port/path?param1=x¶m2=y |
void XrdCl::URL::Clear | ( | ) |
Clear the url.
|
private |
Referenced by SetHostName(), SetHostPort(), SetPort(), and SetUserName().
|
private |
Referenced by SetHostName(), SetHostPort(), SetParams(), SetPassword(), SetPath(), SetPort(), SetProtocol(), and SetUserName().
bool XrdCl::URL::FromString | ( | const std::string & | url | ) |
Parse a string and fill the URL fields.
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)
|
inline |
Get the host part of the URL (user:password@host:port)
References pHostId.
Referenced by XrdCl::XRootDMsgHandler::XRootDMsgHandler(), and XrdCl::XRootDMsgHandler::~XRootDMsgHandler().
|
inline |
Get the name of the target host.
References pHostName.
std::string XrdCl::URL::GetLocation | ( | ) | const |
Get location (protocol://host:port/path)
Referenced by XrdCl::RedirectEntry::ToString().
|
inline |
std::string XrdCl::URL::GetParamsAsString | ( | ) | const |
Get the URL params as string.
std::string XrdCl::URL::GetParamsAsString | ( | bool | filter | ) | const |
Get the URL params as string
filter | : if set to true filters out 'xrdcl.' |
|
inline |
Get the password.
References pPassword.
|
inline |
Get the path.
References pPath.
Referenced by XrdCl::EcHandler::Close(), XrdCl::EcPlugInFactory::CreateFile(), XrdPfc::IO::GetFilename(), XrdCl::EcHandler::Open(), and XrdCl::EcHandler::Stat().
std::string XrdCl::URL::GetPathWithFilteredParams | ( | ) | const |
Get the path with params, filteres out 'xrdcl.'.
std::string XrdCl::URL::GetPathWithParams | ( | ) | const |
Get the path with params.
|
inline |
Get the target port.
References pPort.
|
inline |
Get the protocol.
References pProtocol.
|
inline |
|
inline |
Get the username.
References pUserName.
bool XrdCl::URL::IsLocalFile | ( | ) | const |
Is it a URL to a local file (file://localhost
Referenced by XrdCl::Utils::HasPgRW(), and XrdCl::Utils::HasXAttr().
bool XrdCl::URL::IsMetalink | ( | ) | const |
Is it a URL to a metalink.
bool XrdCl::URL::IsSecure | ( | ) | const |
Does the protocol indicate encryption.
bool XrdCl::URL::IsValid | ( | ) | const |
Is the url valid.
Referenced by XrdPosixAdmin::isOK(), and XrdCl::XRootDMsgHandler::SetLoadBalancer().
|
private |
|
private |
|
private |
|
inline |
Set the host name.
References ComputeHostId(), ComputeURL(), and pHostName.
|
inline |
References ComputeHostId(), ComputeURL(), pHostName, and pPort.
void XrdCl::URL::SetParams | ( | const std::string & | params | ) |
Set params.
Referenced by XrdCl::CopyProcess::MarkTPC().
|
inline |
Set params.
References ComputeURL(), and pParams.
|
inline |
Set the password.
References ComputeURL(), and pPassword.
|
inline |
Set the path.
References ComputeURL(), and pPath.
Referenced by XrdCl::ZipListHandler::ZipListHandler().
|
inline |
References ComputeHostId(), ComputeURL(), and pPort.
|
inline |
Set protocol.
References ComputeURL(), and pProtocol.
|
inline |
Set the username.
References ComputeHostId(), ComputeURL(), and pUserName.
|
private |
Referenced by GetHostId().
|
private |
Referenced by GetHostName(), SetHostName(), and SetHostPort().
|
private |
Referenced by GetParams(), and SetParams().
|
private |
Referenced by GetPassword(), and SetPassword().
|
private |
Referenced by GetPort(), SetHostPort(), and SetPort().
|
private |
Referenced by GetProtocol(), and SetProtocol().
|
private |
Referenced by GetURL().
|
private |
Referenced by GetUserName(), and SetUserName().