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: #ifndef nsUnicodeDecodeHelper_h__ michael@0: #define nsUnicodeDecodeHelper_h__ michael@0: michael@0: #include "nsError.h" michael@0: #include "uconvutil.h" michael@0: //---------------------------------------------------------------------- michael@0: // Class nsUnicodeDecodeHelper [declaration] michael@0: michael@0: /** michael@0: * michael@0: * @created 18/Mar/1998 michael@0: * @author Catalin Rotaru [CATA] michael@0: */ michael@0: class nsUnicodeDecodeHelper michael@0: { michael@0: public: michael@0: /** michael@0: * Converts data using a lookup table and optional shift table michael@0: */ michael@0: static nsresult ConvertByTable(const char * aSrc, int32_t * aSrcLength, michael@0: char16_t * aDest, int32_t * aDestLength, michael@0: uScanClassID aScanClass, michael@0: uShiftInTable * aShiftInTable, michael@0: uMappingTable * aMappingTable, michael@0: bool aErrorSignal = false); michael@0: michael@0: /** michael@0: * Converts data using a set of lookup tables. michael@0: */ michael@0: static nsresult ConvertByMultiTable(const char * aSrc, int32_t * aSrcLength, michael@0: char16_t * aDest, int32_t * aDestLength, int32_t aTableCount, michael@0: const uRange * aRangeArray, uScanClassID * aScanClassArray, michael@0: uMappingTable ** aMappingTable, bool aErrorSignal = false); michael@0: michael@0: /** michael@0: * Converts data using a fast lookup table. michael@0: */ michael@0: static nsresult ConvertByFastTable(const char * aSrc, int32_t * aSrcLength, michael@0: char16_t * aDest, int32_t * aDestLength, const char16_t * aFastTable, michael@0: int32_t aTableSize, bool aErrorSignal); michael@0: michael@0: /** michael@0: * Create a cache-like fast lookup table from a normal one. michael@0: */ michael@0: static nsresult CreateFastTable(uMappingTable * aMappingTable, michael@0: char16_t * aFastTable, int32_t aTableSize); michael@0: }; michael@0: michael@0: #endif // nsUnicodeDecodeHelper_h__ michael@0: michael@0: