/******************************************************************************* * * Copyright (C) 1998-1999, International Business Machines * Corporation and others. All Rights Reserved. * *******************************************************************************/ #ifndef CONVERT_H #define CONVERT_H #include "unicode/unistr.h" #include "unicode/ucnv.h" class U_COMMON_API UnicodeConverterCPP { private: /*Internal Data representation of the Converter*/ UConverter* myUnicodeConverter; /*Debug method*/ void printRef(void) const; /* list of converter and alias names */ static const char **availableConverterNames; static int32_t availableConverterNamesCount; public: //Constructors and a destructor UnicodeConverterCPP(); UnicodeConverterCPP(const char* name, UErrorCode& err); UnicodeConverterCPP(const UnicodeString& name, UErrorCode& err); UnicodeConverterCPP(int32_t codepageNumber, UConverterPlatform platform, UErrorCode& err); ~UnicodeConverterCPP(); void fromUnicodeString(char* target, int32_t& targetSize, const UnicodeString& source, UErrorCode& err) const; void toUnicodeString(UnicodeString& target, const char* source, int32_t sourceSize, UErrorCode& err) const; void fromUnicode(char*& target, const char* targetLimit, const UChar*& source, const UChar* sourceLimit, int32_t * offsets, bool_t flush, UErrorCode& err); void toUnicode(UChar*& target, const UChar* targetLimit, const char*& source, const char* sourceLimit, int32_t * offsets, bool_t flush, UErrorCode& err); int8_t getMaxBytesPerChar(void) const; int8_t getMinBytesPerChar(void) const; UConverterType getType(void) const; void getStarters(bool_t starters[256], UErrorCode& err) const; void getSubstitutionChars(char* subChars, int8_t& len, UErrorCode& err) const; void setSubstitutionChars(const char* subChars, int8_t len, UErrorCode& err); void resetState(void); const char* getName( UErrorCode& err) const; int32_t getCodepage(UErrorCode& err) const; UConverterToUCallback getMissingCharAction(void) const; UConverterFromUCallback getMissingUnicodeAction(void) const; void setMissingCharAction(UConverterToUCallback action, UErrorCode& err); void setMissingUnicodeAction(UConverterFromUCallback action, UErrorCode& err); void getDisplayName(const Locale& displayLocale, UnicodeString& displayName) const; UConverterPlatform getCodepagePlatform(UErrorCode& err) const; UnicodeConverterCPP& operator=(const UnicodeConverterCPP& that); bool_t operator==(const UnicodeConverterCPP& that) const; bool_t operator!=(const UnicodeConverterCPP& that) const; UnicodeConverterCPP(const UnicodeConverterCPP& that); static const char* const* getAvailableNames(int32_t& num, UErrorCode& err); static int32_t flushCache(void); void fixFileSeparator(UnicodeString& source) const; bool_t isAmbiguous(void) const; }; #endif