00001 #ifndef PROTON_URL_HPP
00002 #define PROTON_URL_HPP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "./types_fwd.hpp"
00026 #include "./error.hpp"
00027
00028 #include <iosfwd>
00029
00030 struct pn_url_t;
00031
00032 namespace proton {
00033
00035 struct
00036 PN_CPP_CLASS_EXTERN url_error : public error {
00039 PN_CPP_EXTERN explicit url_error(const std::string&);
00041 };
00042
00055 class url {
00056 public:
00057 static const std::string AMQP;
00058 static const std::string AMQPS;
00059
00060
00061
00062
00067 PN_CPP_EXTERN url(const std::string& url_str);
00068
00078 PN_CPP_EXTERN url(const std::string& url_str, bool defaults);
00080
00082 PN_CPP_EXTERN url(const url&);
00083
00084 PN_CPP_EXTERN ~url();
00085
00087 PN_CPP_EXTERN url& operator=(const url&);
00088
00090 PN_CPP_EXTERN bool empty() const;
00091
00093 PN_CPP_EXTERN operator std::string() const;
00094
00098
00100 PN_CPP_EXTERN std::string scheme() const;
00102 PN_CPP_EXTERN std::string user() const;
00103
00105 PN_CPP_EXTERN std::string password() const;
00107 PN_CPP_EXTERN std::string host() const;
00109 PN_CPP_EXTERN std::string port() const;
00111 PN_CPP_EXTERN uint16_t port_int() const;
00113 PN_CPP_EXTERN std::string host_port() const;
00114
00115
00116
00118 PN_CPP_EXTERN std::string path() const;
00119
00121
00123 friend PN_CPP_EXTERN std::string to_string(const url&);
00124
00125 private:
00126 pn_url_t* url_;
00127
00129
00130 friend PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const url&);
00131
00132
00138 friend PN_CPP_EXTERN std::istream& operator>>(std::istream&, url&);
00139
00141 };
00142
00143 }
00144
00145 #endif // PROTON_URL_HPP