Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef UT_ICONV_H
00023 #define UT_ICONV_H
00024
00025
00026
00027
00028
00029 #ifndef UT_TYPES_H
00030 #include "ut_types.h"
00031 #endif
00032
00033 typedef void * UT_iconv_t;
00034
00035 #define UT_ICONV_INVALID ((UT_iconv_t)(-1))
00036
00037 #ifdef __cplusplus
00038
00039
00040 class ABI_EXPORT auto_iconv
00041 {
00042 public:
00043
00044 explicit auto_iconv(UT_iconv_t iconv);
00045
00046 explicit auto_iconv(const char * in_charset, const char *out_charset)
00047 throw(UT_iconv_t);
00048 ~auto_iconv();
00049 operator UT_iconv_t();
00050
00051 UT_iconv_t getHandle ();
00052
00053 private:
00054
00055 auto_iconv(const auto_iconv&);
00056 void operator=(const auto_iconv&);
00057 UT_iconv_t m_h;
00058 };
00059
00060 #endif
00061
00062 G_BEGIN_DECLS
00063
00064 ABI_EXPORT const char * ucs2Internal ();
00065 #define UCS_2_INTERNAL ucs2Internal()
00066 ABI_EXPORT const char * ucs4Internal ();
00067 #define UCS_INTERNAL ucs4Internal()
00068
00069 ABI_EXPORT UT_iconv_t UT_iconv_open( const char* to, const char* from );
00070 ABI_EXPORT size_t UT_iconv( UT_iconv_t cd, const char **inbuf,
00071 size_t *inbytesleft, char **outbuf,
00072 size_t *outbytesleft );
00073 ABI_EXPORT int UT_iconv_close( UT_iconv_t cd );
00074 ABI_EXPORT void UT_iconv_reset( UT_iconv_t cd );
00075 ABI_EXPORT int UT_iconv_isValid ( UT_iconv_t cd );
00076
00077 ABI_EXPORT char * UT_convert (const char *str,
00078 UT_sint32 len,
00079 const char *from_codeset,
00080 const char *to_codeset,
00081 UT_uint32 *bytes_read,
00082 UT_uint32 *bytes_written);
00083
00084 ABI_EXPORT char * UT_convert_cd (const char *str,
00085 UT_sint32 len,
00086 UT_iconv_t cd,
00087 UT_uint32 *bytes_read,
00088 UT_uint32 *bytes_written);
00089
00090 G_END_DECLS
00091
00092 #endif
00093
00094
00095
00096