Class of URIs (Uniform Resource Identifiers) to specify endpoints in this library.
More...
#include <msgpack_rpc/addresses/uri.h>
|
| URI (std::string_view scheme, std::string_view host_or_path, std::optional< std::uint16_t > port_number=std::optional< std::uint16_t >()) |
| Constructor.
|
std::string_view | host_or_path () const noexcept |
| Get the host name or file path.
|
bool | operator!= (const URI &right) const |
| Compare with a URI.
|
bool | operator== (const URI &right) const |
| Compare with a URI.
|
std::optional< std::uint16_t > | port_number () const noexcept |
| Get the port number.
|
std::string_view | scheme () const noexcept |
| Get the scheme.
|
|
static URI | parse (std::string_view uri_string) |
| Parse a string to create a URI.
|
Class of URIs (Uniform Resource Identifiers) to specify endpoints in this library.
Definition at line 38 of file uri.h.
◆ URI()
msgpack_rpc::addresses::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.
- Parameters
-
[in] | scheme | Scheme. |
[in] | host_or_path | Host name or file path. |
[in] | port_number | Port number. |
- Note
- For protocols without port numbers, port_number can be omitted.
Definition at line 34 of file uri.cpp.
◆ host_or_path()
std::string_view msgpack_rpc::addresses::URI::host_or_path |
( |
| ) |
const |
|
nodiscardnoexcept |
Get the host name or file path.
- Returns
- Host name or file path.
Definition at line 40 of file uri.cpp.
◆ operator!=()
bool msgpack_rpc::addresses::URI::operator!= |
( |
const URI & | right | ) |
const |
Compare with a URI.
- Parameters
-
[in] | right | Right-hand-side address. |
- Return values
-
true | Two URIs are different. |
false | Two URIs are same. |
Definition at line 52 of file uri.cpp.
◆ operator==()
bool msgpack_rpc::addresses::URI::operator== |
( |
const URI & | right | ) |
const |
Compare with a URI.
- Parameters
-
[in] | right | Right-hand-side address. |
- Return values
-
true | Two URIs are same. |
false | Two URIs are different. |
Definition at line 46 of file uri.cpp.
◆ parse()
URI msgpack_rpc::addresses::URI::parse |
( |
std::string_view | uri_string | ) |
|
|
staticnodiscard |
Parse a string to create a URI.
- Parameters
-
[in] | uri_string | String to specify a URI. |
- Returns
- URI.
Definition at line 54 of file uri.cpp.
◆ port_number()
std::optional< std::uint16_t > msgpack_rpc::addresses::URI::port_number |
( |
| ) |
const |
|
nodiscardnoexcept |
Get the port number.
- Returns
- Port number.
Definition at line 42 of file uri.cpp.
◆ scheme()
std::string_view msgpack_rpc::addresses::URI::scheme |
( |
| ) |
const |
|
nodiscardnoexcept |
Get the scheme.
- Returns
- Scheme.
Definition at line 38 of file uri.cpp.
◆ host_or_path_
std::string msgpack_rpc::addresses::URI::host_or_path_ |
|
private |
Host name or file path.
Definition at line 105 of file uri.h.
◆ port_number_
std::optional<std::uint16_t> msgpack_rpc::addresses::URI::port_number_ |
|
private |
Port.
Definition at line 108 of file uri.h.
◆ scheme_
std::string msgpack_rpc::addresses::URI::scheme_ |
|
private |
Scheme.
Definition at line 102 of file uri.h.
The documentation for this class was generated from the following files:
- include/msgpack_rpc/addresses/uri.h
- src/msgpack_rpc/addresses/uri.cpp