13 #define RC_DEFAULT_PORT 389
14 #define HTTP_DEFAULT_PORT 80
15 #define HTTPS_DEFAULT_PORT 443
16 #define HTTPG_DEFAULT_PORT 8443
17 #define LDAP_DEFAULT_PORT 389
18 #define FTP_DEFAULT_PORT 21
19 #define GSIFTP_DEFAULT_PORT 2811
20 #define LFC_DEFAULT_PORT 5010
21 #define XROOTD_DEFAULT_PORT 1094
100 URL(
const std::string& url,
bool encoded =
false,
int defaultPort = -1,
const std::string& defaultPath =
"");
107 base, onelevel, subtree
117 const std::string&
Protocol()
const;
123 const std::string&
Username()
const;
126 const std::string&
Passwd()
const;
129 const std::string&
Host()
const;
141 const std::string&
Path()
const;
155 void ChangeFullPath(
const std::string& newpath,
bool encoded =
false);
158 const std::map<std::string, std::string>&
HTTPOptions()
const;
165 const std::string&
HTTPOption(
const std::string& option,
166 const std::string& undefined =
"")
const;
171 bool AddHTTPOption(
const std::string& option,
const std::string& value,
172 bool overwrite =
true);
197 const std::map<std::string, std::string>&
Options()
const;
204 const std::string&
Option(
const std::string& option,
205 const std::string& undefined =
"")
const;
216 const std::string& undefined =
"")
const;
225 bool AddOption(
const std::string& option,
const std::string& value,
226 bool overwrite =
true);
232 bool AddOption(
const std::string& option,
bool overwrite =
true);
236 bool overwrite =
true);
242 const std::list<URLLocation>&
Locations()
const;
254 undefined =
"")
const;
265 virtual std::string
str(
bool encode =
false)
const;
268 virtual std::string
plainstr(
bool encode =
false)
const;
271 virtual std::string
fullstr(
bool encode =
false)
const;
283 operator bool()
const;
292 std::map<std::string, std::string>
ParseOptions(
const std::string& optstring,
293 char separator,
bool encoded =
false);
299 static std::string
OptionString(
const std::map<std::string,
300 std::string>& options,
char separator,
bool encode =
false);
360 static std::string
BaseDN2Path(
const std::string&);
363 static std::string
Path2BaseDN(
const std::string&);
366 friend std::ostream&
operator<<(std::ostream& out,
const URL& u);
394 URLLocation(
const std::map<std::string, std::string>& options,
395 const std::string& name);
401 const std::string&
Name()
const;
404 virtual std::string
str()
const;
407 virtual std::string
fullstr()
const;
423 PathIterator(
const std::string& path,
bool end =
false);
433 operator bool()
const;
439 std::string
Rest()
const;
442 const std::string& path;
443 std::string::size_type pos;
454 #endif // __ARC_URL_H__