xrootd
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
XrdCl::URL Class Reference

URL representation. More...

#include <XrdClURL.hh>

Collaboration diagram for XrdCl::URL:
Collaboration graph
[legend]

Public Types

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

Public Member Functions

 URL ()
 Default constructor. More...
 
 URL (const std::string &url)
 
bool IsValid () const
 Is the url valid. 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 GetLocation () const
 Get 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)
 
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...
 
const ParamsMapGetParams () const
 Get the URL params. More...
 
std::string GetParamsAsString () const
 Get the URL params as string. More...
 
void SetParams (const std::string &params)
 Set params. More...
 
void SetParams (const ParamsMap &params)
 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 ()
 

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

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

Map of get params

Constructor & Destructor Documentation

XrdCl::URL::URL ( )

Default constructor.

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

Constructor

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

References FromString().

Member Function Documentation

void XrdCl::URL::Clear ( )

Clear the url.

References pHostId, pHostName, pParams, pPassword, pPath, pPort, pProtocol, pURL, and pUserName.

Referenced by FromString().

void XrdCl::URL::ComputeHostId ( )
private
void XrdCl::URL::ComputeURL ( )
private
bool XrdCl::URL::FromString ( const std::string &  url)
std::string XrdCl::URL::GetHostId ( ) const
inline
const std::string& XrdCl::URL::GetHostName ( ) const
inline
std::string XrdCl::URL::GetLocation ( ) const

Get protocol://host:port/path.

References pHostName, pPath, pPort, and pProtocol.

const ParamsMap& XrdCl::URL::GetParams ( ) const
inline
std::string XrdCl::URL::GetParamsAsString ( ) const

Get the URL params as string.

References pParams.

Referenced by GetPathWithParams().

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

Get the password.

References pPassword.

Referenced by UtilsTest::URLTest().

const std::string& XrdCl::URL::GetPath ( ) const
inline
std::string XrdCl::URL::GetPathWithParams ( ) const
int XrdCl::URL::GetPort ( ) const
inline
const std::string& XrdCl::URL::GetProtocol ( ) const
inline
std::string XrdCl::URL::GetURL ( ) const
inline
const std::string& XrdCl::URL::GetUserName ( ) const
inline

Get the username.

References pUserName.

Referenced by XrdCl::XRootDTransport::GenerateLogIn(), and UtilsTest::URLTest().

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

References ComputeURL(), pPath, and SetParams().

Referenced by FromString().

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

Set the host name.

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

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

Set params.

References ComputeURL(), and pParams.

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

Set the password.

References ComputeURL(), and pPassword.

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

Set the path.

References ComputeURL(), and pPath.

Referenced by XrdCl::FileStateHandler::OnOpen().

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

Set protocol.

References ComputeURL(), and pProtocol.

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

Set the username.

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

Member Data Documentation

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

Referenced by Clear(), ComputeHostId(), and GetHostId().

std::string XrdCl::URL::pHostName
private
ParamsMap XrdCl::URL::pParams
private
std::string XrdCl::URL::pPassword
private
std::string XrdCl::URL::pPath
private
int XrdCl::URL::pPort
private
std::string XrdCl::URL::pProtocol
private
std::string XrdCl::URL::pURL
private

Referenced by Clear(), ComputeURL(), FromString(), and GetURL().

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

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