michael@0: /* michael@0: ********************************************************************** michael@0: * Copyright (C) 2005-2012, International Business Machines michael@0: * Corporation and others. All Rights Reserved. michael@0: ********************************************************************** michael@0: */ michael@0: michael@0: #ifndef __CSRUCODE_H michael@0: #define __CSRUCODE_H michael@0: michael@0: #include "unicode/utypes.h" michael@0: michael@0: #if !UCONFIG_NO_CONVERSION michael@0: michael@0: #include "csrecog.h" michael@0: michael@0: U_NAMESPACE_BEGIN michael@0: michael@0: /** michael@0: * This class matches UTF-16 and UTF-32, both big- and little-endian. The michael@0: * BOM will be used if it is present. michael@0: * michael@0: * @internal michael@0: */ michael@0: class CharsetRecog_Unicode : public CharsetRecognizer michael@0: { michael@0: michael@0: public: michael@0: michael@0: virtual ~CharsetRecog_Unicode(); michael@0: /* (non-Javadoc) michael@0: * @see com.ibm.icu.text.CharsetRecognizer#getName() michael@0: */ michael@0: const char* getName() const = 0; michael@0: michael@0: /* (non-Javadoc) michael@0: * @see com.ibm.icu.text.CharsetRecognizer#match(com.ibm.icu.text.CharsetDetector) michael@0: */ michael@0: UBool match(InputText* textIn, CharsetMatch *results) const = 0; michael@0: }; michael@0: michael@0: michael@0: class CharsetRecog_UTF_16_BE : public CharsetRecog_Unicode michael@0: { michael@0: public: michael@0: michael@0: virtual ~CharsetRecog_UTF_16_BE(); michael@0: michael@0: const char *getName() const; michael@0: michael@0: UBool match(InputText* textIn, CharsetMatch *results) const; michael@0: }; michael@0: michael@0: class CharsetRecog_UTF_16_LE : public CharsetRecog_Unicode michael@0: { michael@0: public: michael@0: michael@0: virtual ~CharsetRecog_UTF_16_LE(); michael@0: michael@0: const char *getName() const; michael@0: michael@0: UBool match(InputText* textIn, CharsetMatch *results) const; michael@0: }; michael@0: michael@0: class CharsetRecog_UTF_32 : public CharsetRecog_Unicode michael@0: { michael@0: protected: michael@0: virtual int32_t getChar(const uint8_t *input, int32_t index) const = 0; michael@0: public: michael@0: michael@0: virtual ~CharsetRecog_UTF_32(); michael@0: michael@0: const char* getName() const = 0; michael@0: michael@0: UBool match(InputText* textIn, CharsetMatch *results) const; michael@0: }; michael@0: michael@0: michael@0: class CharsetRecog_UTF_32_BE : public CharsetRecog_UTF_32 michael@0: { michael@0: protected: michael@0: int32_t getChar(const uint8_t *input, int32_t index) const; michael@0: michael@0: public: michael@0: michael@0: virtual ~CharsetRecog_UTF_32_BE(); michael@0: michael@0: const char *getName() const; michael@0: }; michael@0: michael@0: michael@0: class CharsetRecog_UTF_32_LE : public CharsetRecog_UTF_32 michael@0: { michael@0: protected: michael@0: int32_t getChar(const uint8_t *input, int32_t index) const; michael@0: michael@0: public: michael@0: virtual ~CharsetRecog_UTF_32_LE(); michael@0: michael@0: const char* getName() const; michael@0: }; michael@0: michael@0: U_NAMESPACE_END michael@0: michael@0: #endif michael@0: #endif /* __CSRUCODE_H */