![]() |
TSDuck v3.46-4965
MPEG Transport Stream Toolkit
|
#include <tsDVBCharset.h>


Public Member Functions | |
| DVBCharset (const UChar *name, const DVBCharTable &default_table) | |
| DVBCharset (std::initializer_list< const UChar * > names, const DVBCharTable &default_table) | |
| virtual bool | canEncode (const UString &str, size_t start=0, size_t count=NPOS) const override |
| virtual bool | decode (UString &str, const uint8_t *data, size_t size) const override |
| UString | decoded (const uint8_t *data, size_t size) const |
| UString | decodedWithByteLength (const uint8_t *&data, size_t &size) const |
| bool | decodeWithByteLength (UString &str, const uint8_t *&data, size_t &size) const |
| virtual size_t | encode (uint8_t *&buffer, size_t &size, const UString &str, size_t start=0, size_t count=NPOS) const override |
| ByteBlock | encoded (const UString &str, size_t start=0, size_t count=NPOS) const |
| ByteBlock | encodedWithByteLength (const UString &str, size_t start=0, size_t count=NPOS) const |
| size_t | encodeWithByteLength (uint8_t *&buffer, size_t &size, const UString &str, size_t start=0, size_t count=NPOS) const |
| UString | name () const |
| virtual void | unregister () const |
Static Public Member Functions | |
| static UStringList | GetAllNames () |
| static const Charset * | GetCharset (const UString &name) |
| static const std::vector< const DVBCharTable * > & | GetPreferredCharsets () |
Static Public Attributes | |
| static const DVBCharset | DVB |
Definition of the generic DVB character sets.
An instance of this class encodes and decodes DVB strings. DVB strings can use various DVB character tables. Each DVB string is is encoded using one single DVB character table. Which table is used is indicated by an optional "table code" at the beginning of the string.
According to DVB standard ETSI EN 300 468, the default DVB character table (without leading table code) is ISO-6937. However, some bogus signalization may assume that the default character table is different, typically the usual local character table for the region.
There are several static instances of DVBCharset. The one named DVB is the standard one. It can use any DVB character tables and uses ISO-6937 by default. All other instances are identical, except that they use another character table by default.
| ts::DVBCharset::DVBCharset | ( | const UChar * | name, |
| const DVBCharTable & | default_table ) |
Constructor.
| [in] | name | Character set name. |
| [in] | default_table | Default character table to use without leading "table code". |
| ts::DVBCharset::DVBCharset | ( | std::initializer_list< const UChar * > | names, |
| const DVBCharTable & | default_table ) |
Constructor, registering the character set under any number of names.
| [in] | names | Character set names. The first one is the "main" name. |
| [in] | default_table | Default character table to use without leading "table code". |
|
static |
Get an ordered list of character sets which are used to encode DVB strings. When encoding a DVB string, these character sets are used in order, until one can encode the string.
|
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.
|
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. |
|
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.
|
static |
Default predefined DVB character set (using ISO-6937 as default table).