Qpid Proton C++ API  0.17.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
url Class Reference

A URL parser. More...

#include <url.hpp>

Public Member Functions

 url (const std::string &url_str)
 Parse url_str as an AMQP URL. More...
 
 url (const url &)
 Copy a URL.
 
urloperator= (const url &)
 Copy a URL.
 
bool empty () const
 True if the URL is empty.
 
 operator std::string () const
 Returns the URL as a string.
 
URL fields
std::string scheme () const
 amqp or amqps.
 
std::string user () const
 The user name for authentication.
 
std::string password () const
 The password.
 
std::string host () const
 The host name or IP address.
 
std::string port () const
 port can be a number or a symbolic name such as "amqp".
 
uint16_t port_int () const
 port_int is the numeric value of the port.
 
std::string host_port () const
 host_port returns just the host:port part of the URL
 
std::string path () const
 path is everything after the final "/".
 

Static Public Attributes

static const std::string AMQP
 "amqp" prefix
 
static const std::string AMQPS
 "amqps" prefix
 

Friends

std::string to_string (const url &)
 Return URL as a string.
 

Detailed Description

A URL parser.

Proton URLs take the form <scheme>://<username>:<password>@<host>:<port>/<path>.

  • Scheme can be amqp or amqps. Host is a DNS name or IP address (v4 or v6).
  • Port can be a number or a symbolic service name such as amqp.
  • Path is normally used as a link source or target address. On a broker it typically corresponds to a queue or topic name.
Examples:
helloworld.cpp, mt/epoll_container.cpp, and server.cpp.

Constructor & Destructor Documentation

url ( const std::string &  url_str)

Parse url_str as an AMQP URL.

Note
Converts automatically from string.
Exceptions
url_errorif URL is invalid.

The documentation for this class was generated from the following file: