Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

XalanTranscodingServices.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #if !defined(XALANTRANSCODINGSERVICES_HEADER_GUARD_1357924680)
17 #define XALANTRANSCODINGSERVICES_HEADER_GUARD_1357924680
18 
19 
20 
21 // Base include file. Must be first.
23 
24 
25 
26 #include <cassert>
27 
28 
29 
32 
33 
34 
35 XALAN_CPP_NAMESPACE_BEGIN
36 
37 
38 
40 
41 
42 
44 {
45 public:
46 
50  static void
51  initialize(MemoryManagerType& theManager);
52 
56  static void
57  terminate();
58 
59  typedef unsigned char XalanXMLByte;
60  typedef unsigned int size_type;
61  typedef unsigned int UnicodeCharType;
62 
63  static size_type
64  length(const XalanXMLByte* theBytes)
65  {
66  assert(theBytes != 0);
67 
68  size_type i = 0;
69 
70  while(theBytes[i] != 0)
71  {
72  ++i;
73  }
74 
75  return i;
76  }
77 
78  enum eCode
79  {
80  OK,
83  SupportFilesNotFound
84  };
85 
86 
96  static XalanOutputTranscoder*
97  makeNewTranscoder(
98  MemoryManagerType& theManager,
99  const XalanDOMString& theEncodingName,
100  eCode& theResult,
101  size_type theBlockSize);
102 
108  static void
109  destroyTranscoder(XalanOutputTranscoder* theTranscoder);
110 
117  static bool
118  encodingIsUTF8(const XalanDOMChar* theEncodingName);
119 
126  static bool
127  encodingIsUTF8(const XalanDOMString& theEncodingName);
128 
135  static bool
136  encodingIsUTF16(const XalanDOMChar* theEncodingName);
137 
144  static bool
145  encodingIsUTF16(const XalanDOMString& theEncodingName);
146 
153  static bool
154  encodingIsUTF32(const XalanDOMChar* theEncodingName);
155 
162  static bool
163  encodingIsUTF32(const XalanDOMString& theEncodingName);
175  static const XalanXMLByte*
176  getStreamProlog(const XalanDOMString& theEncodingName);
177 
184  static XalanDOMChar
185  getMaximumCharacterValue(const XalanDOMString& theEncoding);
186 
195  static XalanDOMChar
196  getMaximumCharacterValue();
197 
205  static bool
206  getBytesEqualChars(const XalanDOMString& theEncoding);
207 
208  static bool
210  {
211  // Yuck!! See getMaximumCharacterValue() for more details.
212  return theChar <= 0x7fu ? true : false;
213  }
214 
215  static const XalanDOMChar s_utf8String[];
216 
217  static const XalanDOMChar s_utf16String[];
218 
219  static const XalanDOMChar s_utf16LEString[];
220 
221  static const XalanDOMChar s_utf16BEString[];
222 
223  static const XalanDOMChar s_utf32String[];
224 
225  static const XalanDOMChar s_asciiString[];
226 
227  static const XalanDOMChar s_usASCIIString[];
228 
229  static const XalanDOMChar s_windows1250String[];
230 
231  static const XalanDOMChar s_iso88591String[];
232 
233  static const XalanDOMChar s_shiftJISString[];
234 
235 
237  {
238  public:
239 
241  UnicodeCharType theCharacter,
242  const XalanDOMString& theEncoding,
243  XalanDOMString& theBuffer);
244 
245  virtual
247 
249  getCharacter() const
250  {
251  return m_badCharacter;
252  }
253 
254  const XalanDOMString&
255  getEncoding() const
256  {
257  return m_encoding;
258  }
259 
260  virtual const XalanDOMChar*
261  getType() const
262  {
263  return m_type;
264  }
265 
266  private:
267  // not implemented
269 
270  static const XalanDOMChar m_type[];
271 
272 
273  const UnicodeCharType m_badCharacter;
274 
275  const XalanDOMString m_encoding;
276  };
277 
278 private:
279 
280  static const XalanXMLByte s_dummyByteOrderMark[];
281  static const XalanXMLByte s_UTF8ByteOrderMark[];
282  static const XalanDOMChar s_UTF16ByteOrderMark[];
283 };
284 
285 
286 
288 {
289 public:
290 
295 
296  explicit
298 
299  virtual
301 
304  {
305  return m_memoryManager;
306  }
307 
321  virtual eCode
322  transcode(
323  const XalanDOMChar* theSourceData,
324  size_type theSourceCount,
325  XalanXMLByte* theTarget,
326  size_type theTargetSize,
327  size_type& theSourceCharsTranscoded,
328  size_type& theTargetBytesUsed) = 0;
329 
344  virtual eCode
345  transcode(
346  const XalanXMLByte* theSourceData,
347  size_type theSourceCount,
348  XalanDOMChar* theTarget,
349  size_type theTargetSize,
350  size_type& theSourceCharsTranscoded,
351  size_type& theTargetBytesUsed,
352  unsigned char* theCharSizes) = 0;
353 
354  virtual bool
355  canTranscodeTo(UnicodeCharType theChar) const = 0;
356 
357 private:
358 
359  MemoryManagerType& m_memoryManager;
360  // Not implemented...
362 
363  bool
364  operator==(const XalanOutputTranscoder& theRHS) const;
365 
367  operator=(const XalanOutputTranscoder& theRHS);
368 };
369 
370 
371 
372 XALAN_CPP_NAMESPACE_END
373 
374 
375 
376 #endif // XALANTRANSCODINGSERVICES_HEADER_GUARD_1357924680
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
Definition: XalanVector.hpp:1111
MemoryManagerType & getMemoryManager()
Definition: XalanTranscodingServices.hpp:303
Definition: XalanTranscodingServices.hpp:43
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType
Definition: XalanMemoryManagement.hpp:39
Definition: XSLException.hpp:39
Definition: XalanTranscodingServices.hpp:82
unsigned int UnicodeCharType
Definition: XalanTranscodingServices.hpp:61
unsigned int size_type
Definition: XalanTranscodingServices.hpp:60
static bool canTranscodeToLocalCodePage(UnicodeCharType theChar)
Definition: XalanTranscodingServices.hpp:209
unsigned char XalanXMLByte
Definition: XalanTranscodingServices.hpp:59
Definition: XalanTranscodingServices.hpp:81
eCode
Definition: XalanTranscodingServices.hpp:78
XalanTranscodingServices::eCode eCode
Definition: XalanTranscodingServices.hpp:292
static size_type length(const XalanXMLByte *theBytes)
Definition: XalanTranscodingServices.hpp:64
Definition: XalanTranscodingServices.hpp:287
XALAN_CPP_NAMESPACE_BEGIN typedef size_t size_type
Definition: XalanMap.hpp:44
XalanTranscodingServices::size_type size_type
Definition: XalanTranscodingServices.hpp:293
UnicodeCharType getCharacter() const
Definition: XalanTranscodingServices.hpp:249
XalanTranscodingServices::UnicodeCharType UnicodeCharType
Definition: XalanTranscodingServices.hpp:294
Definition: XalanDOMString.hpp:42
Definition: XalanTranscodingServices.hpp:236
Definition: XalanTranscodingServices.hpp:80
#define XALAN_PLATFORMSUPPORT_EXPORT
Definition: PlatformSupportDefinitions.hpp:33
virtual const XalanDOMChar * getType() const
Retrieve type of exception.
Definition: XalanTranscodingServices.hpp:261
const XalanDOMString & getEncoding() const
Definition: XalanTranscodingServices.hpp:255
XalanTranscodingServices::XalanXMLByte XalanXMLByte
Definition: XalanTranscodingServices.hpp:291

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

dot

Xalan-C++ XSLT Processor Version 1.10
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.

Apache Logo