Definition of the ARIB STD-B24 character set (ISDB Japan).
More...
#include <tsARIBCharset.h>
|
virtual bool | canEncode (const UString &str, size_t start=0, size_t count=NPOS) const override |
| Check if a string can be encoded using the charset (ie all characters can be represented).
|
|
virtual bool | decode (UString &str, const uint8_t *data, size_t size) const override |
| Decode a string from the specified byte buffer.
|
|
UString | decoded (const uint8_t *data, size_t size) const |
| Decode a string from the specified byte buffer and return a UString.
|
|
UString | decodedWithByteLength (const uint8_t *&data, size_t &size) const |
| Decode a string (preceded by its one-byte length) from the specified byte buffer.
|
|
bool | decodeWithByteLength (UString &str, const uint8_t *&data, size_t &size) const |
| Decode a string (preceded by its one-byte length) from the specified byte buffer.
|
|
virtual size_t | encode (uint8_t *&buffer, size_t &size, const UString &str, size_t start=0, size_t count=NPOS) const override |
| Encode a C++ Unicode string.
|
|
ByteBlock | encoded (const UString &str, size_t start=0, size_t count=NPOS) const |
| Encode a C++ Unicode string as a ByteBlock.
|
|
ByteBlock | encodedWithByteLength (const UString &str, size_t start=0, size_t count=NPOS) const |
| Encode a C++ Unicode string as a ByteBlock (preceded by its one-byte length).
|
|
size_t | encodeWithByteLength (uint8_t *&buffer, size_t &size, const UString &str, size_t start=0, size_t count=NPOS) const |
| Encode a C++ Unicode string preceded by its one-byte length.
|
|
UString | name () const |
| Get the character set name.
|
|
virtual void | unregister () const |
| Unregister the character set from the repository of character sets.
|
|
|
static const ARIBCharset | B24 |
| Only one predefined character set for ARIB STD-B24.
|
|
Definition of the ARIB STD-B24 character set (ISDB Japan).
Limitations:
- The decoding operation produces a Unicode string (UString). All non-Unicode concepts in ARIB STD-B24 are dropped (colors, placemenent, Mosaic and DRCS character sets).
- User-defined macros are ignored, only predefined macros are decoded.
- The encoding operation is character-based and not optimized. The resulting data could be shorter with a prior global analysis of the input string.
- See also
- ARIB STD-B24, chapter 7
-
ARIB STD-B62, fascicle 1, part 2, chapter 5
-
ISO/IEC 2022
-
https://en.wikipedia.org/wiki/ARIB_STD_B24_character_set
-
https://en.wikipedia.org/wiki/ISO/IEC_2022
◆ decode()
virtual bool ts::ARIBCharset::decode |
( |
UString & |
str, |
|
|
const uint8_t * |
data, |
|
|
size_t |
size |
|
) |
| const |
|
overridevirtual |
Decode a string from the specified byte buffer.
- Parameters
-
[out] | str | Returned decoded string. |
[in] | data | Address of an encoded string. |
[in] | size | Size in bytes of the encoded string. |
- Returns
- True on success, false on error (truncated, unsupported format, etc.)
Implements ts::Charset.
◆ canEncode()
virtual bool ts::ARIBCharset::canEncode |
( |
const UString & |
str, |
|
|
size_t |
start = 0 , |
|
|
size_t |
count = NPOS |
|
) |
| const |
|
overridevirtual |
Check if a string can be encoded using the charset (ie all characters can be represented).
- Parameters
-
[in] | str | The string to encode. |
[in] | start | Starting offset in str. |
[in] | count | Maximum number of characters to encode. |
- Returns
- True if all characters can be encoded.
Implements ts::Charset.
◆ encode()
virtual size_t ts::ARIBCharset::encode |
( |
uint8_t *& |
buffer, |
|
|
size_t & |
size, |
|
|
const UString & |
str, |
|
|
size_t |
start = 0 , |
|
|
size_t |
count = NPOS |
|
) |
| const |
|
overridevirtual |
Encode a C++ Unicode string.
Unrepresentable characters are skipped. Stop either when the specified number of characters are serialized or when the buffer is full, whichever comes first.
- Parameters
-
[in,out] | buffer | Address of the buffer. The address is updated to point after the encoded value. |
[in,out] | size | Size of the buffer. Updated to remaining size. |
[in] | str | The string to encode. |
[in] | start | Starting offset in str. |
[in] | count | Maximum number of characters to encode. |
- Returns
- The number of serialized characters (which is usually not the same as the number of written bytes).
Implements ts::Charset.
◆ name()
UString ts::Charset::name |
( |
| ) |
const |
|
inlineinherited |
Get the character set name.
- Returns
- The name.
◆ GetCharset()
static const Charset * ts::Charset::GetCharset |
( |
const UString & |
name | ) |
|
|
staticinherited |
Get a character set by name.
- Parameters
-
[in] | name | Name of the requested character set. |
- Returns
- Address of the character set or zero if not found.
◆ GetAllNames()
Find all registered character set names.
- Returns
- List of all registered names.
◆ decoded()
UString ts::Charset::decoded |
( |
const uint8_t * |
data, |
|
|
size_t |
size |
|
) |
| const |
|
inherited |
Decode a string from the specified byte buffer and return a UString.
Errors (truncation, unsupported format, etc) are ignored.
- Parameters
-
[in] | data | Address of an encoded string. |
[in] | size | Size in bytes of the encoded string. |
- Returns
- The decoded string.
◆ decodeWithByteLength()
bool ts::Charset::decodeWithByteLength |
( |
UString & |
str, |
|
|
const uint8_t *& |
data, |
|
|
size_t & |
size |
|
) |
| const |
|
inherited |
Decode a string (preceded by its one-byte length) from the specified byte buffer.
- Parameters
-
[out] | str | Returned decoded string. |
[in,out] | data | Address of an encoded string. The address is updated to point after the decoded value. |
[in,out] | size | Size of the buffer. Updated to remaining size. |
- Returns
- True on success, false on error (truncated, unsupported format, etc.)
◆ decodedWithByteLength()
UString ts::Charset::decodedWithByteLength |
( |
const uint8_t *& |
data, |
|
|
size_t & |
size |
|
) |
| const |
|
inherited |
Decode a string (preceded by its one-byte length) from the specified byte buffer.
Errors (truncation, unsupported format, etc) are ignored.
- Parameters
-
[in,out] | data | Address of an encoded string. The address is updated to point after the decoded value. |
[in,out] | size | Size of the buffer. Updated to remaining size. |
- Returns
- The decoded string.
◆ encodeWithByteLength()
size_t ts::Charset::encodeWithByteLength |
( |
uint8_t *& |
buffer, |
|
|
size_t & |
size, |
|
|
const UString & |
str, |
|
|
size_t |
start = 0 , |
|
|
size_t |
count = NPOS |
|
) |
| const |
|
inherited |
Encode a C++ Unicode string preceded by its one-byte length.
Unrepresentable characters are skipped. Stop either when the specified number of characters are serialized or when the buffer is full, whichever comes first.
- Parameters
-
[in,out] | buffer | Address of the buffer. The address is updated to point after the encoded value. |
[in,out] | size | Size of the buffer. Updated to remaining size. |
[in] | str | The string to encode. |
[in] | start | Starting offset in str. |
[in] | count | Maximum number of characters to encode. |
- Returns
- The number of serialized characters (which is usually not the same as the number of written bytes).
◆ encoded()
Encode a C++ Unicode string as a ByteBlock.
Unrepresentable characters are skipped.
- Parameters
-
[in] | str | The string to encode. |
[in] | start | Starting offset in str. |
[in] | count | Maximum number of characters to encode. |
- Returns
- A ByteBlock containing the encoded string.
◆ encodedWithByteLength()
ByteBlock ts::Charset::encodedWithByteLength |
( |
const UString & |
str, |
|
|
size_t |
start = 0 , |
|
|
size_t |
count = NPOS |
|
) |
| const |
|
inherited |
Encode a C++ Unicode string as a ByteBlock (preceded by its one-byte length).
Unrepresentable characters are skipped.
- Parameters
-
[in] | str | The string to encode. |
[in] | start | Starting offset in str. |
[in] | count | Maximum number of characters to encode. |
- Returns
- A ByteBlock containing the encoded string.
◆ unregister()
virtual void ts::Charset::unregister |
( |
| ) |
const |
|
virtualinherited |
Unregister the character set from the repository of character sets.
This is done automatically when the object is destructed. Can be called earlier to make sure a character set is no longer referenced.
Reimplemented in ts::DVBCharTable.
The documentation for this class was generated from the following file: