35 class TUrl :
public TObject {
46 mutable TString fFileOA;
47 mutable TString fHostFQ;
49 mutable TMap *fOptionsMap{
nullptr};
51 static TObjArray *fgSpecialProtocols;
52 static THashList *fgHostFQDNs;
54 void FindFile(
char *u, Bool_t stripDoubleSlash = kTRUE);
56 enum EStatusBits { kUrlWithDefaultPort = BIT(14), kUrlHasDefaultPort = BIT(15) };
60 TUrl(
const char *url, Bool_t defaultIsFile = kFALSE);
61 TUrl(
const TUrl &url);
62 TUrl &operator=(
const TUrl &rhs);
65 const char *GetUrl(Bool_t withDeflt = kFALSE)
const;
66 const char *GetProtocol()
const {
return fProtocol; }
67 const char *GetUser()
const {
return fUser; }
68 const char *GetPasswd()
const {
return fPasswd; }
69 const char *GetHost()
const {
return fHost; }
70 const char *GetHostFQDN()
const;
71 const char *GetFile()
const {
return fFile; }
72 const char *GetAnchor()
const {
return fAnchor; }
73 const char *GetOptions()
const {
return fOptions; }
74 const char *GetValueFromOptions(
const char *key)
const;
75 Int_t GetIntValueFromOptions(
const char *key)
const;
76 Bool_t HasOption(
const char *key)
const;
77 void ParseOptions()
const;
78 void CleanRelativePath();
79 const char *GetFileAndOptions()
const;
80 Int_t GetPort()
const {
return fPort; }
81 Bool_t IsValid()
const {
return fPort == -1 ? kFALSE : kTRUE; }
83 void SetProtocol(
const char *proto, Bool_t setDefaultPort = kFALSE);
84 void SetUser(
const char *user) { fUser = user; fUrl =
""; }
85 void SetPasswd(
const char *pw) { fPasswd = pw; fUrl =
""; }
86 void SetHost(
const char *host) { fHost = host; fUrl =
""; }
87 void SetFile(
const char *file) { fFile = file; fUrl =
""; fFileOA =
"";}
88 void SetAnchor(
const char *anchor) { fAnchor = anchor; fUrl =
""; fFileOA =
""; }
89 void SetOptions(
const char *opt) { fOptions = opt; fUrl =
""; fFileOA =
""; }
90 void SetPort(Int_t port) { fPort = port; fUrl =
""; }
91 void SetUrl(
const char *url, Bool_t defaultIsFile = kFALSE);
93 Bool_t IsSortable()
const {
return kTRUE; }
94 Int_t Compare(
const TObject *obj)
const;
96 void Print(Option_t *option=
"")
const;
98 static TObjArray *GetSpecialProtocols();