]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/csdetect.h
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 **********************************************************************
5 * Copyright (C) 2005-2016, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 **********************************************************************
13 #include "unicode/uobject.h"
15 #if !UCONFIG_NO_CONVERSION
17 #include "unicode/uenum.h"
22 class CharsetRecognizer
;
25 class CharsetDetector
: public UMemory
29 CharsetMatch
**resultArray
;
31 UBool fStripTags
; // If true, setText() will strip tags from input text.
33 static void setRecognizers(UErrorCode
&status
);
35 UBool
*fEnabledRecognizers
; // If not null, active set of charset recognizers had
36 // been changed from the default. The array index is
37 // corresponding to fCSRecognizers. See setDetectableCharset().
40 CharsetDetector(UErrorCode
&status
);
44 void setText(const char *in
, int32_t len
);
46 const CharsetMatch
* const *detectAll(int32_t &maxMatchesFound
, UErrorCode
&status
);
48 const CharsetMatch
*detect(UErrorCode
& status
);
50 void setDeclaredEncoding(const char *encoding
, int32_t len
) const;
52 UBool
setStripTagsFlag(UBool flag
);
54 UBool
getStripTagsFlag() const;
56 // const char *getCharsetName(int32_t index, UErrorCode& status) const;
58 static int32_t getDetectableCount();
61 static UEnumeration
* getAllDetectableCharsets(UErrorCode
&status
);
62 UEnumeration
* getDetectableCharsets(UErrorCode
&status
) const;
63 void setDetectableCharset(const char *encoding
, UBool enabled
, UErrorCode
&status
);
69 #endif /* __CSDETECT_H */