Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

convert.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  *
00003  *   Copyright (C) 1998-2001, International Business Machines
00004  *   Corporation and others.  All Rights Reserved.
00005  *
00006  *
00007  *   Change history:
00008  *
00009  *   06/29/2000  helena      Major rewrite of the callback APIs.
00010  *****************************************************************************/
00011 
00012 #ifndef CONVERT_H
00013 #define CONVERT_H
00014 
00015 
00016 #include "unicode/unistr.h"
00017 #include "unicode/ucnv.h"
00018 
00019 U_NAMESPACE_BEGIN
00039 class U_COMMON_API UnicodeConverter
00040 {
00041  private:
00042   /*Internal Data representation of the Converter*/
00043   UConverter* myUnicodeConverter;
00044   /*Debug method*/
00045   void printRef(void) const;
00046 
00047  public:
00048 
00049 //Constructors and a destructor
00050 
00056  UnicodeConverter();
00057 
00068  UnicodeConverter(const char*             name,
00069              UErrorCode&              err);
00070 
00082  UnicodeConverter(const UnicodeString&    name,
00083              UErrorCode&              err);
00084 
00094  UnicodeConverter(int32_t                      codepageNumber,
00095              UConverterPlatform  platform,
00096              UErrorCode&                   err);
00097 
00098  ~UnicodeConverter();
00099 
00100 
00115 void fromUnicodeString(char*                    target,
00116                int32_t&                 targetSize,
00117                const UnicodeString&     source,
00118                UErrorCode&               err) const;
00119 
00133 void  toUnicodeString(UnicodeString&    target,
00134                       const char*       source,
00135                       int32_t           sourceSize,
00136                       UErrorCode&        err) const;
00137 
00158 void fromUnicode(char*&         target,
00159                  const char*    targetLimit,
00160                  const UChar*&      source,
00161                  const UChar* sourceLimit,
00162                  int32_t * offsets,
00163                  UBool         flush,
00164                  UErrorCode&     err);
00165 
00166 
00186  void toUnicode(UChar*&        target,
00187         const UChar*   targetLimit,
00188         const char*&     source,
00189         const char*      sourceLimit,
00190         int32_t * offsets,
00191         UBool           flush,
00192         UErrorCode&       err);
00193 
00194 
00200 int8_t getMaxBytesPerChar(void) const;
00201 
00208 int8_t getMinBytesPerChar(void) const;
00209 
00216 UConverterType getType(void) const;
00217 
00230  void getStarters(UBool starters[256],
00231                   UErrorCode& err) const;
00242 void getSubstitutionChars(char*         subChars,
00243                           int8_t&       len,
00244                           UErrorCode&    err) const;
00256 void setSubstitutionChars(const char*   subChars,
00257                           int8_t        len,
00258                           UErrorCode&    err);
00259 
00265 void resetState(void);
00266 
00275 const char*  getName( UErrorCode&  err) const;
00276 
00277 
00288  int32_t  getCodepage(UErrorCode& err) const;
00289 
00297  void getMissingCharAction(UConverterToUCallback *action,
00298                            const void **context) const;
00299 
00307  void getMissingUnicodeAction(UConverterFromUCallback *action,
00308                               const void **context) const;
00309 
00320  void  setMissingCharAction(UConverterToUCallback     newAction,
00321                 const void* newContext,
00322                 UConverterToUCallback *oldAction, 
00323                 const void** oldContext,
00324                 UErrorCode&            err);
00325 
00337  void  setMissingUnicodeAction(UConverterFromUCallback  newAction,
00338                    const void* newContext,
00339                    UConverterFromUCallback *oldAction,
00340                    const void** oldContext,
00341                    UErrorCode&            err);
00349 void getDisplayName(const Locale&   displayLocale,
00350                     UnicodeString&  displayName) const;
00351 
00359 UConverterPlatform  getCodepagePlatform(UErrorCode& err) const;
00360 
00361 
00362  UnicodeConverter&   operator=(const UnicodeConverter& that);
00363  UBool              operator==(const UnicodeConverter& that) const;
00364  UBool              operator!=(const UnicodeConverter& that) const;
00365  UnicodeConverter(const UnicodeConverter&  that);
00366 
00374 static  const char* const* getAvailableNames(int32_t&   num,
00375                          UErrorCode&  err);
00376 
00382 static   int32_t flushCache(void);
00393 void fixFileSeparator(UnicodeString& source) const;
00394 
00402 UBool isAmbiguous(void) const;
00403 
00404 };
00405 
00410 typedef UnicodeConverter UnicodeConverterCPP;   /* Backwards compatibility. */
00411 
00412 U_NAMESPACE_END
00413 #endif

Generated on Mon Dec 3 19:00:20 2001 for ICU 2.0 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001