• 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) noexcept(false);
00047   ~auto_iconv();
00048   operator UT_iconv_t();
00049 
00050   UT_iconv_t getHandle ();
00051 
00052  private:
00053 
00054   auto_iconv(const auto_iconv&);    // no impl
00055   void operator=(const auto_iconv&);    // no impl
00056   UT_iconv_t m_h;
00057 };
00058 
00059 #endif /* c++ */
00060 
00061 G_BEGIN_DECLS
00062 
00063 ABI_EXPORT const char * ucs2Internal ();
00064 #define UCS_2_INTERNAL ucs2Internal()
00065 ABI_EXPORT const char * ucs4Internal ();
00066 #define UCS_INTERNAL ucs4Internal()
00067 
00068 ABI_EXPORT UT_iconv_t  UT_iconv_open( const char* to, const char* from );
00069 ABI_EXPORT size_t      UT_iconv( UT_iconv_t cd, const char **inbuf,
00070               size_t *inbytesleft, char **outbuf,
00071               size_t *outbytesleft );
00072 ABI_EXPORT int         UT_iconv_close( UT_iconv_t cd );
00073 ABI_EXPORT void        UT_iconv_reset( UT_iconv_t cd );
00074 ABI_EXPORT int         UT_iconv_isValid ( UT_iconv_t cd );
00075 
00076 ABI_EXPORT char *      UT_convert (const char *str,
00077             UT_sint32 len,
00078             const char *from_codeset,
00079             const char *to_codeset,
00080             UT_uint32 *bytes_read,
00081             UT_uint32 *bytes_written);
00082 
00083 ABI_EXPORT char *      UT_convert_cd (const char *str,
00084                UT_sint32 len,
00085                UT_iconv_t cd,
00086                UT_uint32 *bytes_read,
00087                UT_uint32 *bytes_written);
00088 
00089 G_END_DECLS
00090 
00091 #endif /* UT_ICONV_H */
00092 
00093 
00094 
00095 

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1