ROOT » CORE » BASE » TUrl

class TUrl: public TObject


TUrl

This class represents a WWW compatible URL.
It provides member functions to return the different parts of
an URL. The supported url format is:
[proto://][user[:passwd]@]host[:port]/file.ext[#anchor][?options]


Function Members (Methods)

public:
virtual~TUrl()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
voidCleanRelativePath()
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tCompare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
const char*GetAnchor() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
const char*GetFile() const
const char*GetFileAndOptions() const
const char*GetHost() const
const char*GetHostFQDN() const
virtual const char*TObject::GetIconName() const
Int_tGetIntValueFromOptions(const char* key) const
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
const char*GetOptions() const
const char*GetPasswd() const
Int_tGetPort() const
const char*GetProtocol() const
static TObjArray*GetSpecialProtocols()
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
const char*GetUrl(Bool_t withDeflt = kFALSE) const
const char*GetUser() const
const char*GetValueFromOptions(const char* key) const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
Bool_tHasOption(const char* key) const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tIsSortable() const
Bool_tIsValid() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TUrl&operator=(const TUrl& rhs)
virtual voidTObject::Paint(Option_t* option = "")
voidParseOptions() const
virtual voidTObject::Pop()
virtual voidPrint(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidSetAnchor(const char* anchor)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetFile(const char* file)
voidSetHost(const char* host)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetOptions(const char* opt)
voidSetPasswd(const char* pw)
voidSetPort(Int_t port)
voidSetProtocol(const char* proto, Bool_t setDefaultPort = kFALSE)
virtual voidTObject::SetUniqueID(UInt_t uid)
voidSetUrl(const char* url, Bool_t defaultIsFile = kFALSE)
voidSetUser(const char* user)
virtual voidShowMembers(TMemberInspector& insp) const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
TUrl()
TUrl(const TUrl& url)
TUrl(const char* url, Bool_t defaultIsFile = kFALSE)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
private:
voidFindFile(char* u, Bool_t stripDoubleSlash = kTRUE)

Data Members

public:
static TObject::(anonymous)TObject::kBitMask
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static TObject::EStatusBitsTObject::kHasUUID
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TObject::EStatusBitsTObject::kMustCleanup
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TObject::(anonymous)TObject::kSingleKey
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
private:
TStringfAnchoranchor in object (after #)
TStringfFileremote object
TStringfFileOA!file with option and anchor
TStringfHostremote host
TStringfHostFQ!fully qualified host name
TStringfOptionsoptions/search (after ?)
TMap*fOptionsMap!map containing options key/value pairs
TStringfPasswdpassword
Int_tfPortport through which to contact remote server
TStringfProtocolprotocol: http, ftp, news, root, proof, ...
TStringfUrlfull URL
TStringfUseruser name
static THashList*fgHostFQDNslist of resolved host FQDNs
static TObjArray*fgSpecialProtocolslist of special protocols
static TUrl::EStatusBitskUrlHasDefaultPort
static TUrl::EStatusBitskUrlWithDefaultPort

Class Charts

Inheritance Chart:
TObject
TUrl

Function documentation

TUrl(const char* url, Bool_t defaultIsFile = kFALSE)
 Parse url character string and split in its different subcomponents.
 Use IsValid() to check if URL is legal.

 url: [proto://][user[:passwd]@]host[:port]/file.ext[?options][#anchor]

 Known protocols: http, root, proof, ftp, news and any special protocols
 defined in the rootrc Url.Special key.
 The default protocol is "http", unless defaultIsFile is true in which
 case the url is assumed to be of type "file".
 If a passwd contains a @ it must be escaped by a \\, e.g.
 "pip@" becomes "pip\\@".

 Default ports: http=80, root=1094, proof=1093, ftp=20, news=119.
 Port #1093 has been assigned by IANA (www.iana.org) to proofd.
 Port #1094 has been assigned by IANA (www.iana.org) to rootd.
~TUrl()
 Cleanup.
void SetUrl(const char* url, Bool_t defaultIsFile = kFALSE)
 Parse url character string and split in its different subcomponents.
 Use IsValid() to check if URL is legal.

 url: [proto://][user[:passwd]@]host[:port]/file.ext[?options][#anchor]

 Known protocols: http, root, proof, ftp, news and any special protocols
 defined in the rootrc Url.Special key.
 The default protocol is "http", unless defaultIsFile is true in which
 case the url is assumed to be of type "file".
 If a passwd contains a @ it must be escaped by a \\, e.g.
 "pip@" becomes "pip\\@".

 Default ports: http=80, root=1094, proof=1093, ftp=20, news=119.
 Port #1093 has been assigned by IANA (www.iana.org) to proofd.
 Port #1094 has been assigned by IANA (www.iana.org) to rootd.
void FindFile(char* u, Bool_t stripDoubleSlash = kTRUE)
 Find file and optionally anchor and options.
TUrl(const TUrl& url)
 TUrl copy ctor.
TUrl & operator=(const TUrl& rhs)
 TUrl assignment operator.
const char * GetUrl(Bool_t withDeflt = kFALSE) const
 Return full URL. If withDflt is kTRUE, explicitly add the port even
 if it matches the default value for the URL protocol.
const char * GetHostFQDN() const
 Return fully qualified domain name of url host. If host cannot be
 resolved or not valid return the host name as originally specified.
const char * GetFileAndOptions() const
 Return the file and its options (the string specified behind the ?).
 Convenience function useful when the option is used to pass
 authetication/access information for the specified file.
void SetProtocol(const char* proto, Bool_t setDefaultPort = kFALSE)
 Set protocol and, optionally, change the port accordingly.
Int_t Compare(const TObject* obj) const
 Compare two urls as strings.
void Print(Option_t* option = "") const
 Print URL on stdout.
TObjArray * GetSpecialProtocols()
 Read the list of special protocols from the rootrc files.
 These protocols will be parsed in a protocol and a file part,
 no host or other info will be determined. This is typically
 used for legacy file descriptions like: rfio:host:/path/file.root.
void ParseOptions() const
 Parse URL options into a key/value map.
const char * GetValueFromOptions(const char* key) const
 Return a value for a given key from the URL options.
 Returns 0 in case key is not found.
Int_t GetIntValueFromOptions(const char* key) const
 Return a value for a given key from the URL options as an Int_t,
 a missing key returns -1.
Bool_t HasOption(const char* key) const
 Returns true if the given key appears in the URL options list.
void CleanRelativePath()
 Recompute the path removing all relative directory jumps via '..'.
TUrl()
{ }
const char * GetProtocol() const
{ return fProtocol; }
const char * GetUser() const
{ return fUser; }
const char * GetPasswd() const
{ return fPasswd; }
const char * GetHost() const
{ return fHost; }
const char * GetFile() const
{ return fFile; }
const char * GetAnchor() const
{ return fAnchor; }
const char * GetOptions() const
{ return fOptions; }
Int_t GetPort() const
{ return fPort; }
Bool_t IsValid() const
{ return fPort == -1 ? kFALSE : kTRUE; }
void SetUser(const char* user)
{ fUser = user; fUrl = ""; }
void SetPasswd(const char* pw)
{ fPasswd = pw; fUrl = ""; }
void SetHost(const char* host)
{ fHost = host; fUrl = ""; }
void SetFile(const char* file)
{ fFile = file; fUrl = ""; fFileOA = "";}
void SetAnchor(const char* anchor)
{ fAnchor = anchor; fUrl = ""; fFileOA = ""; }
void SetOptions(const char* opt)
{ fOptions = opt; fUrl = ""; fFileOA = ""; }
void SetPort(Int_t port)
{ fPort = port; fUrl = ""; }
Bool_t IsSortable() const
{ return kTRUE; }