![]() |
TSDuck v3.41-4217
MPEG Transport Stream Toolkit
|
Definition of a DVB character set using a single byte per character. More...
#include <tsDVBCharTableSingleByte.h>
Public Member Functions | |
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 *dvb, size_t dvbSize) 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). | |
virtual size_t | encodeTableCode (uint8_t *&buffer, size_t &size) const |
Encode the character set table code. | |
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. | |
uint32_t | tableCode () const |
Get the DVB table code for the character set. | |
virtual void | unregister () const override |
Unregister the character set from the repository of character sets. | |
Static Public Member Functions | |
static bool | DecodeTableCode (uint32_t &code, size_t &codeSize, const uint8_t *dvb, size_t dvbSize) |
This static function gets the character coding table at the beginning of a DVB string. | |
static UStringList | GetAllNames () |
Find all registered character set names. | |
static const Charset * | GetCharset (const UString &name) |
Get a character set by name. | |
static const DVBCharTable * | GetTableFromLeadingCode (uint32_t code) |
Get a DVB character set by table code. | |
Static Public Attributes | |
static constexpr uint16_t | DVB_CODEPOINT_CRLF = 0xE08A |
Code point for DVB-encoded CR/LF in two-byte character sets. | |
static const DVBCharset | DVB_ISO_6937 |
Standard DVB encoding using modified ISO 6937 character set as default. | |
static const DVBCharset | DVB_ISO_8859_1 |
Non-standard DVB encoding using 8859-1 character set as default. | |
static const DVBCharset | DVB_ISO_8859_10 |
Non-standard DVB encoding using ISO 8859-10 character set as default. | |
static const DVBCharset | DVB_ISO_8859_11 |
Non-standard DVB encoding using ISO 8859-11 character set as default. | |
static const DVBCharset | DVB_ISO_8859_13 |
Non-standard DVB encoding using ISO 8859-13 character set as default. | |
static const DVBCharset | DVB_ISO_8859_14 |
Non-standard DVB encoding using ISO 8859-14 character set as default. | |
static const DVBCharset | DVB_ISO_8859_15 |
Non-standard DVB encoding using ISO 8859-15 character set as default. | |
static const DVBCharset | DVB_ISO_8859_2 |
Non-standard DVB encoding using ISO 8859-2 character set as default. | |
static const DVBCharset | DVB_ISO_8859_3 |
Non-standard DVB encoding using ISO 8859-3 character set as default. | |
static const DVBCharset | DVB_ISO_8859_4 |
Non-standard DVB encoding using ISO 8859-4 character set as default. | |
static const DVBCharset | DVB_ISO_8859_5 |
Non-standard DVB encoding using ISO 8859-5 character set as default. | |
static const DVBCharset | DVB_ISO_8859_6 |
Non-standard DVB encoding using ISO 8859-6 character set as default. | |
static const DVBCharset | DVB_ISO_8859_7 |
Non-standard DVB encoding using ISO 8859-7 character set as default. | |
static const DVBCharset | DVB_ISO_8859_8 |
Non-standard DVB encoding using ISO 8859-8 character set as default. | |
static const DVBCharset | DVB_ISO_8859_9 |
Non-standard DVB encoding using ISO 8859-9 character set as default. | |
static constexpr uint8_t | DVB_SINGLE_BYTE_CRLF = 0x8A |
DVB-encoded CR/LF in single-byte character sets. | |
static const DVBCharTableSingleByte | RAW_ISO_6937 |
Raw modified ISO 6937, DVB default character table. | |
static const DVBCharTableSingleByte | RAW_ISO_8859_1 |
Raw ISO 8859-1 character set. | |
static const DVBCharTableSingleByte | RAW_ISO_8859_10 |
Raw ISO 8859-10 character set. | |
static const DVBCharTableSingleByte | RAW_ISO_8859_11 |
Raw ISO 8859-11 character set. | |
static const DVBCharTableSingleByte | RAW_ISO_8859_13 |
Raw ISO 8859-13 character set. | |
static const DVBCharTableSingleByte | RAW_ISO_8859_14 |
Raw ISO 8859-14 character set. | |
static const DVBCharTableSingleByte | RAW_ISO_8859_15 |
Raw ISO 8859-15 character set. | |
static const DVBCharTableSingleByte | RAW_ISO_8859_2 |
Raw ISO 8859-2 character set. | |
static const DVBCharTableSingleByte | RAW_ISO_8859_3 |
Raw ISO 8859-3 character set. | |
static const DVBCharTableSingleByte | RAW_ISO_8859_4 |
Raw ISO 8859-4 character set. | |
static const DVBCharTableSingleByte | RAW_ISO_8859_5 |
Raw ISO 8859-5 character set. | |
static const DVBCharTableSingleByte | RAW_ISO_8859_6 |
Raw ISO 8859-6 character set. | |
static const DVBCharTableSingleByte | RAW_ISO_8859_7 |
Raw ISO 8859-7 character set. | |
static const DVBCharTableSingleByte | RAW_ISO_8859_8 |
Raw ISO 8859-8 character set. | |
static const DVBCharTableSingleByte | RAW_ISO_8859_9 |
Raw ISO 8859-9 character set. | |
Definition of a DVB character set using a single byte per character.
All these character sets share the following properties:
|
overridevirtual |
Decode a string from the specified byte buffer.
[out] | str | Returned decoded string. |
[in] | data | Address of an encoded string. |
[in] | size | Size in bytes of the encoded string. |
Implements ts::Charset.
|
overridevirtual |
Check if a string can be encoded using the charset (ie all characters can be represented).
[in] | str | The string to encode. |
[in] | start | Starting offset in str. |
[in] | count | Maximum number of characters to encode. |
Implements ts::Charset.
|
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.
[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. |
Implements ts::Charset.
|
staticinherited |
This static function gets the character coding table at the beginning of a DVB string.
The character coding table is encoded on up to 3 bytes at the beginning of a DVB string. The following encodings are recognized, based on the first byte of the DVB string:
[out] | code | Returned character coding table value. Zero when no code is present (use the default character table). 0xFFFFFFFF in case of invalid data. |
[out] | codeSize | Size in bytes of character coding table in dvb. |
[in] | dvb | Address of a DVB string. |
[in] | dvbSize | Size in bytes of the DVB string. |
|
inlineinherited |
Get the DVB table code for the character set.
|
staticinherited |
Get a DVB character set by table code.
[in] | code | Table code of the requested character set. |
|
virtualinherited |
Encode the character set table code.
Stop either when the specified number of characters are serialized or when the buffer is full, whichever comes first.
[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. |
|
overridevirtualinherited |
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 from ts::Charset.
|
inlineinherited |
Get the character set name.
Get a character set by name.
[in] | name | Name of the requested character set. |
|
staticinherited |
Find all registered character set names.
|
inherited |
Decode a string from the specified byte buffer and return a UString.
Errors (truncation, unsupported format, etc) are ignored.
[in] | data | Address of an encoded string. |
[in] | size | Size in bytes of the encoded string. |
|
inherited |
Decode a string (preceded by its one-byte length) from the specified byte buffer.
[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. |
|
inherited |
Decode a string (preceded by its one-byte length) from the specified byte buffer.
Errors (truncation, unsupported format, etc) are ignored.
[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. |
|
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.
[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. |