]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/csrecog.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-2012, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 **********************************************************************
13 #include "unicode/uobject.h"
15 #if !UCONFIG_NO_CONVERSION
23 class CharsetRecognizer
: public UMemory
27 * Get the IANA name of this charset.
28 * Note that some recognizers can recognize more than one charset, but that this API
29 * assumes just one name per recognizer.
30 * TODO: need to account for multiple names in public API that enumerates over the
31 * known detectable charsets.
32 * @return the charset name.
34 virtual const char *getName() const = 0;
37 * Get the ISO language code for this charset.
38 * @return the language code, or <code>null</code> if the language cannot be determined.
40 virtual const char *getLanguage() const;
43 * Try the given input text against this Charset, and fill in the results object
44 * with the quality of the match plus other information related to the match.
46 * Return TRUE if the the input bytes are a potential match, and
47 * FALSE if the input data is not compatible with, or illegal in this charset.
49 virtual UBool
match(InputText
*textIn
, CharsetMatch
*results
) const = 0;
51 virtual ~CharsetRecognizer();
57 #endif /* __CSRECOG_H */