00001 #ifndef _XRC_URLINFO_H 00002 #define _XRC_URLINFO_H 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d C l i e n t U r l I n f o . h h */ 00006 /* */ 00007 /* Author: Fabrizio Furano (INFN Padova, 2004) */ 00008 /* Adapted from TXNetFile (root.cern.ch) originally done by */ 00009 /* Alvise Dorigo, Fabrizio Furano, INFN Padova, 2003 */ 00010 /* Revised by G. Ganis, CERN, June 2005 */ 00011 /* */ 00012 /* This file is part of the XRootD software suite. */ 00013 /* */ 00014 /* XRootD is free software: you can redistribute it and/or modify it under */ 00015 /* the terms of the GNU Lesser General Public License as published by the */ 00016 /* Free Software Foundation, either version 3 of the License, or (at your */ 00017 /* option) any later version. */ 00018 /* */ 00019 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */ 00020 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ 00021 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */ 00022 /* License for more details. */ 00023 /* */ 00024 /* You should have received a copy of the GNU Lesser General Public License */ 00025 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */ 00026 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */ 00027 /* */ 00028 /* The copyright holder's institutional names and contributor's names may not */ 00029 /* be used to endorse or promote products derived from this software without */ 00030 /* specific prior written permission of the institution or contributor. */ 00031 /******************************************************************************/ 00032 00034 // // 00035 // Class handling information about an url // 00036 // The purpose of this class is to allow: // 00037 // - parsing a string url into its components // 00038 // - reading/writing the single components // 00039 // - reading the modified full url // 00040 // // 00042 00043 #include "XrdOuc/XrdOucString.hh" 00044 00045 // 00046 // The information an url may contain 00047 // Plus utilities for parsing and rebuilding an url 00048 // 00049 00050 class XrdClientUrlInfo { 00051 public: 00052 XrdOucString Proto; 00053 XrdOucString Passwd; 00054 XrdOucString User; 00055 XrdOucString Host; 00056 int Port; 00057 XrdOucString HostAddr; 00058 XrdOucString HostWPort; 00059 XrdOucString File; 00060 00061 void Clear(); 00062 void TakeUrl(XrdOucString url); 00063 XrdOucString GetUrl(); 00064 00065 XrdClientUrlInfo(const char *url); 00066 XrdClientUrlInfo(const XrdOucString &url); 00067 XrdClientUrlInfo(const XrdClientUrlInfo &url); 00068 XrdClientUrlInfo(); 00069 00070 void SetAddrFromHost(); 00071 00072 inline bool IsValid() { return (Port >= 0); } 00073 00074 XrdClientUrlInfo &operator=(const XrdOucString &url); 00075 XrdClientUrlInfo &operator=(const XrdClientUrlInfo &url); 00076 }; 00077 #endif