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
RecordURI Class Reference
Record that contains an URI address. More...
#include <RecordURI.h>
Inherits NDefLib::Record.
Inherited by RecordGeo, RecordMail, and RecordSMS.
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 | |
| RecordURI (knowUriId_t URIId, const std::string &URIContent="") | |
| Build RecordUri with a defined URI type. | |
| RecordURI (const std::string &URIType, const std::string &URIContent="") | |
| Build a custom URI type. | |
| virtual RecordType_t | get_type () const |
| Get the record type. | |
| 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 RecordURI * | parse (const RecordHeader &header, const uint8_t *buffer) |
| Load a record URI from a buffer. | |
Detailed Description
Record that contains an URI address.
Definition at line 49 of file RecordURI.h.
Member Enumeration Documentation
| enum knowUriId_t |
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
| RecordURI | ( | knowUriId_t | URIId, |
| const std::string & | URIContent = "" |
||
| ) | [explicit] |
Build RecordUri with a defined URI type.
- Parameters:
-
URIId URI type. URIContent URI content.
- The URI prefix is removed.
- The string is copied inside the class.
Definition at line 63 of file RecordURI.cpp.
| RecordURI | ( | const std::string & | URIType, |
| const std::string & | URIContent = "" |
||
| ) | [explicit] |
Build a custom URI type.
- Parameters:
-
URIType string with the URI type. URIContent URI content.
Definition at line 69 of file RecordURI.cpp.
Member Function Documentation
| virtual uint16_t get_byte_length | ( | ) | [virtual] |
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 | ( | ) |
| const RecordHeader& get_header | ( | ) | const [inherited] |
| virtual RecordType_t get_type | ( | ) | const [virtual] |
Get the record type.
- Returns:
- TYPE_URI
Reimplemented from Record.
Reimplemented in RecordGeo, RecordMail, and RecordSMS.
Definition at line 126 of file RecordURI.h.
| knowUriId_t get_uri_id | ( | ) | const |
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] |
| RecordURI * parse | ( | const RecordHeader & | header, |
| const uint8_t * | buffer | ||
| ) | [static] |
Load a record URI from a buffer.
- Parameters:
-
header Record header. buffer Buffer to read the tag playload from.
- Returns:
- record or NULL if it was not possible build it
- User is in charge of freeing the pointer returned by this function.
Reimplemented in RecordGeo, RecordMail, and RecordSMS.
Definition at line 94 of file RecordURI.cpp.
| void set_as_first_record | ( | ) | [inherited] |
| void set_as_last_record | ( | ) | [inherited] |
| void set_as_middle_record | ( | ) | [inherited] |
| void set_content | ( | const std::string & | URI ) |
| 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
