intl/icu/source/i18n/csrecog.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /*
     2  **********************************************************************
     3  *   Copyright (C) 2005-2012, International Business Machines
     4  *   Corporation and others.  All Rights Reserved.
     5  **********************************************************************
     6  */
     8 #ifndef __CSRECOG_H
     9 #define __CSRECOG_H
    11 #include "unicode/uobject.h"
    13 #if !UCONFIG_NO_CONVERSION
    15 #include "inputext.h"
    17 U_NAMESPACE_BEGIN
    19 class CharsetMatch;
    21 class CharsetRecognizer : public UMemory
    22 {
    23  public:
    24     /**
    25      * Get the IANA name of this charset.
    26      * Note that some recognizers can recognize more than one charset, but that this API
    27      * assumes just one name per recognizer.
    28      * TODO: need to account for multiple names in public API that enumerates over the
    29      *       known detectable charsets.
    30      * @return the charset name.
    31      */
    32     virtual const char *getName() const = 0;
    34     /**
    35      * Get the ISO language code for this charset.
    36      * @return the language code, or <code>null</code> if the language cannot be determined.
    37      */
    38     virtual const char *getLanguage() const;
    40     /*
    41      * Try the given input text against this Charset, and fill in the results object
    42      * with the quality of the match plus other information related to the match.
    43      *
    44      * Return TRUE if the the input bytes are a potential match, and
    45      * FALSE if the input data is not compatible with, or illegal in this charset.
    46      */
    47     virtual UBool match(InputText *textIn, CharsetMatch *results) const = 0;
    49     virtual ~CharsetRecognizer();
    50 };
    52 U_NAMESPACE_END
    54 #endif
    55 #endif /* __CSRECOG_H */

mercurial