• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ut_iconv.h

Go to the documentation of this file.
00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */
00002 
00003 /* AbiSource Program Utilities
00004  * Copyright (C) 1998-2000 AbiSource, Inc.
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00019  * 02110-1301 USA.
00020  */
00021 
00022 #ifndef UT_ICONV_H
00023 #define UT_ICONV_H
00024 
00025 /* pre-emptive dismissal; ut_types.h is needed by just about everything,
00026  * so even if it's commented out in-file that's still a lot of work for
00027  * the preprocessor to do...
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&);    // no impl
00056   void operator=(const auto_iconv&);    // no impl
00057   UT_iconv_t m_h;
00058 };
00059 
00060 #endif /* c++ */
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 /* UT_ICONV_H */
00093 
00094 
00095 
00096 

Generated on Wed May 22 2013 for AbiWord by  doxygen 1.7.1