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 "./internal/pn_unique_ptr.hpp"
00026 #include "./error.hpp"
00027
00028 #include <proton/type_compat.h>
00029
00030 #include <iosfwd>
00031 #include <string>
00032
00035
00036 namespace proton {
00037
00041
00042 struct
00043 PN_CPP_DEPRECATED("Use a third-party URL library")
00044 PN_CPP_CLASS_EXTERN url_error : public error {
00047 PN_CPP_EXTERN explicit url_error(const std::string&);
00049 };
00050
00065 class PN_CPP_DEPRECATED("Use a third-party URL library") url {
00066 public:
00067 static const std::string AMQP;
00068 static const std::string AMQPS;
00069
00070
00071
00072
00077 PN_CPP_EXTERN url(const std::string& url_str);
00078
00088 PN_CPP_EXTERN url(const std::string& url_str, bool defaults);
00090
00092 PN_CPP_EXTERN url(const url&);
00093
00094 PN_CPP_EXTERN ~url();
00095
00097 PN_CPP_EXTERN url& operator=(const url&);
00098
00100 PN_CPP_EXTERN bool empty() const;
00101
00103 PN_CPP_EXTERN operator std::string() const;
00104
00108
00110 PN_CPP_EXTERN std::string scheme() const;
00112 PN_CPP_EXTERN std::string user() const;
00113
00115 PN_CPP_EXTERN std::string password() const;
00117 PN_CPP_EXTERN std::string host() const;
00119 PN_CPP_EXTERN std::string port() const;
00121 PN_CPP_EXTERN uint16_t port_int() const;
00123 PN_CPP_EXTERN std::string host_port() const;
00124
00125
00126
00128 PN_CPP_EXTERN std::string path() const;
00129
00131
00133 friend PN_CPP_EXTERN std::string to_string(const url&);
00134
00135 private:
00136 struct impl;
00137 internal::pn_unique_ptr<impl> impl_;
00138
00140
00141 friend PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const url&);
00142
00143
00149 friend PN_CPP_EXTERN std::istream& operator>>(std::istream&, url&);
00150
00152 };
00153
00154 }
00155
00156 #endif // PROTON_URL_HPP