Mistake on this page?
Report an issue in GitHub or email us
Public Types | Public Member Functions | Friends
URI Class Reference

Model the well known type URI. More...

#include <URI.h>

Public Types

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...
 

Friends

bool operator== (const URI &lhs, const URI &rhs)
 Equal operator between two URIs. More...
 

Detailed Description

Model the well known type URI.

Definition at line 41 of file URI.h.

Member Enumeration Documentation

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 46 of file URI.h.

Constructor & Destructor Documentation

URI ( )

Construct an empty URI object.

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 ( const URI to_copy)

Construct a URI from another URI.

Parameters
to_copyThe uri copied.
~URI ( )

Destroy a URI object.

Member Function Documentation

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

Append into a message builder.

uri_identifier_code_t get_id ( ) const

Return the id of the uri.

Returns
The id of the uri.
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.
Span<const uint8_t> get_uri_field ( ) const

Return the current value of the uri field.

Returns
The value of the uri field.
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
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.

Friends And Related Function Documentation

bool operator== ( const URI lhs,
const URI rhs 
)
friend

Equal operator between two URIs.

Parameters
lhsThe URI on the left hand side
rhsThe URI on the right hand side
Returns
true if lhs equals rhs or false.

Definition at line 166 of file URI.h.

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.