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