Mbed OS Reference
Loading...
Searching...
No Matches
SimpleMessageParser Class Reference

Basic message parser that aggregates URIParser, TextParser and MimeParser. More...

#include <SimpleMessageParser.h>

Inheritance diagram for SimpleMessageParser:
MessageParser::Delegate

Data Structures

struct  Delegate
 Delegate invoked when the parser raise an event. More...
 

Public Member Functions

 SimpleMessageParser ()
 Construct a new CommonMessageParser. More...
 
void set_delegate (Delegate *delegate)
 Set the handler that processes parsing events. More...
 
void parse (const Span< const uint8_t > &data_buffer)
 Parse an NDEF Message. More...
 
void add_record_parser (RecordParser *parser)
 Insert a new parser in the parser chain. More...
 

Detailed Description

Basic message parser that aggregates URIParser, TextParser and MimeParser.

Custom parsers can be added at runtime as well.

Definition at line 43 of file SimpleMessageParser.h.

Constructor & Destructor Documentation

◆ SimpleMessageParser()

Construct a new CommonMessageParser.

Member Function Documentation

◆ set_delegate()

void set_delegate ( Delegate delegate)

Set the handler that processes parsing events.

Parameters
delegateThe parsing event handler.

◆ parse()

void parse ( const Span< const uint8_t > &  data_buffer)

Parse an NDEF Message.

Records and errors are reported to the handler registered with set_event_handler.

Parameters
data_bufferThe data buffer that contains the NDEF message.

◆ add_record_parser()

void add_record_parser ( RecordParser parser)

Insert a new parser in the parser chain.

Parameters
parserThe parser to add in the parsing chain.