KDECore
kencodingprober.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KENCODINGPROBER_H
00023 #define KENCODINGPROBER_H
00024
00025
00026
00027
00028 #include <kdecore_export.h>
00029 #ifdef DEBUG_PROBE
00030 #include <kdebug.h>
00031 #endif
00032 #include <QtCore/QString>
00033
00034 class KEncodingProberPrivate;
00035
00067 class KDECORE_EXPORT KEncodingProber
00068 {
00069 public:
00070
00071 enum ProberState {
00072 FoundIt,
00073 NotMe,
00074 Probing
00075 };
00076
00077 enum ProberType {
00078 None,
00079 Universal,
00080 Arabic,
00081 Baltic,
00082 CentralEuropean,
00083 ChineseSimplified,
00084 ChineseTraditional,
00085 Cyrillic,
00086 Greek,
00087 Hebrew,
00088 Japanese,
00089 Korean,
00090 NorthernSaami,
00091 Other,
00092 SouthEasternEurope,
00093 Thai,
00094 Turkish,
00095 Unicode,
00096 WesternEuropean
00097 };
00098
00102 KEncodingProber(ProberType proberType=Universal);
00103
00104 ~KEncodingProber();
00105
00109 void reset();
00110
00118 ProberState feed(const QByteArray &data);
00119 ProberState feed(const char* data, int len);
00120
00125 ProberState state() const;
00126
00132 KDE_DEPRECATED const char* encodingName() const;
00133
00138 QByteArray encoding() const;
00139
00143 float confidence() const;
00144
00145 ProberType proberType() const;
00146
00150 void setProberType(ProberType proberType);
00151
00155 static ProberType proberTypeForName(const QString& lang);
00156
00160 static QString nameForProberType(ProberType proberType);
00161
00162 private:
00163 KEncodingProberPrivate* const d;
00164 };
00165
00166 #endif