]> git.pld-linux.org Git - packages/xerces-c.git/blob - xerces-c-iso88592.patch
7f496b72609bc11b8bec4d498940e5a408efbfca
[packages/xerces-c.git] / xerces-c-iso88592.patch
1 diff -uNr xercesc/src/xercesc/util/Makefile.in xercesc/src/xercesc/util.new/Makefile.in
2 --- xercesc/src/xercesc/util/Makefile.in        Fri Feb  7 01:53:51 2003
3 +++ xercesc/src/xercesc/util.new/Makefile.in    Wed Apr 30 23:50:16 2003
4 @@ -506,7 +506,8 @@
5      XMLUTF8Transcoder.hpp \
6      XMLWin1252Transcoder.hpp \
7      XML256TableTranscoder.hpp \
8 -    XML88591Transcoder.hpp
9 +    XML88591Transcoder.hpp \
10 +    XML88592Transcoder.hpp
11  
12  UTIL/util_CPP_PRIVHEADERS =
13  
14 @@ -573,7 +574,8 @@
15      XMLUTF8Transcoder.$(TO) \
16      XMLWin1252Transcoder.$(TO) \
17      XML256TableTranscoder.$(TO) \
18 -    XML88591Transcoder.$(TO)
19 +    XML88591Transcoder.$(TO) \
20 +    XML88592Transcoder.$(TO)
21  
22  
23  all:: includes $(UTIL_CPP_OBJECTS) platforms transcoders \
24 diff -uNr xercesc/src/xercesc/util/TransService.cpp xercesc/src/xercesc/util.new/TransService.cpp
25 --- xercesc/src/xercesc/util/TransService.cpp   Fri Feb  7 01:54:05 2003
26 +++ xercesc/src/xercesc/util.new/TransService.cpp       Wed Apr 30 23:36:53 2003
27 @@ -64,6 +64,7 @@
28  #include <xercesc/util/RefHashTableOf.hpp>
29  #include <xercesc/util/RefVectorOf.hpp>
30  #include <xercesc/util/XML88591Transcoder.hpp>
31 +#include <xercesc/util/XML88592Transcoder.hpp>
32  #include <xercesc/util/XMLASCIITranscoder.hpp>
33  #include <xercesc/util/XMLChTranscoder.hpp>
34  #include <xercesc/util/XMLEBCDICTranscoder.hpp>
35 @@ -322,6 +323,22 @@
36      gMappings->put((void*)XMLUni::fgISO88591EncodingString12, new ENameMapFor<XML88591Transcoder>(XMLUni::fgISO88591EncodingString12));
37  
38      //
39 +    //  Add in our mappings for Latin2
40 +    //
41 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString));
42 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString2, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString2));
43 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString3, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString3));
44 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString4, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString4));
45 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString5, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString5));
46 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString6, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString6));
47 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString7, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString7));
48 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString8, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString8));
49 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString9, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString9));
50 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString10, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString10));
51 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString11, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString11));
52 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString12, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString12));
53 +
54 +    //
55      //  Add in our mappings for UTF-16 and UCS-4, little endian
56      //
57      bool swapped = false;
58 diff -uNr xercesc/src/xercesc/util/XML88592Transcoder.cpp xercesc/src/xercesc/util.new/XML88592Transcoder.cpp
59 --- xercesc/src/xercesc/util/XML88592Transcoder.cpp     Thu Jan  1 01:00:00 1970
60 +++ xercesc/src/xercesc/util.new/XML88592Transcoder.cpp Thu May  1 00:00:20 2003
61 @@ -0,0 +1,294 @@
62 +/*
63 + * The Apache Software License, Version 1.1
64 + *
65 + * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
66 + * reserved.
67 + *
68 + * Redistribution and use in source and binary forms, with or without
69 + * modification, are permitted provided that the following conditions
70 + * are met:
71 + *
72 + * 1. Redistributions of source code must retain the above copyright
73 + *    notice, this list of conditions and the following disclaimer.
74 + *
75 + * 2. Redistributions in binary form must reproduce the above copyright
76 + *    notice, this list of conditions and the following disclaimer in
77 + *    the documentation and/or other materials provided with the
78 + *    distribution.
79 + *
80 + * 3. The end-user documentation included with the redistribution,
81 + *    if any, must include the following acknowledgment:
82 + *       "This product includes software developed by the
83 + *        Apache Software Foundation (http://www.apache.org/)."
84 + *    Alternately, this acknowledgment may appear in the software itself,
85 + *    if and wherever such third-party acknowledgments normally appear.
86 + *
87 + * 4. The names "Xerces" and "Apache Software Foundation" must
88 + *    not be used to endorse or promote products derived from this
89 + *    software without prior written permission. For written
90 + *    permission, please contact apache\@apache.org.
91 + *
92 + * 5. Products derived from this software may not be called "Apache",
93 + *    nor may "Apache" appear in their name, without prior written
94 + *    permission of the Apache Software Foundation.
95 + *
96 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
97 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
98 + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
99 + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
100 + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
101 + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
102 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
103 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
104 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
105 + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
106 + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
107 + * SUCH DAMAGE.
108 + * ====================================================================
109 + *
110 + * This software consists of voluntary contributions made by many
111 + * individuals on behalf of the Apache Software Foundation, and was
112 + * originally based on software copyright (c) 1999, International
113 + * Business Machines, Inc., http://www.ibm.com .  For more information
114 + * on the Apache Software Foundation, please see
115 + * <http://www.apache.org/>.
116 + */
117 +
118 +
119 +// ---------------------------------------------------------------------------
120 +//  Includes
121 +// ---------------------------------------------------------------------------
122 +#include <xercesc/util/TranscodingException.hpp>
123 +#include <xercesc/util/XML88592Transcoder.hpp>
124 +#include <xercesc/util/XMLString.hpp>
125 +#include <string.h>
126 +
127 +XERCES_CPP_NAMESPACE_BEGIN
128 +
129 +static const char utf_iso8859_2[] ={
130 +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
131 +0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
132 +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
133 +0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,
134 +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,
135 +0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,
136 +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,
137 +0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
138 +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,
139 +0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,
140 +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,
141 +0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,
142 +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,
143 +0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,
144 +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,
145 +0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f,
146 +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,
147 +0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,
148 +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,
149 +0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f,
150 +0xa0,0x00,0x00,0x00,0xa4,0x00,0x00,0xa7,
151 +0xa8,0x00,0x00,0x00,0x00,0xad,0x00,0x00,
152 +0xb0,0x00,0x00,0x00,0xb4,0x00,0x00,0x00,
153 +0xb8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
154 +0x00,0xc1,0xc2,0x00,0xc4,0x00,0x00,0xc7,
155 +0x00,0xc9,0x00,0xcb,0x00,0xcd,0xce,0x00,
156 +0x00,0x00,0x00,0xd3,0xd4,0x00,0xd6,0xd7,
157 +0x00,0x00,0xda,0x00,0xdc,0xdd,0x00,0xdf,
158 +0x00,0xe1,0xe2,0x00,0xe4,0x00,0x00,0xe7,
159 +0x00,0xe9,0x00,0xeb,0x00,0xed,0xee,0x00,
160 +0x00,0x00,0x00,0xf3,0xf4,0x00,0xf6,0xf7,
161 +0x00,0x00,0xfa,0x00,0xfc,0xfd,0x00,0x00,
162 +0x00,0x00,0xc3,0xe3,0xa1,0xb1,0xc6,0xe6,
163 +0x00,0x00,0x00,0x00,0xc8,0xe8,0xcf,0xef,
164 +0xd0,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,
165 +0xca,0xea,0xcc,0xec,0x00,0x00,0x00,0x00,
166 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
167 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
168 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
169 +0x00,0xc5,0xe5,0x00,0x00,0xa5,0xb5,0x00,
170 +0x00,0xa3,0xb3,0xd1,0xf1,0x00,0x00,0xd2,
171 +0xf2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
172 +0xd5,0xf5,0x00,0x00,0xc0,0xe0,0x00,0x00,
173 +0xd8,0xf8,0xa6,0xb6,0x00,0x00,0xaa,0xba,
174 +0xa9,0xb9,0xde,0xfe,0xab,0xbb,0x00,0x00,
175 +0x00,0x00,0x00,0x00,0x00,0x00,0xd9,0xf9,
176 +0xdb,0xfb,0x00,0x00,0x00,0x00,0x00,0x00,
177 +0x00,0xac,0xbc,0xaf,0xbf,0xae,0xbe,0x00,
178 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
179 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
180 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
181 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
182 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
183 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
184 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
185 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
186 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
187 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
188 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
189 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
190 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
191 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
192 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
193 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
194 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
195 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
196 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
197 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
198 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
199 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
200 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
201 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
202 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
203 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
204 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
205 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
206 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
207 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
208 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
209 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
210 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
211 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
212 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
213 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
214 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
215 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
216 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
217 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
218 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb7,
219 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
220 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
221 +0xa2,0xff,0x00,0xb2,0x00,0xbd};
222 +
223 +// ---------------------------------------------------------------------------
224 +//  XML88592Transcoder: Constructors and Destructor
225 +// ---------------------------------------------------------------------------
226 +XML88592Transcoder::XML88592Transcoder( const   XMLCh* const    encodingName
227 +                                        , const unsigned int    blockSize) :
228 +
229 +    XMLTranscoder(encodingName, blockSize)
230 +{
231 +}
232 +
233 +
234 +XML88592Transcoder::~XML88592Transcoder()
235 +{
236 +}
237 +
238 +
239 +// ---------------------------------------------------------------------------
240 +//  XML88592Transcoder: Implementation of the transcoder API
241 +// ---------------------------------------------------------------------------
242 +unsigned int
243 +XML88592Transcoder::transcodeFrom(  const   XMLByte* const       srcData
244 +                                    , const unsigned int         srcCount
245 +                                    ,       XMLCh* const         toFill
246 +                                    , const unsigned int         maxChars
247 +                                    ,       unsigned int&        bytesEaten
248 +                                    ,       unsigned char* const charSizes)
249 +{
250 +    // If debugging, make sure that the block size is legal
251 +    #if defined(XERCES_DEBUG)
252 +    checkBlockSize(maxChars);
253 +    #endif
254 +
255 +    //
256 +    //  Calculate the max chars we can do here. Its the lesser of the
257 +    //  max output chars and the number of bytes in the source.
258 +    //
259 +    const unsigned int countToDo = srcCount < maxChars ? srcCount : maxChars;
260 +
261 +    //
262 +    //  Loop through the bytes to do and convert over each byte. Its just
263 +    //  a cast to the wide char type.
264 +    //
265 +    const XMLByte*  srcPtr = srcData;
266 +    XMLCh*          destPtr = toFill;
267 +    const XMLByte*  srcEnd = srcPtr + countToDo;
268 +    while (srcPtr < srcEnd)
269 +        *destPtr++ = XMLCh(*srcPtr++);
270 +
271 +    // Set the bytes eaten, and set the char size array to the fixed size
272 +    bytesEaten = countToDo;
273 +    memset(charSizes, 1, countToDo);
274 +
275 +    // Return the chars we transcoded
276 +    return countToDo;
277 +}
278 +
279 +
280 +unsigned int
281 +XML88592Transcoder::transcodeTo(const   XMLCh* const    srcData
282 +                                , const unsigned int    srcCount
283 +                                ,       XMLByte* const  toFill
284 +                                , const unsigned int    maxBytes
285 +                                ,       unsigned int&   charsEaten
286 +                                , const UnRepOpts       options)
287 +{
288 +    // If debugging, make sure that the block size is legal
289 +    #if defined(XERCES_DEBUG)
290 +    checkBlockSize(maxBytes);
291 +    #endif
292 +
293 +    //
294 +    //  Calculate the max chars we can do here. Its the lesser of the
295 +    //  max output bytes and the number of chars in the source.
296 +    //
297 +    const unsigned int countToDo = srcCount < maxBytes ? srcCount : maxBytes;
298 +
299 +    //
300 +    //  Loop through the bytes to do and convert over each byte. Its just
301 +    //  a downcast of the wide char, checking for unrepresentable chars.
302 +    //
303 +    const XMLCh*    srcPtr  = srcData;
304 +    const XMLCh*    srcEnd  = srcPtr + countToDo;
305 +    XMLByte*        destPtr = toFill;
306 +    while (srcPtr < srcEnd)
307 +    {
308 +        // If its legal, take it and jump back to top
309 +        if (*srcPtr == 0)
310 +        {
311 +            *destPtr++ = XMLByte(*srcPtr++);
312 +            continue;
313 +        } else if ((*srcPtr<sizeof(utf_iso8859_2)) && (utf_iso8859_2[*srcPtr]!=0))
314 +       {
315 +            *destPtr++ = XMLByte(utf_iso8859_2[*srcPtr++]);
316 +            continue;
317 +       }
318 +
319 +        //
320 +        //  Its not representable so use a replacement char. According to
321 +        //  the options, either throw or use the replacement.
322 +        //
323 +        if (options == UnRep_Throw)
324 +        {
325 +            XMLCh tmpBuf[16];
326 +            XMLString::binToText((unsigned int)*srcPtr, tmpBuf, 16, 16);
327 +            ThrowXML2
328 +            (
329 +                TranscodingException
330 +                , XMLExcepts::Trans_Unrepresentable
331 +                , tmpBuf
332 +                , getEncodingName()
333 +            );
334 +        }
335 +        *destPtr++ = 0x1A;
336 +        srcPtr++;
337 +    }
338 +
339 +    // Set the chars eaten
340 +    charsEaten = countToDo;
341 +
342 +    // Return the bytes we transcoded
343 +    return countToDo;
344 +}
345 +
346 +
347 +bool XML88592Transcoder::canTranscodeTo(const unsigned int toCheck) const
348 +{
349 +    if (toCheck>=sizeof(utf_iso8859_2))return false;
350 +    if (utf_iso8859_2[toCheck]!=0)return true;
351 +    if (toCheck==0)return true;
352 +    return false;
353 +}
354 +
355 +XERCES_CPP_NAMESPACE_END
356 diff -uNr xercesc/src/xercesc/util/XML88592Transcoder.hpp xercesc/src/xercesc/util.new/XML88592Transcoder.hpp
357 --- xercesc/src/xercesc/util/XML88592Transcoder.hpp     Thu Jan  1 01:00:00 1970
358 +++ xercesc/src/xercesc/util.new/XML88592Transcoder.hpp Wed Apr 30 23:41:04 2003
359 @@ -0,0 +1,127 @@
360 +/*
361 + * The Apache Software License, Version 1.1
362 + *
363 + * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
364 + * reserved.
365 + *
366 + * Redistribution and use in source and binary forms, with or without
367 + * modification, are permitted provided that the following conditions
368 + * are met:
369 + *
370 + * 1. Redistributions of source code must retain the above copyright
371 + *    notice, this list of conditions and the following disclaimer.
372 + *
373 + * 2. Redistributions in binary form must reproduce the above copyright
374 + *    notice, this list of conditions and the following disclaimer in
375 + *    the documentation and/or other materials provided with the
376 + *    distribution.
377 + *
378 + * 3. The end-user documentation included with the redistribution,
379 + *    if any, must include the following acknowledgment:
380 + *       "This product includes software developed by the
381 + *        Apache Software Foundation (http://www.apache.org/)."
382 + *    Alternately, this acknowledgment may appear in the software itself,
383 + *    if and wherever such third-party acknowledgments normally appear.
384 + *
385 + * 4. The names "Xerces" and "Apache Software Foundation" must
386 + *    not be used to endorse or promote products derived from this
387 + *    software without prior written permission. For written
388 + *    permission, please contact apache\@apache.org.
389 + *
390 + * 5. Products derived from this software may not be called "Apache",
391 + *    nor may "Apache" appear in their name, without prior written
392 + *    permission of the Apache Software Foundation.
393 + *
394 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
395 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
396 + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
397 + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
398 + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
399 + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
400 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
401 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
402 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
403 + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
404 + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
405 + * SUCH DAMAGE.
406 + * ====================================================================
407 + *
408 + * This software consists of voluntary contributions made by many
409 + * individuals on behalf of the Apache Software Foundation, and was
410 + * originally based on software copyright (c) 1999, International
411 + * Business Machines, Inc., http://www.ibm.com .  For more information
412 + * on the Apache Software Foundation, please see
413 + * <http://www.apache.org/>.
414 + */
415 +
416 +#ifndef XML88592TRANSCODER_HPP
417 +#define XML88592TRANSCODER_HPP
418 +
419 +#include <xercesc/util/XercesDefs.hpp>
420 +#include <xercesc/util/TransService.hpp>
421 +
422 +XERCES_CPP_NAMESPACE_BEGIN
423 +
424 +//
425 +//  This class provides an implementation of the XMLTranscoder interface
426 +//  for a simple 8859-1 transcoder. The parser does some encodings
427 +//  intrinsically without depending upon external transcoding services.
428 +//  To make everything more orthagonal, we implement these internal
429 +//  transcoders using the same transcoder abstraction as the pluggable
430 +//  transcoding services do.
431 +//
432 +class XMLUTIL_EXPORT XML88592Transcoder : public XMLTranscoder
433 +{
434 +public :
435 +    // -----------------------------------------------------------------------
436 +    //  Public constructors and destructor
437 +    // -----------------------------------------------------------------------
438 +    XML88592Transcoder
439 +    (
440 +        const   XMLCh* const    encodingName
441 +        , const unsigned int    blockSize
442 +    );
443 +
444 +    virtual ~XML88592Transcoder();
445 +
446 +
447 +    // -----------------------------------------------------------------------
448 +    //  Implementation of the XMLTranscoder interface
449 +    // -----------------------------------------------------------------------
450 +    virtual unsigned int transcodeFrom
451 +    (
452 +        const   XMLByte* const          srcData
453 +        , const unsigned int            srcCount
454 +        ,       XMLCh* const            toFill
455 +        , const unsigned int            maxChars
456 +        ,       unsigned int&           bytesEaten
457 +        ,       unsigned char* const    charSizes
458 +    );
459 +
460 +    virtual unsigned int transcodeTo
461 +    (
462 +        const   XMLCh* const    srcData
463 +        , const unsigned int    srcCount
464 +        ,       XMLByte* const  toFill
465 +        , const unsigned int    maxBytes
466 +        ,       unsigned int&   charsEaten
467 +        , const UnRepOpts       options
468 +    );
469 +
470 +    virtual bool canTranscodeTo
471 +    (
472 +        const   unsigned int    toCheck
473 +    )   const;
474 +
475 +
476 +private :
477 +    // -----------------------------------------------------------------------
478 +    //  Unimplemented constructors and operators
479 +    // -----------------------------------------------------------------------
480 +    XML88592Transcoder(const XML88592Transcoder&);
481 +    void operator=(const XML88592Transcoder&);
482 +};
483 +
484 +XERCES_CPP_NAMESPACE_END
485 +
486 +#endif
487 diff -uNr xercesc/src/xercesc/util/XMLUni.cpp xercesc/src/xercesc/util.new/XMLUni.cpp
488 --- xercesc/src/xercesc/util/XMLUni.cpp Fri Feb  7 01:54:07 2003
489 +++ xercesc/src/xercesc/util.new/XMLUni.cpp     Wed Apr 30 23:39:59 2003
490 @@ -283,6 +283,66 @@
491      chLatin_L, chDigit_1, chNull
492  };
493  
494 +const XMLCh XMLUni::fgISO88592EncodingString[] =
495 +{
496 +    chLatin_I, chLatin_S, chLatin_O, chDigit_8, chDigit_8, chDigit_5, chDigit_9, chDash, chDigit_2, chNull
497 +};
498 +
499 +const XMLCh XMLUni::fgISO88592EncodingString2[] =
500 +{
501 +    chLatin_I, chLatin_S, chLatin_O, chDash, chDigit_8, chDigit_8, chDigit_5, chDigit_9, chDash, chDigit_2, chNull
502 +};
503 +
504 +const XMLCh XMLUni::fgISO88592EncodingString3[] =
505 +{
506 +    chLatin_I, chLatin_S, chLatin_O, chUnderscore, chDigit_8, chDigit_8, chDigit_5, chDigit_9, chDash, chDigit_2, chNull
507 +};
508 +
509 +const XMLCh XMLUni::fgISO88592EncodingString4[] =
510 +{
511 +    chLatin_I, chLatin_B, chLatin_M, chDash, chDigit_9, chDigit_1, chDigit_2, chNull
512 +};
513 +
514 +const XMLCh XMLUni::fgISO88592EncodingString5[] =
515 +{
516 +    chLatin_I, chLatin_B, chLatin_M, chDigit_9, chDigit_1, chDigit_2, chNull
517 +};
518 +
519 +const XMLCh XMLUni::fgISO88592EncodingString6[] =
520 +{
521 +    chLatin_L, chLatin_A, chLatin_T, chLatin_I, chLatin_N, chDigit_2, chNull
522 +};
523 +
524 +const XMLCh XMLUni::fgISO88592EncodingString7[] =
525 +{
526 +    chLatin_L, chLatin_A, chLatin_T, chLatin_I, chLatin_N, chDash, chDigit_2, chNull
527 +};
528 +
529 +const XMLCh XMLUni::fgISO88592EncodingString8[] =
530 +{
531 +    chLatin_L, chLatin_A, chLatin_T, chLatin_I, chLatin_N, chUnderscore, chDigit_2, chNull
532 +};
533 +
534 +const XMLCh XMLUni::fgISO88592EncodingString9[] =
535 +{
536 +    chLatin_C, chLatin_P, chDigit_9, chDigit_1, chDigit_2, chNull
537 +};
538 +
539 +const XMLCh XMLUni::fgISO88592EncodingString10[] =
540 +{
541 +    chLatin_C, chLatin_S, chLatin_I, chLatin_S, chLatin_O, chLatin_L, chLatin_A, chLatin_T, chLatin_I, chLatin_N, chDigit_2, chNull
542 +};
543 +
544 +const XMLCh XMLUni::fgISO88592EncodingString11[] =
545 +{
546 +    chLatin_I, chLatin_S, chLatin_O, chDash, chLatin_I, chLatin_R, chDash, chDigit_2, chDigit_0, chDigit_0, chNull
547 +};
548 +
549 +const XMLCh XMLUni::fgISO88592EncodingString12[] =
550 +{
551 +    chLatin_L, chDigit_2, chNull
552 +};
553 +
554  const XMLCh XMLUni::fgLocalHostString[] =
555  {
556      chLatin_l, chLatin_o, chLatin_c, chLatin_a, chLatin_l, chLatin_h, chLatin_o, chLatin_s, chLatin_t, chNull
557 diff -uNr xercesc/src/xercesc/util/XMLUni.hpp xercesc/src/xercesc/util.new/XMLUni.hpp
558 --- xercesc/src/xercesc/util/XMLUni.hpp Fri Feb  7 01:54:07 2003
559 +++ xercesc/src/xercesc/util.new/XMLUni.hpp     Wed Apr 30 23:37:19 2003
560 @@ -123,6 +123,18 @@
561      static const XMLCh fgISO88591EncodingString10[];
562      static const XMLCh fgISO88591EncodingString11[];
563      static const XMLCh fgISO88591EncodingString12[];
564 +    static const XMLCh fgISO88592EncodingString[];
565 +    static const XMLCh fgISO88592EncodingString2[];
566 +    static const XMLCh fgISO88592EncodingString3[];
567 +    static const XMLCh fgISO88592EncodingString4[];
568 +    static const XMLCh fgISO88592EncodingString5[];
569 +    static const XMLCh fgISO88592EncodingString6[];
570 +    static const XMLCh fgISO88592EncodingString7[];
571 +    static const XMLCh fgISO88592EncodingString8[];
572 +    static const XMLCh fgISO88592EncodingString9[];
573 +    static const XMLCh fgISO88592EncodingString10[];
574 +    static const XMLCh fgISO88592EncodingString11[];
575 +    static const XMLCh fgISO88592EncodingString12[];
576      static const XMLCh fgLocalHostString[];
577      static const XMLCh fgNoString[];
578      static const XMLCh fgNotationString[];
This page took 0.333967 seconds and 2 git commands to generate.