cCharSetConv Class Reference

#include <tools.h>

List of all members.

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)

Static Public Member Functions

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


Detailed Description

Definition at line 126 of file tools.h.


Constructor & Destructor Documentation

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. If ToCode is NULL, "UTF-8" is used.

Definition at line 768 of file tools.c.

References cd, length, result, and systemCharacterTable.

cCharSetConv::~cCharSetConv (  ) 

Definition at line 779 of file tools.c.

References cd, and result.


Member Function Documentation

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 cosntructor). 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 808 of file tools.c.

References cd, length, max(), and result.

Referenced by SetSystemCharacterTable().

Here is the call graph for this function:

static const char* cCharSetConv::SystemCharacterTable ( void   )  [inline, static]

void cCharSetConv::SetSystemCharacterTable ( const char *  CharacterTable  )  [static]

Definition at line 785 of file tools.c.

References Convert(), systemCharacterTable, SystemToUtf8, Utf8CharGet(), and Utf8CharLen().

Referenced by main().

Here is the call graph for this function:


Member Data Documentation

iconv_t cCharSetConv::cd [private]

Definition at line 128 of file tools.h.

Referenced by cCharSetConv(), Convert(), and ~cCharSetConv().

char* cCharSetConv::result [private]

Definition at line 129 of file tools.h.

Referenced by cCharSetConv(), Convert(), and ~cCharSetConv().

size_t cCharSetConv::length [private]

Definition at line 130 of file tools.h.

Referenced by cCharSetConv(), and Convert().

char * cCharSetConv::systemCharacterTable = NULL [static, private]

Definition at line 131 of file tools.h.

Referenced by cCharSetConv(), SetSystemCharacterTable(), and SystemCharacterTable().


The documentation for this class was generated from the following files:

Generated on Tue Nov 4 19:57:40 2008 for VDR by  doxygen 1.5.6