michael@0: /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsHZToUnicode_h___ michael@0: #define nsHZToUnicode_h___ michael@0: michael@0: #include "nsUCSupport.h" michael@0: #include "nsGBKConvUtil.h" michael@0: michael@0: //---------------------------------------------------------------------- michael@0: // Class nsHZToUnicode [declaration] michael@0: michael@0: /** michael@0: * A character set converter from GBK to Unicode. michael@0: * michael@0: * michael@0: * @created 08/Sept/1999 michael@0: * @author Yueheng Xu, Yueheng.Xu@intel.com michael@0: */ michael@0: class nsHZToUnicode : public nsBufferDecoderSupport michael@0: { michael@0: public: michael@0: michael@0: /** michael@0: * Class constructor. michael@0: */ michael@0: nsHZToUnicode(); michael@0: michael@0: protected: michael@0: michael@0: //-------------------------------------------------------------------- michael@0: // Subclassing of nsDecoderSupport class [declaration] michael@0: NS_IMETHOD ConvertNoBuff(const char* aSrc, int32_t * aSrcLength, michael@0: char16_t *aDest, int32_t * aDestLength); michael@0: nsGBKConvUtil mUtil; michael@0: michael@0: private: michael@0: int16_t mHZState; michael@0: uint32_t mRunLength; // length of a run of 8-bit GB-encoded characters michael@0: char mOddByte; // first byte of a multi-byte sequence from a previous buffer michael@0: michael@0: }; michael@0: michael@0: #endif /* nsHZToUnicode_h___ */