R-Type 0.1
Loading...
Searching...
No Matches
MessageParser Class Reference

Splits the body of a connected packet into messages. More...

#include <protocol/MessageParser.hpp>

Static Public Member Functions

static bool parse (PacketReader &reader, std::vector< ParsedMessage > &messages)
 Parses every message until the end of the reader.
 

Detailed Description

Splits the body of a connected packet into messages.

Member Function Documentation

◆ parse()

bool MessageParser::parse ( PacketReader & reader,
std::vector< ParsedMessage > & messages )
static

Parses every message until the end of the reader.

Parameters
readerBuffer positioned right after the packet header.
messagesReceives the messages, left untouched on failure.
Returns
True if the whole body was valid, false otherwise.