1/* 2 ********************************************************************** 3 * Copyright (C) 2005-2006, International Business Machines 4 * Corporation and others. All Rights Reserved. 5 ********************************************************************** 6 */ 7 8#ifndef __CSRUCODE_H 9#define __CSRUCODE_H 10 11#include "unicode/utypes.h" 12 13#if !UCONFIG_NO_CONVERSION 14 15#include "csrecog.h" 16 17U_NAMESPACE_BEGIN 18 19/** 20 * This class matches UTF-16 and UTF-32, both big- and little-endian. The 21 * BOM will be used if it is present. 22 * 23 * @internal 24 */ 25class CharsetRecog_Unicode : public CharsetRecognizer 26{ 27 28public: 29 30 virtual ~CharsetRecog_Unicode(); 31 /* (non-Javadoc) 32 * @see com.ibm.icu.text.CharsetRecognizer#getName() 33 */ 34 const char* getName() const = 0; 35 36 /* (non-Javadoc) 37 * @see com.ibm.icu.text.CharsetRecognizer#match(com.ibm.icu.text.CharsetDetector) 38 */ 39 int32_t match(InputText* textIn) = 0; 40}; 41 42 43class CharsetRecog_UTF_16_BE : public CharsetRecog_Unicode 44{ 45public: 46 47 virtual ~CharsetRecog_UTF_16_BE(); 48 49 const char *getName() const; 50 51 int32_t match(InputText* textIn); 52}; 53 54class CharsetRecog_UTF_16_LE : public CharsetRecog_Unicode 55{ 56public: 57 58 virtual ~CharsetRecog_UTF_16_LE(); 59 60 const char *getName() const; 61 62 int32_t match(InputText* textIn); 63}; 64 65class CharsetRecog_UTF_32 : public CharsetRecog_Unicode 66{ 67protected: 68 virtual int32_t getChar(const uint8_t *input, int32_t index) const = 0; 69public: 70 71 virtual ~CharsetRecog_UTF_32(); 72 73 const char* getName() const = 0; 74 75 int32_t match(InputText* textIn); 76}; 77 78 79class CharsetRecog_UTF_32_BE : public CharsetRecog_UTF_32 80{ 81protected: 82 int32_t getChar(const uint8_t *input, int32_t index) const; 83 84public: 85 86 virtual ~CharsetRecog_UTF_32_BE(); 87 88 const char *getName() const; 89}; 90 91 92class CharsetRecog_UTF_32_LE : public CharsetRecog_UTF_32 93{ 94protected: 95 int32_t getChar(const uint8_t *input, int32_t index) const; 96 97public: 98 virtual ~CharsetRecog_UTF_32_LE(); 99 100 const char* getName() const; 101}; 102 103U_NAMESPACE_END 104 105#endif 106#endif /* __CSRUCODE_H */ 107