Represent the well known type text.
More...
#include <Text.h>
|
| Text () |
| Construct an empty text element.
|
|
| Text (encoding_t text_encoding, const Span< const uint8_t > &language_code, const Span< const uint8_t > &text) |
| Construct a text element from a data buffer and an encoding.
|
|
| Text (const Text &to_copy) |
| Copy construct a text element.
|
|
| ~Text () |
| Destroy a text element.
|
|
Text & | operator= (const Text &to_copy) |
| Copy assignment of another text element.
|
|
void | set_text (encoding_t text_encoding, const Span< const uint8_t > &language_code, const Span< const uint8_t > &text) |
| Copy a text from an external buffer.
|
|
encoding_t | get_encoding () const |
| Get the encoding of the text.
|
|
Span< const uint8_t > | get_language_code () const |
| Return the language code.
|
|
Span< const uint8_t > | get_text () const |
| Return the text contained in this object.
|
|
bool | append_as_record (MessageBuilder &message_builder, bool is_last_record=false) const |
| Append into a message builder.
|
|
size_t | get_record_size () const |
| Compute the size of this object in a ndef record.
|
|
Represent the well known type text.
Definition at line 41 of file Text.h.
◆ encoding_t
Encoding of the text.
Enumerator |
---|
UTF8 | UTF8.
|
UTF16 | UTF16.
|
Definition at line 46 of file Text.h.
◆ Text() [1/3]
Construct an empty text element.
◆ Text() [2/3]
Text |
( |
encoding_t |
text_encoding, |
|
|
const Span< const uint8_t > & |
language_code, |
|
|
const Span< const uint8_t > & |
text |
|
) |
| |
Construct a text element from a data buffer and an encoding.
- Parameters
-
text_encoding | The encoding of the text. |
language_code | The string of the language code. |
text | The text buffer. |
- Note
- To remove the NULL terminator of the C-string of the language_code and text parameters, you can use the utility function span_from_cstr.
◆ Text() [3/3]
Copy construct a text element.
- Parameters
-
◆ ~Text()
◆ operator=()
Text & operator= |
( |
const Text & |
to_copy | ) |
|
Copy assignment of another text element.
- Parameters
-
to_copy | The Text instance to copy |
- Returns
- a reference to this object.
◆ set_text()
void set_text |
( |
encoding_t |
text_encoding, |
|
|
const Span< const uint8_t > & |
language_code, |
|
|
const Span< const uint8_t > & |
text |
|
) |
| |
Copy a text from an external buffer.
- Parameters
-
text_encoding | The encoding of the text. |
language_code | The language code of the text. |
text | The text to copy. |
- Note
- To remove the NULL terminator of the C-string of the language_code and text parameters, you can use the utility function span_from_cstr.
◆ get_encoding()
Get the encoding of the text.
- Returns
- The encoding of the text.
◆ get_language_code()
Span< const uint8_t > get_language_code |
( |
| ) |
const |
Return the language code.
- Returns
- The language code.
◆ get_text()
Span< const uint8_t > get_text |
( |
| ) |
const |
Return the text contained in this object.
- Returns
- The text contained in this object.
◆ 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.