30#include "msgpack_rpc/impl/msgpack_rpc_export.h"
38class MSGPACK_RPC_EXPORT
URI {
51 std::optional<std::uint16_t>());
58 [[nodiscard]] std::string_view
scheme()
const noexcept;
65 [[nodiscard]] std::string_view
host_or_path()
const noexcept;
72 [[nodiscard]] std::optional<std::uint16_t>
port_number()
const noexcept;
98 [[nodiscard]]
static URI parse(std::string_view uri_string);
128 constexpr format_parse_context::iterator
parse(
129 format_parse_context& context) {
130 return context.end();
140 MSGPACK_RPC_EXPORT format_context::iterator format(
Class of URIs (Uniform Resource Identifiers) to specify endpoints in this library.
std::string_view scheme() const noexcept
Get the scheme.
std::string scheme_
Scheme.
std::optional< std::uint16_t > port_number() const noexcept
Get the port number.
std::string host_or_path_
Host name or file path.
std::optional< std::uint16_t > port_number_
Port.
std::string_view host_or_path() const noexcept
Get the host name or file path.
static URI parse(std::string_view uri_string)
Parse a string to create a URI.
bool operator==(const URI &right) const
Compare with a URI.
bool operator!=(const URI &right) const
Compare with a URI.
URI(std::string_view scheme, std::string_view host_or_path, std::optional< std::uint16_t > port_number=std::optional< std::uint16_t >())
Constructor.
Namespace of fmt library.
Namespace of cpp-msgpack-rpc library.
std::ostream & operator<<(std::ostream &stream, const msgpack_rpc::addresses::URI &uri)
Format a URI.