Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Network endpoint URI. More...
#include <endpoint_uri.h>
Public Types | |
enum | Subset { Subset_Full , Subset_Resource } |
URI subset. More... | |
Public Member Functions | |
EndpointUri (core::IArena &) | |
Initialize empty URI. More... | |
bool | is_equal (const EndpointUri &other) const |
Check if URI is equivalent to another URI. More... | |
ROC_ATTR_NODISCARD bool | assign (const EndpointUri &other) |
Copy data from another URI. More... | |
bool | verify (Subset subset) const |
Check given subset of the URI. More... | |
void | clear (Subset subset) |
Clear given subset of the URI. More... | |
void | invalidate (Subset subset) |
Invalidate given subset of the URI. More... | |
ROC_ATTR_NODISCARD bool | set_proto (Protocol) |
Set protocol ID (URI scheme). More... | |
Protocol | proto () const |
Protocol ID (URI scheme). More... | |
ROC_ATTR_NODISCARD bool | get_proto (Protocol &proto) const |
Get protocol ID (URI scheme). More... | |
ROC_ATTR_NODISCARD bool | format_proto (core::StringBuilder &dst) const |
Get URI proto. More... | |
ROC_ATTR_NODISCARD bool | set_host (const char *str) |
Set URI host. String should be zero-terminated. More... | |
ROC_ATTR_NODISCARD bool | set_host (const char *str, size_t str_len) |
Set URI host. String should not be zero-terminated. More... | |
const char * | host () const |
Hostname or IP address. More... | |
ROC_ATTR_NODISCARD bool | format_host (core::StringBuilder &dst) const |
Get URI host. More... | |
ROC_ATTR_NODISCARD bool | set_port (int) |
Set port. More... | |
int | port () const |
TCP or UDP port. More... | |
ROC_ATTR_NODISCARD bool | get_port (int &port) const |
Get URI port. More... | |
const char * | service () const |
Get string representation of port. If port is not set, default port for the protocol is used. This string is suitable for passing to getaddrinfo(). More... | |
ROC_ATTR_NODISCARD bool | set_path (const char *str) |
Set decoded URI path. More... | |
ROC_ATTR_NODISCARD bool | set_path (const char *str, size_t str_len) |
Set decoded URI path. String should not be zero-terminated. More... | |
ROC_ATTR_NODISCARD bool | set_encoded_path (const char *str) |
Set encoded URI path. String should be percent-encoded. More... | |
ROC_ATTR_NODISCARD bool | set_encoded_path (const char *str, size_t str_len) |
Set encoded URI path. String should be percent-encoded. String should not be zero-terminated. More... | |
const char * | path () const |
Decoded path. More... | |
ROC_ATTR_NODISCARD bool | format_encoded_path (core::StringBuilder &dst) const |
Get URI path. String will be percent-encoded. More... | |
ROC_ATTR_NODISCARD bool | set_encoded_query (const char *str) |
Set query. String should be percent-encoded. More... | |
ROC_ATTR_NODISCARD bool | set_encoded_query (const char *str, size_t str_len) |
Set query. String should be percent-encoded. String should not be zero-terminated. More... | |
const char * | encoded_query () const |
Raw query. More... | |
ROC_ATTR_NODISCARD bool | format_encoded_query (core::StringBuilder &dst) const |
Get URI query. String will be percent-encoded. More... | |
Network endpoint URI.
Definition at line 27 of file endpoint_uri.h.
URI subset.
Enumerator | |
---|---|
Subset_Full | Entire URI. |
Subset_Resource | Absolute path and query. |
Definition at line 30 of file endpoint_uri.h.
|
explicit |
Initialize empty URI.
ROC_ATTR_NODISCARD bool roc::address::EndpointUri::assign | ( | const EndpointUri & | other | ) |
Copy data from another URI.
void roc::address::EndpointUri::clear | ( | Subset | subset | ) |
Clear given subset of the URI.
const char* roc::address::EndpointUri::encoded_query | ( | ) | const |
Raw query.
ROC_ATTR_NODISCARD bool roc::address::EndpointUri::format_encoded_path | ( | core::StringBuilder & | dst | ) | const |
Get URI path. String will be percent-encoded.
ROC_ATTR_NODISCARD bool roc::address::EndpointUri::format_encoded_query | ( | core::StringBuilder & | dst | ) | const |
Get URI query. String will be percent-encoded.
ROC_ATTR_NODISCARD bool roc::address::EndpointUri::format_host | ( | core::StringBuilder & | dst | ) | const |
Get URI host.
ROC_ATTR_NODISCARD bool roc::address::EndpointUri::format_proto | ( | core::StringBuilder & | dst | ) | const |
Get URI proto.
ROC_ATTR_NODISCARD bool roc::address::EndpointUri::get_port | ( | int & | port | ) | const |
Get URI port.
ROC_ATTR_NODISCARD bool roc::address::EndpointUri::get_proto | ( | Protocol & | proto | ) | const |
Get protocol ID (URI scheme).
const char* roc::address::EndpointUri::host | ( | ) | const |
Hostname or IP address.
void roc::address::EndpointUri::invalidate | ( | Subset | subset | ) |
Invalidate given subset of the URI.
bool roc::address::EndpointUri::is_equal | ( | const EndpointUri & | other | ) | const |
Check if URI is equivalent to another URI.
const char* roc::address::EndpointUri::path | ( | ) | const |
Decoded path.
int roc::address::EndpointUri::port | ( | ) | const |
TCP or UDP port.
Protocol roc::address::EndpointUri::proto | ( | ) | const |
Protocol ID (URI scheme).
const char* roc::address::EndpointUri::service | ( | ) | const |
Get string representation of port. If port is not set, default port for the protocol is used. This string is suitable for passing to getaddrinfo().
ROC_ATTR_NODISCARD bool roc::address::EndpointUri::set_encoded_path | ( | const char * | str | ) |
Set encoded URI path. String should be percent-encoded.
ROC_ATTR_NODISCARD bool roc::address::EndpointUri::set_encoded_path | ( | const char * | str, |
size_t | str_len | ||
) |
Set encoded URI path. String should be percent-encoded. String should not be zero-terminated.
ROC_ATTR_NODISCARD bool roc::address::EndpointUri::set_encoded_query | ( | const char * | str | ) |
Set query. String should be percent-encoded.
ROC_ATTR_NODISCARD bool roc::address::EndpointUri::set_encoded_query | ( | const char * | str, |
size_t | str_len | ||
) |
Set query. String should be percent-encoded. String should not be zero-terminated.
ROC_ATTR_NODISCARD bool roc::address::EndpointUri::set_host | ( | const char * | str | ) |
Set URI host. String should be zero-terminated.
ROC_ATTR_NODISCARD bool roc::address::EndpointUri::set_host | ( | const char * | str, |
size_t | str_len | ||
) |
Set URI host. String should not be zero-terminated.
ROC_ATTR_NODISCARD bool roc::address::EndpointUri::set_path | ( | const char * | str | ) |
Set decoded URI path.
ROC_ATTR_NODISCARD bool roc::address::EndpointUri::set_path | ( | const char * | str, |
size_t | str_len | ||
) |
Set decoded URI path. String should not be zero-terminated.
ROC_ATTR_NODISCARD bool roc::address::EndpointUri::set_port | ( | int | ) |
Set port.
ROC_ATTR_NODISCARD bool roc::address::EndpointUri::set_proto | ( | Protocol | ) |
Set protocol ID (URI scheme).
bool roc::address::EndpointUri::verify | ( | Subset | subset | ) | const |
Check given subset of the URI.