ICU 4.8.1.1
4.8.1.1
|
00001 /* 00002 ********************************************************************** 00003 * Copyright (C) 2005-2010, International Business Machines 00004 * Corporation and others. All Rights Reserved. 00005 ********************************************************************** 00006 * file name: ucsdet.h 00007 * encoding: US-ASCII 00008 * indentation:4 00009 * 00010 * created on: 2005Aug04 00011 * created by: Andy Heninger 00012 * 00013 * ICU Character Set Detection, API for C 00014 * 00015 * Draft version 18 Oct 2005 00016 * 00017 */ 00018 00019 #ifndef __UCSDET_H 00020 #define __UCSDET_H 00021 00022 #include "unicode/utypes.h" 00023 00024 #if !UCONFIG_NO_CONVERSION 00025 00026 #include "unicode/localpointer.h" 00027 #include "unicode/uenum.h" 00028 00049 struct UCharsetDetector; 00054 typedef struct UCharsetDetector UCharsetDetector; 00055 00056 struct UCharsetMatch; 00062 typedef struct UCharsetMatch UCharsetMatch; 00063 00072 U_STABLE UCharsetDetector * U_EXPORT2 00073 ucsdet_open(UErrorCode *status); 00074 00084 U_STABLE void U_EXPORT2 00085 ucsdet_close(UCharsetDetector *ucsd); 00086 00087 #if U_SHOW_CPLUSPLUS_API 00088 00089 U_NAMESPACE_BEGIN 00090 00100 U_DEFINE_LOCAL_OPEN_POINTER(LocalUCharsetDetectorPointer, UCharsetDetector, ucsdet_close); 00101 00102 U_NAMESPACE_END 00103 00104 #endif 00105 00121 U_STABLE void U_EXPORT2 00122 ucsdet_setText(UCharsetDetector *ucsd, const char *textIn, int32_t len, UErrorCode *status); 00123 00124 00143 U_STABLE void U_EXPORT2 00144 ucsdet_setDeclaredEncoding(UCharsetDetector *ucsd, const char *encoding, int32_t length, UErrorCode *status); 00145 00146 00172 U_STABLE const UCharsetMatch * U_EXPORT2 00173 ucsdet_detect(UCharsetDetector *ucsd, UErrorCode *status); 00174 00175 00206 U_STABLE const UCharsetMatch ** U_EXPORT2 00207 ucsdet_detectAll(UCharsetDetector *ucsd, int32_t *matchesFound, UErrorCode *status); 00208 00209 00210 00226 U_STABLE const char * U_EXPORT2 00227 ucsdet_getName(const UCharsetMatch *ucsm, UErrorCode *status); 00228 00252 U_STABLE int32_t U_EXPORT2 00253 ucsdet_getConfidence(const UCharsetMatch *ucsm, UErrorCode *status); 00254 00284 U_STABLE const char * U_EXPORT2 00285 ucsdet_getLanguage(const UCharsetMatch *ucsm, UErrorCode *status); 00286 00287 00310 U_STABLE int32_t U_EXPORT2 00311 ucsdet_getUChars(const UCharsetMatch *ucsm, 00312 UChar *buf, int32_t cap, UErrorCode *status); 00313 00314 00315 00335 U_STABLE UEnumeration * U_EXPORT2 00336 ucsdet_getAllDetectableCharsets(const UCharsetDetector *ucsd, UErrorCode *status); 00337 00338 00349 U_STABLE UBool U_EXPORT2 00350 ucsdet_isInputFilterEnabled(const UCharsetDetector *ucsd); 00351 00352 00364 U_STABLE UBool U_EXPORT2 00365 ucsdet_enableInputFilter(UCharsetDetector *ucsd, UBool filter); 00366 00367 #endif 00368 #endif /* __UCSDET_H */ 00369 00370