kmMqtt 0.0.1
MQTT Client Library
Loading...
Searching...
No Matches
kmMqtt::mqtt::Address Struct Reference

Static Public Member Functions

static Address createIp4 (const char *scheme, const char *ip, const char *port, const char *path) noexcept
 Constructs an Address object from IP4.
static Address createIp6 (const char *scheme, const char *ip, const char *port, const char *path) noexcept
 Constructs an Address object from IP6.
static Address createURL (const char *scheme, const char *hostname, const char *port, const char *path) noexcept
 Constructs an Address object from hostname.
static std::vector< Address > toAddress (const char *urls)
 Parses a space-separated list of URLs into a vector of Address objects.
static bool tryParseHostnameAddress (const std::string &url, std::string &hostname, std::string &port)
 Tries to parse a hostname address from a URL string.

Member Function Documentation

◆ createIp4()

Address kmMqtt::mqtt::Address::createIp4 ( const char * scheme,
const char * ip,
const char * port,
const char * path )
inlinestaticnoexcept

Constructs an Address object from IP4.

Parameters
schemeThe scheme of the address (e.g., "mqtt", "ws").
ipThe IP address.
portThe port number.
pathThe path component of the address.
Returns
Address object.

◆ createIp6()

Address kmMqtt::mqtt::Address::createIp6 ( const char * scheme,
const char * ip,
const char * port,
const char * path )
inlinestaticnoexcept

Constructs an Address object from IP6.

Parameters
schemeThe scheme of the address (e.g., "mqtt", "ws").
ipThe IP address.
portThe port number.
pathThe path component of the address.
Returns
Address object.

◆ createURL()

Address kmMqtt::mqtt::Address::createURL ( const char * scheme,
const char * hostname,
const char * port,
const char * path )
inlinestaticnoexcept

Constructs an Address object from hostname.

Parameters
schemeThe scheme of the address (e.g., "mqtt", "ws").
hostnameThe hostname.
portThe port number.
pathThe path component of the address.
Returns
Address object.

◆ toAddress()

std::vector< Address > kmMqtt::mqtt::Address::toAddress ( const char * urls)
inlinestatic

Parses a space-separated list of URLs into a vector of Address objects.

Supports IP4, IP6, and hostname formats.

Parameters
urlsA space-separated string of URLs.
Returns
vector of address objects.

◆ tryParseHostnameAddress()

bool kmMqtt::mqtt::Address::tryParseHostnameAddress ( const std::string & url,
std::string & hostname,
std::string & port )
inlinestatic

Tries to parse a hostname address from a URL string.

Parameters
urlThe URL string to parse.
hostnameOutput parameter for the parsed hostname.
portOutput parameter for the parsed port.
Returns
true if parsing was successful, false otherwise.

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