18#ifndef NFC_COMMON_URI_H_
19#define NFC_COMMON_URI_H_
24#include "platform/Span.h"
26#include "nfc/ndef/RecordParser.h"
27#include "nfc/ndef/MessageBuilder.h"
151 bool is_last_record =
false
169 if (lhs._uri_size != rhs._uri_size) {
173 return memcmp(lhs._uri, rhs._uri, lhs._uri_size) == 0;
176 friend bool operator!=(
const URI &lhs,
const URI &rhs)
178 return !(lhs == rhs);
182 friend class URIParser;
184 void move_data(uint8_t *text,
size_t size);
195 bool do_parse(
const Record &record,
URI &uri);
Construct a NDEF Message.
Model the well known type URI.
URI(const URI &to_copy)
Construct a URI from another URI.
Span< const uint8_t > get_uri_field() const
Return the current value of the uri field.
friend bool operator==(const URI &lhs, const URI &rhs)
Equal operator between two URIs.
URI()
Construct an empty URI object.
~URI()
Destroy a URI object.
size_t get_record_size() const
Compute the size of this object in a ndef record.
void set_uri(uri_identifier_code_t id, const Span< const uint8_t > &uri_field)
Replace the value of the URI.
URI & operator=(const URI &to_copy)
Replace the content by the one of an existing URI.
URI(uri_identifier_code_t id, const Span< const uint8_t > &uri_field)
Construct a URI from an id and a uri field.
uri_identifier_code_t get_id() const
Return the id of the uri.
bool append_as_record(MessageBuilder &message_builder, bool is_last_record=false) const
Append into a message builder.
uri_identifier_code_t
Identifier codes.
@ URN_EPC_RAW
urn:epc:pat:
@ FTP_FTP
ftp://anonymous:anonymous@
@ URN_EPC_PAT
urn:epc:tag:
@ HTTP_WWW
Not applicable.
Nonowning view to a sequence of contiguous elements.