![]() |
Spicy
|
#include <port.h>
Public Member Functions | |
Port (uint16_t port, Protocol protocol) | |
Port (const std::string &port) | |
Port (const Port &)=default | |
Port (Port &&) noexcept=default | |
Port & | operator= (const Port &)=default |
Port & | operator= (Port &&) noexcept=default |
auto | port () const |
auto | protocol () const |
bool | operator== (const Port &other) const |
bool | operator!= (const Port &other) const |
operator std::string () const | |
Represents HILTI's port type. A port is pair of port number and protocol.
|
inline |
Constructs a port value. from port number and protocol.
|
inlineexplicit |
Constructs a port from a textual representation of the form <port number>/<protocol
(e.g., 123/tcp
)..
port | string of the form <port>/<proto> . |
RuntimeError | if it cannot parse the port specification (whereby, however, an unsupported protocol doesn't count as an error; it'll be left as Undef ) |
Port::operator std::string | ( | ) | const |
Returns a human-readable representation of the port, using the same format that the corresponding constructor parses.
|
inline |
Returns the port's number.
|
inline |
Returns the port's protocol.