cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
Loading...
Searching...
No Matches
msgpack_rpc::addresses::URI Class Reference

Class of URIs (Uniform Resource Identifiers) to specify endpoints in this library. More...

#include <msgpack_rpc/addresses/uri.h>

Collaboration diagram for msgpack_rpc::addresses::URI:

Public Member Functions

 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 Public Member Functions

static URI parse (std::string_view uri_string)
 Parse a string to create a URI.

Private Attributes

std::string host_or_path_
 Host name or file path.
std::optional< std::uint16_t > port_number_
 Port.
std::string scheme_
 Scheme.

Detailed Description

Class of URIs (Uniform Resource Identifiers) to specify endpoints in this library.

Definition at line 38 of file uri.h.

Constructor & Destructor Documentation

◆ 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]schemeScheme.
[in]host_or_pathHost name or file path.
[in]port_numberPort number.
Note
For protocols without port numbers, port_number can be omitted.

Definition at line 34 of file uri.cpp.

Member Function Documentation

◆ 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]rightRight-hand-side address.
Return values
trueTwo URIs are different.
falseTwo 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]rightRight-hand-side address.
Return values
trueTwo URIs are same.
falseTwo 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_stringString 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.

Member Data Documentation

◆ 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