Mbed OS Reference
Loading...
Searching...
No Matches
URI Class Reference

Model the well known type URI. More...

#include <URI.h>

Public Types

enum  uri_identifier_code_t {
}
 Identifier codes. More...
 

Public Member Functions

 URI ()
 Construct an empty URI object. More...
 
 URI (uri_identifier_code_t id, const Span< const uint8_t > &uri_field)
 Construct a URI from an id and a uri field. More...
 
 URI (const URI &to_copy)
 Construct a URI from another URI. More...
 
 ~URI ()
 Destroy a URI object. More...
 
URIoperator= (const URI &to_copy)
 Replace the content by the one of an existing URI. More...
 
void set_uri (uri_identifier_code_t id, const Span< const uint8_t > &uri_field)
 Replace the value of the URI. More...
 
uri_identifier_code_t get_id () const
 Return the id of the uri. More...
 
Span< const uint8_t > get_uri_field () const
 Return the current value of the uri field. 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 object in a ndef record. More...
 

Detailed Description

Model the well known type URI.

Definition at line 42 of file URI.h.

Member Enumeration Documentation

◆ uri_identifier_code_t

Identifier codes.

Enumerator
HTTP_WWW 

Not applicable.

HTTPS_WWW 

http://www.

HTTP 

https://www.

HTTPS 

http://

TEL 

https://

MAILTO 

tel:

FTP_ANONYMOUS 

mailto:

FTP_FTP 

ftp://anonymous:anonymous@

FTPS 

ftp://ftp.

SFTP 

ftps://

SMB 

sftp://

NFS 

smb://

FTP 

nfs://

DAV 

ftp://

NEWS 

dav://

TELNET 

news:

IMAP 

telnet://

RSTP 

imap:

URN 

rstp://

POP 

urn:

SIP 

pop:

SIPS 

sip:

TFTP 

sips:

BTSPP 

tftp:

BTL2CAP 

btspp://

BTGOEP 

btl2cap://

TCPOBEX 

btgoep://

IRDAOBEX 

tcpobex://

FILE 

irdaobex://

URN_EPC_ID 

file://

URN_EPC_TAG 

urn:epc:id:

URN_EPC_PAT 

urn:epc:tag:

URN_EPC_RAW 

urn:epc:pat:

URN_EPC 

urn:epc:raw:

URN_NFC 

urn:epc:

Definition at line 47 of file URI.h.

Constructor & Destructor Documentation

◆ URI() [1/3]

URI ( )

Construct an empty URI object.

◆ URI() [2/3]

URI ( uri_identifier_code_t  id,
const Span< const uint8_t > &  uri_field 
)

Construct a URI from an id and a uri field.

Parameters
idThe code of the URI prefix.
uri_fieldThe URI itself.
Note
To remove the NULL terminator of the C-string of the uri_field parameter, you can use the utility function span_from_cstr.

◆ URI() [3/3]

URI ( const URI to_copy)

Construct a URI from another URI.

Parameters
to_copyThe uri copied.

◆ ~URI()

~URI ( )

Destroy a URI object.

Member Function Documentation

◆ operator=()

URI & operator= ( const URI to_copy)

Replace the content by the one of an existing URI.

Parameters
to_copyThe URI to copy.
Returns
a reference to this object

◆ set_uri()

void set_uri ( uri_identifier_code_t  id,
const Span< const uint8_t > &  uri_field 
)

Replace the value of the URI.

Parameters
idThe ID of the URI
uri_fieldA buffer containing the value of the URI field.
Note
To remove the NULL terminator of the C-string of the uri_field parameter, you can use the utility function span_from_cstr.

◆ get_id()

uri_identifier_code_t get_id ( ) const

Return the id of the uri.

Returns
The id of the uri.

◆ get_uri_field()

Span< const uint8_t > get_uri_field ( ) const

Return the current value of the uri field.

Returns
The value of the uri field.

◆ append_as_record()

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

Append into a message builder.

◆ get_record_size()

size_t get_record_size ( ) const

Compute the size of this object in a ndef record.

Returns
The size of the ndef record required to store this object.