]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/csdetect.h
2 **********************************************************************
3 * Copyright (C) 2005-2016, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
11 #include "unicode/uobject.h"
13 #if !UCONFIG_NO_CONVERSION
15 #include "unicode/uenum.h"
20 class CharsetRecognizer
;
23 class CharsetDetector
: public UMemory
27 CharsetMatch
**resultArray
;
29 UBool fStripTags
; // If true, setText() will strip tags from input text.
31 static void setRecognizers(UErrorCode
&status
);
33 UBool
*fEnabledRecognizers
; // If not null, active set of charset recognizers had
34 // been changed from the default. The array index is
35 // corresponding to fCSRecognizers. See setDetectableCharset().
38 CharsetDetector(UErrorCode
&status
);
42 void setText(const char *in
, int32_t len
);
44 const CharsetMatch
* const *detectAll(int32_t &maxMatchesFound
, UErrorCode
&status
);
46 const CharsetMatch
*detect(UErrorCode
& status
);
48 void setDeclaredEncoding(const char *encoding
, int32_t len
) const;
50 UBool
setStripTagsFlag(UBool flag
);
52 UBool
getStripTagsFlag() const;
54 // const char *getCharsetName(int32_t index, UErrorCode& status) const;
56 static int32_t getDetectableCount();
59 static UEnumeration
* getAllDetectableCharsets(UErrorCode
&status
);
60 UEnumeration
* getDetectableCharsets(UErrorCode
&status
) const;
61 void setDetectableCharset(const char *encoding
, UBool enabled
, UErrorCode
&status
);
67 #endif /* __CSDETECT_H */