libqi-api  release-2.5.3-2016-11-18
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
url.hpp
Go to the documentation of this file.
1 #pragma once
2 /*
3 ** Copyright (C) 2012 Aldebaran Robotics
4 ** See COPYING for the license
5 */
6 
7 #ifndef _QI_MESSAGING_URL_HPP_
8 #define _QI_MESSAGING_URL_HPP_
9 
10 #include <string>
11 #include <vector>
12 
13 #include <qi/api.hpp>
14 
15 namespace qi {
16  class UrlPrivate;
17 
35  class QI_API Url
36  {
37  public:
40  Url();
41 
46  Url(const std::string &url);
47 
54  Url(const std::string &url, unsigned short defaultPort);
55 
62  Url(const std::string &url, const std::string &defaultProtocol);
63 
72  Url(const std::string &url, const std::string &defaultProtocol, unsigned short defaultPort);
73 
77  Url(const char *url);
82  virtual ~Url();
83 
87  Url(const qi::Url& url);
88  Url& operator= (const Url& rhs);
89  bool operator< (const Url& rhs) const;
97  bool isValid() const;
98 
104  const std::string& str() const;
105 
110  const std::string& protocol() const;
111 
116  const std::string& host() const;
117 
121  unsigned short port() const;
122 
123  private:
124  UrlPrivate* _p;
125  };
126 
129  QI_API bool operator==(const Url& lhs, const Url& rhs);
132  QI_API inline bool operator!=(const Url& lhs, const Url& rhs)
133  { return !(lhs == rhs); }
134 
135  using UrlVector = std::vector<Url>;
136 
137 }
138 
139 #endif // _QIMESSAGING_URL_HPP_
#define QI_API
Definition: api.hpp:33
dll import/export and compiler message
bool operator==(const Signature &lhs, const Signature &rhs)
std::vector< Url > UrlVector
Definition: url.hpp:135
Definition: url.hpp:35
bool operator<(const AnyReference &a, const AnyReference &b)
bool operator!=(const Signature &lhs, const Signature &rhs)
Definition: signature.hpp:154