vdr
1.7.27
|
#include <tools.h>
Public Member Functions | |
cCharSetConv (const char *FromCode=NULL, const char *ToCode=NULL) | |
~cCharSetConv () | |
const char * | Convert (const char *From, char *To=NULL, size_t ToLength=0) |
cCharSetConv (const char *FromCode=NULL, const char *ToCode=NULL) | |
~cCharSetConv () | |
const char * | Convert (const char *From, char *To=NULL, size_t ToLength=0) |
Static Public Member Functions | |
static const char * | SystemCharacterTable (void) |
static void | SetSystemCharacterTable (const char *CharacterTable) |
static const char * | SystemCharacterTable (void) |
static void | SetSystemCharacterTable (const char *CharacterTable) |
Private Attributes | |
iconv_t | cd |
char * | result |
size_t | length |
Static Private Attributes | |
static char * | systemCharacterTable = NULL |
Definition at line 139 of file include/vdr/tools.h.
cCharSetConv::cCharSetConv | ( | const char * | FromCode = NULL , |
const char * | ToCode = NULL |
||
) |
Sets up a character set converter to convert from FromCode to ToCode.
If FromCode is NULL, the previously set systemCharacterTable is used (or "UTF-8" if no systemCharacterTable has been set). If ToCode is NULL, "UTF-8" is used.
Definition at line 803 of file tools.c.
References cd, length, result, and systemCharacterTable.
cCharSetConv::cCharSetConv | ( | const char * | FromCode = NULL , |
const char * | ToCode = NULL |
||
) |
Sets up a character set converter to convert from FromCode to ToCode.
If FromCode is NULL, the previously set systemCharacterTable is used (or "UTF-8" if no systemCharacterTable has been set). If ToCode is NULL, "UTF-8" is used.
const char * cCharSetConv::Convert | ( | const char * | From, |
char * | To = NULL , |
||
size_t | ToLength = 0 |
||
) |
Converts the given Text from FromCode to ToCode (as set in the constructor).
If To is given, it is used to copy at most ToLength bytes of the result (including the terminating 0) into that buffer. If To is not given, the result is copied into a dynamically allocated buffer and is valid as long as this object lives, or until the next call to Convert(). The return value always points to the result if the conversion was successful (even if a fixed size To buffer was given and the result didn't fit into it). If the string could not be converted, the result points to the original From string.
Definition at line 843 of file tools.c.
References cd, esyslog, length, max(), and result.
Referenced by cSubtitleObject::DecodeCharacterString(), cMenuTimerItem::Set(), and SetSystemCharacterTable().
const char* cCharSetConv::Convert | ( | const char * | From, |
char * | To = NULL , |
||
size_t | ToLength = 0 |
||
) |
Converts the given Text from FromCode to ToCode (as set in the constructor).
If To is given, it is used to copy at most ToLength bytes of the result (including the terminating 0) into that buffer. If To is not given, the result is copied into a dynamically allocated buffer and is valid as long as this object lives, or until the next call to Convert(). The return value always points to the result if the conversion was successful (even if a fixed size To buffer was given and the result didn't fit into it). If the string could not be converted, the result points to the original From string.
static void cCharSetConv::SetSystemCharacterTable | ( | const char * | CharacterTable | ) | [static] |
void cCharSetConv::SetSystemCharacterTable | ( | const char * | CharacterTable | ) | [static] |
Definition at line 820 of file tools.c.
References Convert(), systemCharacterTable, SystemToUtf8, Utf8CharGet(), and Utf8CharLen().
Referenced by main().
static const char* cCharSetConv::SystemCharacterTable | ( | void | ) | [inline, static] |
Definition at line 162 of file include/vdr/tools.h.
References systemCharacterTable.
Referenced by cSVDRP::Process(), cMenuTimerItem::Set(), Utf8CharGet(), Utf8CharLen(), Utf8CharSet(), Utf8FromArray(), Utf8StrLen(), Utf8Strn0Cpy(), Utf8SymChars(), and Utf8ToArray().
static const char* cCharSetConv::SystemCharacterTable | ( | void | ) | [inline, static] |
Definition at line 162 of file tools.h.
References systemCharacterTable.
iconv_t cCharSetConv::cd [private] |
Definition at line 141 of file include/vdr/tools.h.
Referenced by cCharSetConv(), Convert(), and ~cCharSetConv().
size_t cCharSetConv::length [private] |
Definition at line 143 of file include/vdr/tools.h.
Referenced by cCharSetConv(), and Convert().
char * cCharSetConv::result [private] |
Definition at line 142 of file include/vdr/tools.h.
Referenced by cCharSetConv(), Convert(), and ~cCharSetConv().
static char * cCharSetConv::systemCharacterTable = NULL [static, private] |
Definition at line 144 of file include/vdr/tools.h.
Referenced by cCharSetConv(), SetSystemCharacterTable(), and SystemCharacterTable().