• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • sources
  • kde-4.12
  • kdelibs
  • kdecore
  • localization
  • probers
nsUniversalDetector.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* -*- C++ -*-
3 * Copyright (C) 1998 <developer@mozilla.org>
4 * Copyright (C) 2008 <zealot.kai@gmail.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sublicense, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 */
25 
26 #ifndef nsUniversalDetector_h__
27 #define nsUniversalDetector_h__
28 
29 #include "nsCharSetProber.h"
30 
31 #define NUM_OF_CHARSET_PROBERS 3
32 
33 namespace kencodingprober {
34 typedef enum {
35  ePureAscii = 0,
36  eEscAscii = 1,
37  eHighbyte = 2
38 } nsInputState;
39 
40 class KDE_NO_EXPORT nsUniversalDetector: public nsCharSetProber {
41 public:
42  nsUniversalDetector();
43  virtual ~nsUniversalDetector();
44  nsProbingState HandleData(const char* aBuf, unsigned int aLen);
45  const char* GetCharSetName();
46  void Reset(void);
47  float GetConfidence(void);
48  nsProbingState GetState();
49  void SetOpion() {};
50 
51 protected:
52  nsInputState mInputState;
53  bool mDone;
54  bool mInTag;
55  bool mStart;
56  bool mGotData;
57  char mLastChar;
58  const char * mDetectedCharset;
59  int mBestGuess;
60 
61  nsCharSetProber *mCharSetProbers[NUM_OF_CHARSET_PROBERS];
62  nsCharSetProber *mEscCharSetProber;
63 };
64 }
65 
66 #endif
67 
KDE_NO_EXPORT
#define KDE_NO_EXPORT
The KDE_NO_EXPORT macro marks the symbol of the given variable to be hidden.
Definition: kdemacros.h.cmake:73
nsCharSetProber.h
kencodingprober::nsUniversalDetector::mGotData
bool mGotData
Definition: nsUniversalDetector.h:56
kencodingprober::nsUniversalDetector::mStart
bool mStart
Definition: nsUniversalDetector.h:55
kencodingprober::nsUniversalDetector::SetOpion
void SetOpion()
Definition: nsUniversalDetector.h:49
kencodingprober::nsInputState
nsInputState
Definition: nsUniversalDetector.h:34
kencodingprober::nsUniversalDetector::mEscCharSetProber
nsCharSetProber * mEscCharSetProber
Definition: nsUniversalDetector.h:62
NUM_OF_CHARSET_PROBERS
#define NUM_OF_CHARSET_PROBERS
Definition: nsUniversalDetector.h:31
kencodingprober::nsUniversalDetector::mDetectedCharset
const char * mDetectedCharset
Definition: nsUniversalDetector.h:58
kencodingprober::nsUniversalDetector::mBestGuess
int mBestGuess
Definition: nsUniversalDetector.h:59
kencodingprober::ePureAscii
Definition: nsUniversalDetector.h:35
kencodingprober::nsCharSetProber
Definition: nsCharSetProber.h:42
kencodingprober::nsUniversalDetector::mLastChar
char mLastChar
Definition: nsUniversalDetector.h:57
kencodingprober::eHighbyte
Definition: nsUniversalDetector.h:37
kencodingprober::nsProbingState
nsProbingState
Definition: nsCharSetProber.h:34
kencodingprober::nsUniversalDetector
Definition: nsUniversalDetector.h:40
kencodingprober::eEscAscii
Definition: nsUniversalDetector.h:36
kencodingprober::nsUniversalDetector::mInTag
bool mInTag
Definition: nsUniversalDetector.h:54
kencodingprober::nsUniversalDetector::mDone
bool mDone
Definition: nsUniversalDetector.h:53
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal