1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/icu/source/i18n/csrucode.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,106 @@ 1.4 +/* 1.5 + ********************************************************************** 1.6 + * Copyright (C) 2005-2012, International Business Machines 1.7 + * Corporation and others. All Rights Reserved. 1.8 + ********************************************************************** 1.9 + */ 1.10 + 1.11 +#ifndef __CSRUCODE_H 1.12 +#define __CSRUCODE_H 1.13 + 1.14 +#include "unicode/utypes.h" 1.15 + 1.16 +#if !UCONFIG_NO_CONVERSION 1.17 + 1.18 +#include "csrecog.h" 1.19 + 1.20 +U_NAMESPACE_BEGIN 1.21 + 1.22 +/** 1.23 + * This class matches UTF-16 and UTF-32, both big- and little-endian. The 1.24 + * BOM will be used if it is present. 1.25 + * 1.26 + * @internal 1.27 + */ 1.28 +class CharsetRecog_Unicode : public CharsetRecognizer 1.29 +{ 1.30 + 1.31 +public: 1.32 + 1.33 + virtual ~CharsetRecog_Unicode(); 1.34 + /* (non-Javadoc) 1.35 + * @see com.ibm.icu.text.CharsetRecognizer#getName() 1.36 + */ 1.37 + const char* getName() const = 0; 1.38 + 1.39 + /* (non-Javadoc) 1.40 + * @see com.ibm.icu.text.CharsetRecognizer#match(com.ibm.icu.text.CharsetDetector) 1.41 + */ 1.42 + UBool match(InputText* textIn, CharsetMatch *results) const = 0; 1.43 +}; 1.44 + 1.45 + 1.46 +class CharsetRecog_UTF_16_BE : public CharsetRecog_Unicode 1.47 +{ 1.48 +public: 1.49 + 1.50 + virtual ~CharsetRecog_UTF_16_BE(); 1.51 + 1.52 + const char *getName() const; 1.53 + 1.54 + UBool match(InputText* textIn, CharsetMatch *results) const; 1.55 +}; 1.56 + 1.57 +class CharsetRecog_UTF_16_LE : public CharsetRecog_Unicode 1.58 +{ 1.59 +public: 1.60 + 1.61 + virtual ~CharsetRecog_UTF_16_LE(); 1.62 + 1.63 + const char *getName() const; 1.64 + 1.65 + UBool match(InputText* textIn, CharsetMatch *results) const; 1.66 +}; 1.67 + 1.68 +class CharsetRecog_UTF_32 : public CharsetRecog_Unicode 1.69 +{ 1.70 +protected: 1.71 + virtual int32_t getChar(const uint8_t *input, int32_t index) const = 0; 1.72 +public: 1.73 + 1.74 + virtual ~CharsetRecog_UTF_32(); 1.75 + 1.76 + const char* getName() const = 0; 1.77 + 1.78 + UBool match(InputText* textIn, CharsetMatch *results) const; 1.79 +}; 1.80 + 1.81 + 1.82 +class CharsetRecog_UTF_32_BE : public CharsetRecog_UTF_32 1.83 +{ 1.84 +protected: 1.85 + int32_t getChar(const uint8_t *input, int32_t index) const; 1.86 + 1.87 +public: 1.88 + 1.89 + virtual ~CharsetRecog_UTF_32_BE(); 1.90 + 1.91 + const char *getName() const; 1.92 +}; 1.93 + 1.94 + 1.95 +class CharsetRecog_UTF_32_LE : public CharsetRecog_UTF_32 1.96 +{ 1.97 +protected: 1.98 + int32_t getChar(const uint8_t *input, int32_t index) const; 1.99 + 1.100 +public: 1.101 + virtual ~CharsetRecog_UTF_32_LE(); 1.102 + 1.103 + const char* getName() const; 1.104 +}; 1.105 + 1.106 +U_NAMESPACE_END 1.107 + 1.108 +#endif 1.109 +#endif /* __CSRUCODE_H */