Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: NFC M2M_2016_STM32 MyongjiElec_capstone1 IDW01M1_Cloud_IBM ... more
Fork of NDefLib by
RecordMail Class Reference
Class that specializes the RecordUri to store a mail content. More...
#include <RecordMail.h>
Inherits NDefLib::RecordURI.
Public Types | |
| enum | knowUriId_t { UNKNOWN = 0X00, HTTP_WWW = 0X01, HTTPS_WWW = 0X02, HTTP = 0X03, HTTPS = 0X04, TEL = 0x05, MAIL = 0X06, FTP_ANONIMUS = 0X07, FTP_FTP = 0X08, FTPS = 0X09, SFTP = 0X0A, SMB = 0X0B, NFS = 0X0C, FTP = 0X0d, DAV = 0X0E, NEWS = 0X0F, TELNET = 0X10, IMAP = 0X11, RTSP = 0X12, URN = 0X13, POP = 0X14, SIP = 0X15, SIPS = 0X016, TFTP = 0X017, BTSPP = 0x018, BTL2CAP = 0x019, BTGOEP = 0X01A, TCPOBEX = 0X1B, IRDAOBEX = 0X1C, FILE = 0X1D, URN_EPC_ID = 0X1E, URN_EPC_TAG = 0X1F, URN_EPC_PAT = 0X20, URN_EPC_RAW = 0X21, URN_EPC = 0X22, URN_NFC = 0X23 } |
If you want encode an know URI you can use this define to avoid to encode the URI type as string. More... | |
| enum | RecordType_t { TYPE_UNKNOWN, TYPE_TEXT, TYPE_AAR, TYPE_MIME, TYPE_URI, TYPE_URI_MAIL, TYPE_URI_SMS, TYPE_URI_GEOLOCATION, TYPE_MIME_VCARD, TYPE_WIFI_CONF } |
Enum used to identify the record type. More... | |
Public Member Functions | |
| RecordMail (const std::string &toAddress, const std::string &subject, const std::string &msg) | |
| Create a mail. | |
| const std::string & | get_to_address () const |
| const std::string & | get_subject () const |
| const std::string & | get_body () const |
| void | set_to_address (const std::string &dest) |
| Change the mail recipient. | |
| void | set_subject (const std::string &subj) |
| Change the mail subject. | |
| void | set_body (const std::string &body) |
| Change the mail body. | |
| virtual RecordType_t | get_type () const |
| Get the record type. | |
| bool | operator== (const RecordMail &other) const |
| Compare 2 RecordMails. | |
| knowUriId_t | get_uri_id () const |
| Returns the URI type. | |
| virtual uint16_t | get_byte_length () |
| Number of bytes needed to store this record. | |
| std::string & | get_content () |
| Returns the URI content. | |
| void | set_content (const std::string &URI) |
| Change the URI content. | |
| void | set_as_first_record () |
| Set the record as the first record in the message. | |
| void | set_as_last_record () |
| Set the record as the last record in the message. | |
| bool | is_last_record () const |
| Check if it is the last record in the message. | |
| bool | is_first_record () const |
| Check if it is the first record in the message. | |
| void | set_as_middle_record () |
| Set the record as generic (not the first one and not the last one) | |
| bool | is_middle_record () const |
| Check if the record is in the middle of a chain. | |
| const RecordHeader & | get_header () const |
| Get the record header. | |
| virtual uint16_t | write (uint8_t *buffer)=0 |
| Write the record content into a buffer. | |
Static Public Member Functions | |
| static RecordMail * | parse (const RecordHeader &header, const uint8_t *buffer) |
| Create a RecordMail reading the data from the buffer. | |
Protected Member Functions | |
| virtual void | update_content () |
| Generate the uri content that encodes the mail content. | |
Detailed Description
Class that specializes the RecordUri to store a mail content.
Definition at line 47 of file RecordMail.h.
Member Enumeration Documentation
enum knowUriId_t [inherited] |
If you want encode an know URI you can use this define to avoid to encode the URI type as string.
- Enumerator:
Definition at line 67 of file RecordURI.h.
enum RecordType_t [inherited] |
Enum used to identify the record type.
- Enumerator:
Constructor & Destructor Documentation
| RecordMail | ( | const std::string & | toAddress, |
| const std::string & | subject, | ||
| const std::string & | msg | ||
| ) |
Create a mail.
- Parameters:
-
toAddress Mail recipient. subject Mail subject. msg Message.
Definition at line 67 of file RecordMail.h.
Member Function Documentation
| const std::string& get_body | ( | ) | const |
- Returns:
- the mail body
Definition at line 91 of file RecordMail.h.
| virtual uint16_t get_byte_length | ( | ) | [virtual, inherited] |
Number of bytes needed to store this record.
- Returns:
- size of the header + size of the record content
Reimplemented from Record.
Definition at line 138 of file RecordURI.h.
| std::string& get_content | ( | ) | [inherited] |
| const RecordHeader& get_header | ( | ) | const [inherited] |
| const std::string& get_subject | ( | ) | const |
- Returns:
- the mail subject
Definition at line 84 of file RecordMail.h.
| const std::string& get_to_address | ( | ) | const |
- Returns:
- the mail recipient address
Definition at line 77 of file RecordMail.h.
| virtual RecordType_t get_type | ( | ) | const [virtual] |
Get the record type.
- Returns:
- TYPE_URI_MAIL
Reimplemented from RecordURI.
Definition at line 129 of file RecordMail.h.
| knowUriId_t get_uri_id | ( | ) | const [inherited] |
Returns the URI type.
- Returns:
- URI type inside this record, UNKNOWN if unknown
Definition at line 134 of file RecordURI.h.
| bool is_first_record | ( | ) | const [inherited] |
| bool is_last_record | ( | ) | const [inherited] |
| bool is_middle_record | ( | ) | const [inherited] |
| bool operator== | ( | const RecordMail & | other ) | const |
Compare 2 RecordMails.
Â
- Returns:
- true if both the tags have the same addresses,subjects and bodies
Definition at line 137 of file RecordMail.h.
| RecordMail * parse | ( | const RecordHeader & | header, |
| const uint8_t * | buffer | ||
| ) | [static] |
Create a RecordMail reading the data from the buffer.
- Parameters:
-
header Record header. buffer Buffer to read the data from.
- Returns:
- an object of type RecordMail or NULL
- User is in charge of freeing the pointer returned by this function.
Reimplemented from RecordURI.
Definition at line 59 of file RecordMail.cpp.
| void set_as_first_record | ( | ) | [inherited] |
| void set_as_last_record | ( | ) | [inherited] |
| void set_as_middle_record | ( | ) | [inherited] |
| void set_body | ( | const std::string & | body ) |
Change the mail body.
- Parameters:
-
body New mail body.
- The string is copied inside the class.
Definition at line 120 of file RecordMail.h.
| void set_content | ( | const std::string & | URI ) | [inherited] |
| void set_subject | ( | const std::string & | subj ) |
Change the mail subject.
- Parameters:
-
subj New mail subject.
- The string is copied inside the class.
Definition at line 110 of file RecordMail.h.
| void set_to_address | ( | const std::string & | dest ) |
Change the mail recipient.
- Parameters:
-
dest Recipient address.
- The string is copied inside the class.
Definition at line 100 of file RecordMail.h.
| void update_content | ( | ) | [protected, virtual] |
Generate the uri content that encodes the mail content.
- See also:
- RecordUri::updateContent
Definition at line 44 of file RecordMail.cpp.
| virtual uint16_t write | ( | uint8_t * | buffer ) | [pure virtual, inherited] |
Write the record content into a buffer.
- Parameters:
-
[out] buffer buffer to write the record content into, the buffer size must be almost Record#getByteLength bytes.
- Returns:
- number of written bytes
Implemented in EmptyRecord, RecordAAR, RecordMimeType, RecordText, RecordVCard, and RecordWifiConf.
Generated on Tue Jul 12 2022 14:14:49 by
1.7.2
