~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/intl/uconv/ucvlatin/nsUTF32ToUnicode.h

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 
2
/* vim:expandtab:shiftwidth=2:tabstop=2:
 
3
 */
 
4
/* ***** BEGIN LICENSE BLOCK *****
 
5
 * Version: NPL 1.1/GPL 2.0/LGPL 2.1
 
6
 *
 
7
 * The contents of this file are subject to the Netscape Public License
 
8
 * Version 1.1 (the "License"); you may not use this file except in
 
9
 * compliance with the License. You may obtain a copy of the License at
 
10
 * http://www.mozilla.org/NPL/
 
11
 *
 
12
 * Software distributed under the License is distributed on an "AS IS" basis,
 
13
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
14
 * for the specific language governing rights and limitations under the
 
15
 * License.
 
16
 *
 
17
 * The Original Code is Mozilla Communicator client code.
 
18
 *
 
19
 * The Initial Developer of the Original Code is 
 
20
 * Netscape Communications Corporation.
 
21
 * Portions created by the Initial Developer are Copyright (C) 1998
 
22
 * the Initial Developer. All Rights Reserved.
 
23
 *
 
24
 * Contributor(s): Jungshik Shin <jshin@mailaps.org>
 
25
 *
 
26
 *
 
27
 * Alternatively, the contents of this file may be used under the terms of
 
28
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 
29
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
30
 * in which case the provisions of the GPL or the LGPL are applicable instead
 
31
 * of those above. If you wish to allow use of your version of this file only
 
32
 * under the terms of either the GPL or the LGPL, and not to allow others to
 
33
 * use your version of this file under the terms of the NPL, indicate your
 
34
 * decision by deleting the provisions above and replace them with the notice
 
35
 * and other provisions required by the GPL or the LGPL. If you do not delete
 
36
 * the provisions above, a recipient may use your version of this file under
 
37
 * the terms of any one of the NPL, the GPL or the LGPL.
 
38
 *
 
39
 * ***** END LICENSE BLOCK ***** */
 
40
 
 
41
#ifndef nsUTF32ToUnicode_h___
 
42
#define nsUTF32ToUnicode_h___
 
43
 
 
44
//----------------------------------------------------------------------
 
45
// Class nsUTF32ToUnicode [declaration]  
 
46
 
 
47
/**
 
48
 * A character set converter from UTF32 to Unicode.
 
49
 * The base class for UTF32BE/UTF32LE to Unicode converters.
 
50
 * @created         08/Dec/2002
 
51
 * @author  Jungshik Shin
 
52
 */
 
53
 
 
54
class nsUTF32ToUnicode : public nsBasicDecoderSupport
 
55
{
 
56
 
 
57
public:
 
58
 
 
59
  /**
 
60
   * Class constructor.
 
61
   */
 
62
  nsUTF32ToUnicode();
 
63
 
 
64
protected:
 
65
 
 
66
  // the number of additional bytes to read to complete an incomplete UTF-32 4byte seq.
 
67
  PRUint16 mState;  
 
68
  // buffer for an incomplete UTF-32 sequence. 
 
69
  PRUint8  mBufferInc[4];
 
70
 
 
71
  //--------------------------------------------------------------------
 
72
  // Subclassing of nsBasicDecoderSupport class [declaration]
 
73
 
 
74
  NS_IMETHOD GetMaxLength(const char * aSrc, PRInt32 aSrcLength, 
 
75
                          PRInt32 * aDestLength);
 
76
 
 
77
  NS_IMETHOD Reset();
 
78
 
 
79
};
 
80
 
 
81
//----------------------------------------------------------------------
 
82
// Class nsUTF32BEToUnicode [declaration]  
 
83
 
 
84
/**
 
85
 * A character set converter from UTF32BE to Unicode.
 
86
 * A subclass of UTF32ToUnicode.
 
87
 * @created         08/Dec/2002
 
88
 * @author  Jungshik Shin
 
89
 */
 
90
 
 
91
class nsUTF32BEToUnicode : public nsUTF32ToUnicode
 
92
{
 
93
public:
 
94
 
 
95
 
 
96
  //--------------------------------------------------------------------
 
97
  // Subclassing of nsBasicDecoderSupport class [declaration]
 
98
 
 
99
  NS_IMETHOD Convert(const char * aSrc, PRInt32 * aSrcLength, 
 
100
                     PRUnichar * aDest, PRInt32 * aDestLength);
 
101
 
 
102
 
 
103
};
 
104
 
 
105
//----------------------------------------------------------------------
 
106
// Class nsUTF32LEToUnicode [declaration]  
 
107
 
 
108
/**
 
109
 * A character set converter from UTF32LE to Unicode.
 
110
 * A subclass of UTF32ToUnicode.
 
111
 * @created         08/Dec/2002
 
112
 * @author  Jungshik Shin
 
113
 */
 
114
 
 
115
class nsUTF32LEToUnicode : public nsUTF32ToUnicode
 
116
{
 
117
public:
 
118
 
 
119
 
 
120
  //--------------------------------------------------------------------
 
121
  // Subclassing of nsBasicDecoderSupport class [declaration]
 
122
 
 
123
  NS_IMETHOD Convert(const char * aSrc, PRInt32 * aSrcLength, 
 
124
                     PRUnichar * aDest, PRInt32 * aDestLength);
 
125
 
 
126
};
 
127
 
 
128
#endif /* nsUTF32ToUnicode_h___ */
 
129