18#ifndef NFC_COMMON_SIMPLEMESSAGEPARSER_H_
19#define NFC_COMMON_SIMPLEMESSAGEPARSER_H_
21#include "platform/Span.h"
23#include "nfc/ndef/MessageParser.h"
24#include "nfc/ndef/RecordParser.h"
25#include "nfc/ndef/common/URI.h"
26#include "nfc/ndef/common/Text.h"
27#include "nfc/ndef/common/Mime.h"
47 MimeParser::Delegate {
136 virtual void on_parsing_started();
138 virtual void on_record_parsed(
const Record &record);
140 virtual void on_parsing_terminated();
145 virtual void on_record_parsed(
const URI &uri,
const RecordID &
id);
150 virtual void on_record_parsed(
const Text &text,
const RecordID &
id);
155 virtual void on_record_parsed(
const Mime &mime,
const RecordID &
id);
Event driven NDEF Message parser.
error_t
Error that can be reported by the parsing operation.
Basic message parser that aggregates URIParser, TextParser and MimeParser.
SimpleMessageParser()
Construct a new CommonMessageParser.
void add_record_parser(RecordParser *parser)
Insert a new parser in the parser chain.
void parse(const Span< const uint8_t > &data_buffer)
Parse an NDEF Message.
void set_delegate(Delegate *delegate)
Set the handler that processes parsing events.
Represent the well known type text.
Model the well known type URI.
Report parsing event to the application.
Delegate invoked when the parser raise an event.
virtual void on_uri_parsed(const URI &uri, const RecordID &id)
Invoked when a text element has been parsed.
virtual void on_unknown_record_parsed(const Record &record)
Invoked when an unknown record has been parsed.
virtual void on_parsing_terminated()
Invoked when parsing is over.
virtual void on_mime_parsed(const Mime &mime, const RecordID &id)
Invoked when a mime element has been parsed.
virtual void on_parsing_error(MessageParser::error_t error)
Invoked when an error is present in the message.
virtual void on_parsing_started()
Invoked when parsing as started.
virtual void on_text_parsed(const Text &text, const RecordID &id)
Invoked when a text element has been parsed.