Mistake on this page?
Report an issue in GitHub or email us
Public Member Functions
Mime Class Reference

Represent a mime object. More...

#include <Mime.h>

Public Member Functions

 Mime ()
 Construct an empty Mime object. More...
 
 Mime (const Span< const uint8_t > &mime_type, const Span< const uint8_t > &content)
 Construct a mime object from its type and content. More...
 
 Mime (const Mime &other)
 Copy construct a Mime object. More...
 
 ~Mime ()
 Destroy a Mime object. More...
 
Mimeoperator= (const Mime &other)
 Copy assign a Mime object. More...
 
void set_mime (const Span< const uint8_t > &mime_type, const Span< const uint8_t > &content)
 Set all attributes of a mime object. More...
 
Span< const uint8_t > get_mime_type () const
 Return the mime type. More...
 
Span< const uint8_t > get_mime_content () const
 Return the content of the mime object. More...
 
bool append_as_record (MessageBuilder &message_builder, bool is_last_record=false) const
 Append into a message builder. More...
 
size_t get_record_size () const
 Compute the size of this Mime object in a ndef record. More...
 

Detailed Description

Represent a mime object.

Definition at line 41 of file Mime.h.

Constructor & Destructor Documentation

Mime ( )

Construct an empty Mime object.

Mime ( const Span< const uint8_t > &  mime_type,
const Span< const uint8_t > &  content 
)

Construct a mime object from its type and content.

Parameters
mime_typeThe mime type of the object.
contentThe content of the object.
Note
To remove the NULL terminator of the C-string of the mime_type parameter, you can use the utility function span_from_cstr.
Mime ( const Mime other)

Copy construct a Mime object.

Parameters
otherThe Mime object copied.
~Mime ( )

Destroy a Mime object.

Member Function Documentation

bool append_as_record ( MessageBuilder message_builder,
bool  is_last_record = false 
) const

Append into a message builder.

Span<const uint8_t> get_mime_content ( ) const

Return the content of the mime object.

Returns
the content of the mime object.
Span<const uint8_t> get_mime_type ( ) const

Return the mime type.

Returns
The mime type.
size_t get_record_size ( ) const

Compute the size of this Mime object in a ndef record.

Returns
The size of the ndef record required to store this object.
Mime& operator= ( const Mime other)

Copy assign a Mime object.

Parameters
otherThe Mime object to copy.
Returns
a reference to this object
void set_mime ( const Span< const uint8_t > &  mime_type,
const Span< const uint8_t > &  content 
)

Set all attributes of a mime object.

Parameters
mime_typeType of the mime object.
contentContent of the mime object.
Note
To remove the NULL terminator of the C-string of the mime_type parameter, you can use the utility function span_from_cstr.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.