1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/extensions/universalchardet/src/base/nsMBCSGroupProber.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,46 @@ 1.4 +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsMBCSGroupProber_h__ 1.10 +#define nsMBCSGroupProber_h__ 1.11 + 1.12 +#include "nsSJISProber.h" 1.13 +#include "nsUTF8Prober.h" 1.14 +#include "nsEUCJPProber.h" 1.15 +#include "nsGB2312Prober.h" 1.16 +#include "nsEUCKRProber.h" 1.17 +#include "nsBig5Prober.h" 1.18 +#include "nsEUCTWProber.h" 1.19 + 1.20 +#define NUM_OF_PROBERS 7 1.21 + 1.22 +class nsMBCSGroupProber: public nsCharSetProber { 1.23 +public: 1.24 + nsMBCSGroupProber(uint32_t aLanguageFilter); 1.25 + virtual ~nsMBCSGroupProber(); 1.26 + nsProbingState HandleData(const char* aBuf, uint32_t aLen); 1.27 + const char* GetCharSetName(); 1.28 + nsProbingState GetState(void) {return mState;} 1.29 + void Reset(void); 1.30 + float GetConfidence(void); 1.31 + 1.32 +#ifdef DEBUG_chardet 1.33 + void DumpStatus(); 1.34 +#endif 1.35 +#ifdef DEBUG_jgmyers 1.36 + void GetDetectorState(nsUniversalDetector::DetectorState (&states)[nsUniversalDetector::NumDetectors], uint32_t &offset); 1.37 +#endif 1.38 + 1.39 +protected: 1.40 + nsProbingState mState; 1.41 + nsCharSetProber* mProbers[NUM_OF_PROBERS]; 1.42 + bool mIsActive[NUM_OF_PROBERS]; 1.43 + int32_t mBestGuess; 1.44 + uint32_t mActiveNum; 1.45 + uint32_t mKeepNext; 1.46 +}; 1.47 + 1.48 +#endif /* nsMBCSGroupProber_h__ */ 1.49 +