1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/icu/source/i18n/csdetect.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,65 @@ 1.4 +/* 1.5 + ********************************************************************** 1.6 + * Copyright (C) 2005-2013, International Business Machines 1.7 + * Corporation and others. All Rights Reserved. 1.8 + ********************************************************************** 1.9 + */ 1.10 + 1.11 +#ifndef __CSDETECT_H 1.12 +#define __CSDETECT_H 1.13 + 1.14 +#include "unicode/uobject.h" 1.15 + 1.16 +#if !UCONFIG_NO_CONVERSION 1.17 + 1.18 +U_NAMESPACE_BEGIN 1.19 + 1.20 +class InputText; 1.21 +class CharsetRecognizer; 1.22 +class CharsetMatch; 1.23 + 1.24 +class CharsetDetector : public UMemory 1.25 +{ 1.26 +private: 1.27 + InputText *textIn; 1.28 + CharsetMatch **resultArray; 1.29 + int32_t resultCount; 1.30 + UBool fStripTags; // If true, setText() will strip tags from input text. 1.31 + UBool fFreshTextSet; 1.32 + static void setRecognizers(UErrorCode &status); 1.33 + 1.34 + UBool *fEnabledRecognizers; // If not null, active set of charset recognizers had 1.35 + // been changed from the default. The array index is 1.36 + // corresponding to fCSRecognizers. See setDetectableCharset(). 1.37 + 1.38 +public: 1.39 + CharsetDetector(UErrorCode &status); 1.40 + 1.41 + ~CharsetDetector(); 1.42 + 1.43 + void setText(const char *in, int32_t len); 1.44 + 1.45 + const CharsetMatch * const *detectAll(int32_t &maxMatchesFound, UErrorCode &status); 1.46 + 1.47 + const CharsetMatch *detect(UErrorCode& status); 1.48 + 1.49 + void setDeclaredEncoding(const char *encoding, int32_t len) const; 1.50 + 1.51 + UBool setStripTagsFlag(UBool flag); 1.52 + 1.53 + UBool getStripTagsFlag() const; 1.54 + 1.55 +// const char *getCharsetName(int32_t index, UErrorCode& status) const; 1.56 + 1.57 + static int32_t getDetectableCount(); 1.58 + 1.59 + 1.60 + static UEnumeration * getAllDetectableCharsets(UErrorCode &status); 1.61 + UEnumeration * getDetectableCharsets(UErrorCode &status) const; 1.62 + void setDetectableCharset(const char *encoding, UBool enabled, UErrorCode &status); 1.63 +}; 1.64 + 1.65 +U_NAMESPACE_END 1.66 + 1.67 +#endif 1.68 +#endif /* __CSDETECT_H */