|
ICU 73.2
73.2
|
00001 // © 2016 and later: Unicode, Inc. and others. 00002 // License & terms of use: http://www.unicode.org/copyright.html 00003 /* 00004 ********************************************************************** 00005 * Copyright (C) 2005-2013, International Business Machines 00006 * Corporation and others. All Rights Reserved. 00007 ********************************************************************** 00008 * file name: ucsdet.h 00009 * encoding: UTF-8 00010 * indentation:4 00011 * 00012 * created on: 2005Aug04 00013 * created by: Andy Heninger 00014 * 00015 * ICU Character Set Detection, API for C 00016 * 00017 * Draft version 18 Oct 2005 00018 * 00019 */ 00020 00021 #ifndef __UCSDET_H 00022 #define __UCSDET_H 00023 00024 #include "unicode/utypes.h" 00025 00026 #if !UCONFIG_NO_CONVERSION 00027 00028 #include "unicode/uenum.h" 00029 00030 #if U_SHOW_CPLUSPLUS_API 00031 #include "unicode/localpointer.h" 00032 #endif // U_SHOW_CPLUSPLUS_API 00033 00058 struct UCharsetDetector; 00063 typedef struct UCharsetDetector UCharsetDetector; 00064 00065 struct UCharsetMatch; 00071 typedef struct UCharsetMatch UCharsetMatch; 00072 00081 U_CAPI UCharsetDetector * U_EXPORT2 00082 ucsdet_open(UErrorCode *status); 00083 00093 U_CAPI void U_EXPORT2 00094 ucsdet_close(UCharsetDetector *ucsd); 00095 00096 #if U_SHOW_CPLUSPLUS_API 00097 00098 U_NAMESPACE_BEGIN 00099 00109 U_DEFINE_LOCAL_OPEN_POINTER(LocalUCharsetDetectorPointer, UCharsetDetector, ucsdet_close); 00110 00111 U_NAMESPACE_END 00112 00113 #endif 00114 00130 U_CAPI void U_EXPORT2 00131 ucsdet_setText(UCharsetDetector *ucsd, const char *textIn, int32_t len, UErrorCode *status); 00132 00133 00152 U_CAPI void U_EXPORT2 00153 ucsdet_setDeclaredEncoding(UCharsetDetector *ucsd, const char *encoding, int32_t length, UErrorCode *status); 00154 00155 00181 U_CAPI const UCharsetMatch * U_EXPORT2 00182 ucsdet_detect(UCharsetDetector *ucsd, UErrorCode *status); 00183 00184 00215 U_CAPI const UCharsetMatch ** U_EXPORT2 00216 ucsdet_detectAll(UCharsetDetector *ucsd, int32_t *matchesFound, UErrorCode *status); 00217 00218 00219 00235 U_CAPI const char * U_EXPORT2 00236 ucsdet_getName(const UCharsetMatch *ucsm, UErrorCode *status); 00237 00261 U_CAPI int32_t U_EXPORT2 00262 ucsdet_getConfidence(const UCharsetMatch *ucsm, UErrorCode *status); 00263 00293 U_CAPI const char * U_EXPORT2 00294 ucsdet_getLanguage(const UCharsetMatch *ucsm, UErrorCode *status); 00295 00296 00319 U_CAPI int32_t U_EXPORT2 00320 ucsdet_getUChars(const UCharsetMatch *ucsm, 00321 UChar *buf, int32_t cap, UErrorCode *status); 00322 00323 00324 00353 U_CAPI UEnumeration * U_EXPORT2 00354 ucsdet_getAllDetectableCharsets(const UCharsetDetector *ucsd, UErrorCode *status); 00355 00367 U_CAPI UBool U_EXPORT2 00368 ucsdet_isInputFilterEnabled(const UCharsetDetector *ucsd); 00369 00370 00382 U_CAPI UBool U_EXPORT2 00383 ucsdet_enableInputFilter(UCharsetDetector *ucsd, UBool filter); 00384 00385 #ifndef U_HIDE_INTERNAL_API 00386 00399 U_CAPI UEnumeration * U_EXPORT2 00400 ucsdet_getDetectableCharsets(const UCharsetDetector *ucsd, UErrorCode *status); 00401 00415 U_CAPI void U_EXPORT2 00416 ucsdet_setDetectableCharset(UCharsetDetector *ucsd, const char *encoding, UBool enabled, UErrorCode *status); 00417 #endif /* U_HIDE_INTERNAL_API */ 00418 00419 #endif 00420 #endif /* __UCSDET_H */ 00421 00422
1.7.6.1