Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

XalanOutputStream.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(XALANOUTPUTSTREAM_HEADER_GUARD_1357924680)
17 #define XALANOUTPUTSTREAM_HEADER_GUARD_1357924680
18 
19 
20 
21 // Base include file. Must be first.
23 
24 
25 
27 
28 
29 
31 
32 
33 
36 
37 
38 
39 XALAN_CPP_NAMESPACE_BEGIN
40 
41 
42 
44 
45 
46 
48 {
49 public :
50 
51  enum { eDefaultBufferSize = 512u, eDefaultTranscoderBlockSize = 1024u };
52 
57 
65  explicit
67  MemoryManagerType& theManager,
68  size_type theBufferSize = eDefaultBufferSize,
69  size_type theTranscoderBlockSize = eDefaultTranscoderBlockSize,
70  bool fThrowTranscodeException = true);
71 
72  virtual
74 
77  {
78  return m_buffer.getMemoryManager();
79  }
80 
81  static const XalanDOMChar*
83  {
84 #if defined(XALAN_NEWLINE_IS_CRLF)
85  return s_nlCRString;
86 #else
87  return s_nlString;
88 #endif
89  }
90 
94  virtual void
95  newline();
96 
100  virtual const XalanDOMChar*
101  getNewlineString() const;
102 
108  void
109  flushBuffer();
110 
114  void
116  {
117  flushBuffer();
118 
119  doFlush();
120  }
121 
128  void
129  write(char theChar)
130  {
131  write(&theChar, 1);
132  }
133 
140  void
141  write(XalanDOMChar theChar)
142  {
143  assert(m_bufferSize > 0);
144 
145  if (m_buffer.size() == m_bufferSize)
146  {
147  flushBuffer();
148  }
149 
150  m_buffer.push_back(theChar);
151  }
152 
160  void
161  write(const char* theBuffer)
162  {
163  assert(theBuffer != 0);
164  assert(m_buffer.empty() == true);
165 
166  write(theBuffer, length(theBuffer));
167  }
168 
175  void
176  write(const XalanDOMChar* theBuffer)
177  {
178  write(theBuffer, length(theBuffer));
179  }
180 
189  void
191  const char* theBuffer,
192  size_type theBufferLength)
193  {
194  assert(theBuffer != 0);
195  assert(m_buffer.empty() == true);
196 
197  writeData(theBuffer,
198  theBufferLength);
199  }
200 
208  void
209  write(
210  const XalanDOMChar* theBuffer,
211  size_type theBufferLength);
212 
218  const XalanDOMString&
220  {
221  return m_encoding;
222  }
223 
229  void
230  setOutputEncoding(const XalanDOMString& theEncoding);
231 
238  bool
239  canTranscodeTo(UnicodeCharType theChar) const;
240 
241 
242  const XalanOutputTranscoder*
244  {
245  return m_transcoder;
246  }
247 
257  bool
259  {
260  return m_throwTranscodeException;
261  }
262 
272  void
274  {
275  m_throwTranscodeException = flag;
276  }
277 
283  void
284  setBufferSize(size_type theBufferSize);
285 
286 
288  {
289  public:
290 
292  const XalanDOMString& theMessage,
293  MemoryManagerType& theManager);
294 
296  XSLException(other)
297  {
298  }
299 
300  virtual
302 
303  virtual const XalanDOMChar*
304  getType() const
305  {
306  return m_type;
307  }
308 
309  private:
310  static const XalanDOMChar m_type[];
311 
312  };
313 
315  {
316  public:
317 
318  explicit
320 
321  virtual
323 
324  virtual const XalanDOMChar*
325  getType() const
326  {
327  return m_type;
328  }
329 
330  private:
331  static const XalanDOMChar m_type[];
332 
333  };
334 
336  {
337  public:
338 
339  UnsupportedEncodingException(const XalanDOMString& theEncoding,
340  XalanDOMString& theBuffer);
341 
344  m_encoding(other.getEncoding(),(const_cast<XalanDOMString*>(&(other.m_encoding)))->getMemoryManager())
345  {
346  }
347 
348  virtual
350 
351  const XalanDOMString&
352  getEncoding() const
353  {
354  return m_encoding;
355  }
356 
357 
358  virtual const XalanDOMChar*
359  getType() const
360  {
361  return m_type;
362  }
363  private:
364 
365  static const XalanDOMChar m_type[];
366 
367  const XalanDOMString m_encoding;
368  };
369 
371  {
372  public:
373 
375  XalanDOMString& theBuffer);
376 
379  m_encoding(other.getEncoding(),(const_cast<XalanDOMString*>(&(other.m_encoding)))->getMemoryManager())
380  {
381  }
382 
383  virtual
385 
386  const XalanDOMString&
387  getEncoding() const
388  {
389  return m_encoding;
390  }
391 
392  private:
393 
394  const XalanDOMString m_encoding;
395  };
396 
398  {
399  public:
400 
401  explicit
403 
406  {
407  }
408 
409  virtual
411  };
412 
413 protected:
414 
422  void
423  transcode(
424  const XalanDOMChar* theBuffer,
425  size_type theBufferLength,
426  TranscodeVectorType& theDestination);
427 
434  virtual void
435  writeData(
436  const char* theBuffer,
437  size_type theBufferLength) = 0;
438 
442  virtual void
443  doFlush() = 0;
444 
445  static const XalanDOMChar s_nlString[];
446  static const XalanDOMChar s_nlCRString[];
447 
450 
451 private:
452 
453  // These are not implemented...
455 
457  operator=(const XalanOutputStream&);
458 
459  bool
460  operator==(const XalanOutputStream&) const;
461 
462  void
463  doWrite(
464  const XalanDOMChar* theBuffer,
465  size_type theBufferLength);
466 
467 
468  const size_type m_transcoderBlockSize;
469 
470  XalanOutputTranscoder* m_transcoder;
471 
472  size_type m_bufferSize;
473 
474  BufferType m_buffer;
475 
476  XalanDOMString m_encoding;
477 
478  bool m_writeAsUTF16;
479 
480  bool m_throwTranscodeException;
481 
482  TranscodeVectorType m_transcodingBuffer;
483 };
484 
485 
486 
487 XALAN_CPP_NAMESPACE_END
488 
489 
490 
491 #endif // XALANOUTPUTSTREAM_HEADER_GUARD_1357924680

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