ゴミ箱
Public Member Functions | Public Attributes | List of all members
boost::beast::websocket::close_reason Struct Reference

#include <rfc6455.hpp>

Public Member Functions

 close_reason ()=default
 
 close_reason (std::uint16_t code_)
 Construct from a code. More...
 
 close_reason (string_view s)
 Construct from a reason string. code is close_code::normal. More...
 
 close_reason (char const *s)
 Construct from a reason string literal. code is close_code::normal. More...
 
 close_reason (close_code code_, string_view s)
 Construct from a close code and reason string. More...
 
 operator bool () const
 Returns true if a code was specified. More...
 

Public Attributes

std::uint16_t code = close_code::none
 The close code. More...
 
reason_string reason
 The optional utf8-encoded reason string. More...
 

Detailed Description

Description of the close reason.

This object stores the close code (if any) and the optional utf-8 encoded implementation defined reason string.

Constructor & Destructor Documentation

boost::beast::websocket::close_reason::close_reason ( )
default

Default constructor.

The code will be none. Default constructed objects will explicitly convert to bool as false.

boost::beast::websocket::close_reason::close_reason ( std::uint16_t  code_)
inline

Construct from a code.

boost::beast::websocket::close_reason::close_reason ( string_view  s)
inline

Construct from a reason string. code is close_code::normal.

boost::beast::websocket::close_reason::close_reason ( char const *  s)
inline

Construct from a reason string literal. code is close_code::normal.

boost::beast::websocket::close_reason::close_reason ( close_code  code_,
string_view  s 
)
inline

Construct from a close code and reason string.

Member Function Documentation

boost::beast::websocket::close_reason::operator bool ( ) const
inline

Returns true if a code was specified.

Member Data Documentation

std::uint16_t boost::beast::websocket::close_reason::code = close_code::none

The close code.

reason_string boost::beast::websocket::close_reason::reason

The optional utf8-encoded reason string.


The documentation for this struct was generated from the following file: