CernVM-FS  2.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
url.h
Go to the documentation of this file.
1 
5 #ifndef CVMFS_URL_H_
6 #define CVMFS_URL_H_
7 
8 #include <string>
9 
10 class Url {
11  public:
23  static const int kDefaultPort;
24  static const char* kDefaultProtocol;
25 
34  static Url* Parse(const std::string& url,
35  const std::string& default_protocol = kDefaultProtocol,
36  int default_port = kDefaultPort);
37  static bool ValidateHost(const std::string& host);
38 
39  ~Url();
40 
41  std::string protocol() const { return protocol_; }
42  std::string address() const { return address_; }
43  std::string host() const { return host_; }
44  std::string path() const { return path_; }
45  int port() const { return port_; }
46 
47  private:
48  Url();
49  Url(const std::string& protocol, const std::string& host,
50  const std::string& path, int port);
51 
52  std::string protocol_;
53  std::string host_;
54  std::string path_;
55  int port_;
56  std::string address_;
57 };
58 
59 #endif // CVMFS_URL_H_
int port_
Definition: url.h:55
~Url()
Definition: url.cc:105
static const char * kDefaultProtocol
Definition: url.h:24
int port() const
Definition: url.h:45
static bool ValidateHost(const std::string &host)
Definition: url.cc:76
std::string protocol() const
Definition: url.h:41
std::string protocol_
Definition: url.h:52
std::string path_
Definition: url.h:54
std::string path() const
Definition: url.h:44
std::string address_
Definition: url.h:56
Url()
Definition: url.cc:90
std::string host() const
Definition: url.h:43
std::string host_
Definition: url.h:53
static Url * Parse(const std::string &url, const std::string &default_protocol=kDefaultProtocol, int default_port=kDefaultPort)
Definition: url.cc:14
Definition: url.h:10
std::string address() const
Definition: url.h:42
static const int kDefaultPort
Definition: url.h:23