00001 ////////////////////////////////////////////////////////////////////////// 00002 // // 00003 // XrdClientUrlInfo // 00004 // // 00005 // Author: Fabrizio Furano (INFN Padova, 2004) // 00006 // Adapted from TXNetFile (root.cern.ch) originally done by // 00007 // Alvise Dorigo, Fabrizio Furano, INFN Padova, 2003 // 00008 // Revised by G. Ganis, CERN, June 2005 // 00009 // // 00010 // Class handling information about an url // 00011 // The purpose of this class is to allow: // 00012 // - parsing a string url into its components // 00013 // - reading/writing the single components // 00014 // - reading the modified full url // 00015 // // 00016 ////////////////////////////////////////////////////////////////////////// 00017 00018 // $Id: XrdClientUrlInfo.hh 22437 2008-03-04 14:35:16Z rdm $ 00019 00020 #ifndef _XRC_URLINFO_H 00021 #define _XRC_URLINFO_H 00022 00023 #include "XrdOuc/XrdOucString.hh" 00024 00025 // 00026 // The information an url may contain 00027 // Plus utilities for parsing and rebuilding an url 00028 // 00029 00030 class XrdClientUrlInfo { 00031 public: 00032 XrdOucString Proto; 00033 XrdOucString Passwd; 00034 XrdOucString User; 00035 XrdOucString Host; 00036 int Port; 00037 XrdOucString HostAddr; 00038 XrdOucString HostWPort; 00039 XrdOucString File; 00040 00041 void Clear(); 00042 void TakeUrl(XrdOucString url); 00043 XrdOucString GetUrl(); 00044 00045 XrdClientUrlInfo(const char *url); 00046 XrdClientUrlInfo(const XrdOucString &url); 00047 XrdClientUrlInfo(const XrdClientUrlInfo &url); 00048 XrdClientUrlInfo(); 00049 00050 void SetAddrFromHost(); 00051 00052 inline bool IsValid() { return (Port >= 0); } 00053 00054 XrdClientUrlInfo &operator=(const XrdOucString &url); 00055 XrdClientUrlInfo &operator=(const XrdClientUrlInfo &url); 00056 }; 00057 00058 00059 #endif