18#ifndef NFC_COMMON_MIME_H_
19#define NFC_COMMON_MIME_H_
23#include "platform/Span.h"
25#include "nfc/ndef/RecordParser.h"
26#include "nfc/ndef/MessageBuilder.h"
113 bool is_last_record =
false
127 uint8_t *mime_record,
128 size_t mime_type_size,
129 size_t mime_content_size
132 size_t mime_size()
const;
136 size_t _content_size;
144 bool do_parse(
const Record &record,
Mime &mime);
Construct a NDEF Message.
Mime(const Span< const uint8_t > &mime_type, const Span< const uint8_t > &content)
Construct a mime object from its type and content.
Mime()
Construct an empty Mime object.
~Mime()
Destroy a Mime object.
Mime & operator=(const Mime &other)
Copy assign a Mime object.
Mime(const Mime &other)
Copy construct a Mime object.
size_t get_record_size() const
Compute the size of this Mime object in a ndef record.
Span< const uint8_t > get_mime_type() const
Return the mime type.
Span< const uint8_t > get_mime_content() const
Return the content of the mime object.
void set_mime(const Span< const uint8_t > &mime_type, const Span< const uint8_t > &content)
Set all attributes of a mime object.
bool append_as_record(MessageBuilder &message_builder, bool is_last_record=false) const
Append into a message builder.
Nonowning view to a sequence of contiguous elements.