Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /*
2 **********************************************************************
3 * Copyright (C) 2005-2012, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6 */
8 #ifndef __CSRUCODE_H
9 #define __CSRUCODE_H
11 #include "unicode/utypes.h"
13 #if !UCONFIG_NO_CONVERSION
15 #include "csrecog.h"
17 U_NAMESPACE_BEGIN
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 */
25 class CharsetRecog_Unicode : public CharsetRecognizer
26 {
28 public:
30 virtual ~CharsetRecog_Unicode();
31 /* (non-Javadoc)
32 * @see com.ibm.icu.text.CharsetRecognizer#getName()
33 */
34 const char* getName() const = 0;
36 /* (non-Javadoc)
37 * @see com.ibm.icu.text.CharsetRecognizer#match(com.ibm.icu.text.CharsetDetector)
38 */
39 UBool match(InputText* textIn, CharsetMatch *results) const = 0;
40 };
43 class CharsetRecog_UTF_16_BE : public CharsetRecog_Unicode
44 {
45 public:
47 virtual ~CharsetRecog_UTF_16_BE();
49 const char *getName() const;
51 UBool match(InputText* textIn, CharsetMatch *results) const;
52 };
54 class CharsetRecog_UTF_16_LE : public CharsetRecog_Unicode
55 {
56 public:
58 virtual ~CharsetRecog_UTF_16_LE();
60 const char *getName() const;
62 UBool match(InputText* textIn, CharsetMatch *results) const;
63 };
65 class CharsetRecog_UTF_32 : public CharsetRecog_Unicode
66 {
67 protected:
68 virtual int32_t getChar(const uint8_t *input, int32_t index) const = 0;
69 public:
71 virtual ~CharsetRecog_UTF_32();
73 const char* getName() const = 0;
75 UBool match(InputText* textIn, CharsetMatch *results) const;
76 };
79 class CharsetRecog_UTF_32_BE : public CharsetRecog_UTF_32
80 {
81 protected:
82 int32_t getChar(const uint8_t *input, int32_t index) const;
84 public:
86 virtual ~CharsetRecog_UTF_32_BE();
88 const char *getName() const;
89 };
92 class CharsetRecog_UTF_32_LE : public CharsetRecog_UTF_32
93 {
94 protected:
95 int32_t getChar(const uint8_t *input, int32_t index) const;
97 public:
98 virtual ~CharsetRecog_UTF_32_LE();
100 const char* getName() const;
101 };
103 U_NAMESPACE_END
105 #endif
106 #endif /* __CSRUCODE_H */