// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "encconv.h"
#endif
bool wxEncodingConverter::Init(wxFontEncoding input_enc, wxFontEncoding output_enc, int method)
{
unsigned i;
- wxUint16 *in_tbl = NULL, *out_tbl = NULL;
+ wxUint16 *in_tbl, *out_tbl = NULL;
if (m_Table) {delete[] m_Table; m_Table = NULL;}
m_Table[out_tbl[i]] = (tchar)(128 + i);
m_UnicodeInput = TRUE;
- return TRUE;
}
-
- else
+ else // input !Unicode
{
if ((in_tbl = GetEncTable(input_enc)) == NULL) return FALSE;
if (output_enc != wxFONTENCODING_UNICODE)
}
// FIXME: write a substitute for bsearch
#ifndef __WXWINCE__
- else
+ else // output !Unicode
{
CharsetItem *rev = BuildReverseTable(out_tbl);
CharsetItem *item;
}
delete[] rev;
- return TRUE;
}
-#endif
- return TRUE;
+#endif // !__WXWINCE__
}
+
+ return TRUE;
}
-void wxEncodingConverter::Convert(const char* input, char* output)
+void wxEncodingConverter::Convert(const char* input, char* output) const
{
wxASSERT_MSG(!m_UnicodeOutput, wxT("You cannot convert to unicode if output is const char*!"));
wxASSERT_MSG(!m_UnicodeInput, wxT("You cannot convert from unicode if input is const char*!"));
#if wxUSE_WCHAR_T
-void wxEncodingConverter::Convert(const char* input, wchar_t* output)
+void wxEncodingConverter::Convert(const char* input, wchar_t* output) const
{
wxASSERT_MSG(m_UnicodeOutput, wxT("You cannot convert to 8-bit if output is const wchar_t*!"));
wxASSERT_MSG(!m_UnicodeInput, wxT("You cannot convert from unicode if input is const char*!"));
-void wxEncodingConverter::Convert(const wchar_t* input, char* output)
+void wxEncodingConverter::Convert(const wchar_t* input, char* output) const
{
wxASSERT_MSG(!m_UnicodeOutput, wxT("You cannot convert to unicode if output is const char*!"));
wxASSERT_MSG(m_UnicodeInput, wxT("You cannot convert from 8-bit if input is const wchar_t*!"));
-void wxEncodingConverter::Convert(const wchar_t* input, wchar_t* output)
+void wxEncodingConverter::Convert(const wchar_t* input, wchar_t* output) const
{
wxASSERT_MSG(m_UnicodeOutput, wxT("You cannot convert to 8-bit if output is const wchar_t*!"));
wxASSERT_MSG(m_UnicodeInput, wxT("You cannot convert from 8-bit if input is const wchar_t*!"));
#endif // wxUSE_WCHAR_T
-wxString wxEncodingConverter::Convert(const wxString& input)
+wxString wxEncodingConverter::Convert(const wxString& input) const
{
if (m_JustCopy) return input;