diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /intl/icu/source/i18n/csrecog.h | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'intl/icu/source/i18n/csrecog.h')
-rw-r--r-- | intl/icu/source/i18n/csrecog.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/intl/icu/source/i18n/csrecog.h b/intl/icu/source/i18n/csrecog.h new file mode 100644 index 0000000000..944a5007fe --- /dev/null +++ b/intl/icu/source/i18n/csrecog.h @@ -0,0 +1,57 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/* + ********************************************************************** + * Copyright (C) 2005-2012, International Business Machines + * Corporation and others. All Rights Reserved. + ********************************************************************** + */ + +#ifndef __CSRECOG_H +#define __CSRECOG_H + +#include "unicode/uobject.h" + +#if !UCONFIG_NO_CONVERSION + +#include "inputext.h" + +U_NAMESPACE_BEGIN + +class CharsetMatch; + +class CharsetRecognizer : public UMemory +{ + public: + /** + * Get the IANA name of this charset. + * Note that some recognizers can recognize more than one charset, but that this API + * assumes just one name per recognizer. + * TODO: need to account for multiple names in public API that enumerates over the + * known detectable charsets. + * @return the charset name. + */ + virtual const char *getName() const = 0; + + /** + * Get the ISO language code for this charset. + * @return the language code, or <code>null</code> if the language cannot be determined. + */ + virtual const char *getLanguage() const; + + /* + * Try the given input text against this Charset, and fill in the results object + * with the quality of the match plus other information related to the match. + * + * Return true if the the input bytes are a potential match, and + * false if the input data is not compatible with, or illegal in this charset. + */ + virtual UBool match(InputText *textIn, CharsetMatch *results) const = 0; + + virtual ~CharsetRecognizer(); +}; + +U_NAMESPACE_END + +#endif +#endif /* __CSRECOG_H */ |