intl/uconv/util/nsUnicodeDecodeHelper.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/uconv/util/nsUnicodeDecodeHelper.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,55 @@
     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 +#ifndef nsUnicodeDecodeHelper_h__
     1.9 +#define nsUnicodeDecodeHelper_h__
    1.10 +
    1.11 +#include "nsError.h"
    1.12 +#include "uconvutil.h"
    1.13 +//----------------------------------------------------------------------
    1.14 +// Class nsUnicodeDecodeHelper [declaration]
    1.15 +
    1.16 +/**
    1.17 + *
    1.18 + * @created         18/Mar/1998
    1.19 + * @author  Catalin Rotaru [CATA]
    1.20 + */
    1.21 +class nsUnicodeDecodeHelper
    1.22 +{
    1.23 +public:
    1.24 +  /**
    1.25 +   * Converts data using a lookup table and optional shift table
    1.26 +   */
    1.27 +  static nsresult ConvertByTable(const char * aSrc, int32_t * aSrcLength, 
    1.28 +                                 char16_t * aDest, int32_t * aDestLength,
    1.29 +                                 uScanClassID aScanClass,
    1.30 +                                 uShiftInTable * aShiftInTable,
    1.31 +                                 uMappingTable  * aMappingTable,
    1.32 +                                 bool aErrorSignal = false);
    1.33 +
    1.34 +  /**
    1.35 +   * Converts data using a set of lookup tables.
    1.36 +   */
    1.37 +  static nsresult ConvertByMultiTable(const char * aSrc, int32_t * aSrcLength,
    1.38 +      char16_t * aDest, int32_t * aDestLength, int32_t aTableCount, 
    1.39 +      const uRange * aRangeArray, uScanClassID * aScanClassArray,
    1.40 +      uMappingTable ** aMappingTable, bool aErrorSignal = false);
    1.41 +
    1.42 +  /**
    1.43 +   * Converts data using a fast lookup table.
    1.44 +   */
    1.45 +  static nsresult ConvertByFastTable(const char * aSrc, int32_t * aSrcLength, 
    1.46 +      char16_t * aDest, int32_t * aDestLength, const char16_t * aFastTable, 
    1.47 +      int32_t aTableSize, bool aErrorSignal);
    1.48 +
    1.49 +  /**
    1.50 +   * Create a cache-like fast lookup table from a normal one.
    1.51 +   */
    1.52 +  static nsresult CreateFastTable(uMappingTable * aMappingTable,
    1.53 +      char16_t * aFastTable,  int32_t aTableSize);
    1.54 +};
    1.55 +
    1.56 +#endif // nsUnicodeDecodeHelper_h__
    1.57 +
    1.58 +

mercurial