restinio::websocket::basic::impl::expected_data_t Struct Reference

Data with expected size. More...

`#include <ws_parser.hpp>`

## Public Member Functions

| expected_data_t ()=default
| expected_data_t (size_t expected_size)
bool | all_bytes_loaded () const
| Check all bytes are loaded. More...
bool | add_byte_and_check_size (byte_t byte)
| Try to add one more byte to loaded data and check loaded data size. More...
void | reset (size_t expected_size)
| Reset internal state on next expected data size. More...

## Public Attributes

size_t | m_expected_size {0}
| Expected data size in bytes. More...
raw_data_t | m_loaded_data
| Buffer for accumulating data. More...

## Detailed Description

Data with expected size.

Definition at line 165 of file ws_parser.hpp.

## Constructor & Destructor Documentation

## expected_data_t() [1/2]

restinio::websocket::basic::impl::expected_data_t::expected_data_t | ( |  | ) |

default

## expected_data_t() [2/2]

restinio::websocket::basic::impl::expected_data_t::expected_data_t | ( | size_t | expected_size | ) |

inline

Definition at line 169 of file ws_parser.hpp.

## Member Function Documentation

## add_byte_and_check_size()

bool restinio::websocket::basic::impl::expected_data_t::add_byte_and_check_size | ( | byte_t | byte | ) |

inline

Try to add one more byte to loaded data and check loaded data size.

Returns
  true if loaded data size equals expected size.
  false otherwise.

Definition at line 194 of file ws_parser.hpp.

## all_bytes_loaded()

bool restinio::websocket::basic::impl::expected_data_t::all_bytes_loaded | ( |  | ) | const

inline

Check all bytes are loaded.

Definition at line 183 of file ws_parser.hpp.

## reset()

void restinio::websocket::basic::impl::expected_data_t::reset | ( | size_t | expected_size | ) |

inline

Reset internal state on next expected data size.

Definition at line 206 of file ws_parser.hpp.

## Member Data Documentation

## m_expected_size

size_t restinio::websocket::basic::impl::expected_data_t::m_expected_size {0}

Expected data size in bytes.

Definition at line 176 of file ws_parser.hpp.

## m_loaded_data

raw_data_t restinio::websocket::basic::impl::expected_data_t::m_loaded_data

Buffer for accumulating data.

Definition at line 179 of file ws_parser.hpp.

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

- restinio/websocket/impl/ws_parser.hpp