Spicy
Public Member Functions | List of all members
hilti::rt::Port Class Reference

#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
 
Portoperator= (const Port &)=default
 
Portoperator= (Port &&) noexcept=default
 
auto port () const
 
auto protocol () const
 
bool operator== (const Port &other) const
 
bool operator!= (const Port &other) const
 
bool operator< (const Port &other) const
 
 operator std::string () const
 

Detailed Description

Represents HILTI's port type. A port is pair of port number and protocol.

Constructor & Destructor Documentation

◆ Port() [1/2]

hilti::rt::Port::Port ( uint16_t  port,
Protocol  protocol 
)
inline

Constructs a port value. from port number and protocol.

◆ Port() [2/2]

hilti::rt::Port::Port ( const std::string &  port)
inlineexplicit

Constructs a port from a textual representation of the form <port number>/<protocol (e.g., 123/tcp)..

Parameters
portstring of the form <port>/<proto>.
Exceptions
RuntimeErrorif it cannot parse the port specification (whereby, however, an unsupported protocol doesn't count as an error; it'll be left as Undef)

Member Function Documentation

◆ operator std::string()

Port::operator std::string ( ) const

Returns a human-readable representation of the port, using the same format that the corresponding constructor parses.

◆ port()

auto hilti::rt::Port::port ( ) const
inline

Returns the port's number.

◆ protocol()

auto hilti::rt::Port::protocol ( ) const
inline

Returns the port's protocol.


The documentation for this class was generated from the following files: