Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

XSLTResultTarget.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 
17 #if !defined(XALAN_XSLTRESULTTARGET_HEADER_GUARD)
18 #define XALAN_XSLTRESULTTARGET_HEADER_GUARD
19 
20 // Base include file. Must be first.
21 #include "XSLTDefinitions.hpp"
22 
23 
24 
25 #include <cstdio>
26 #if defined(XALAN_CLASSIC_IOSTREAMS)
27 class ostream;
28 #else
29 #include <iosfwd>
30 #endif
31 
32 
33 
35 
36 
37 
38 XALAN_CPP_NAMESPACE_BEGIN
39 
40 
41 
42 class FormatterListener;
43 class Writer;
44 
45 
46 
48 {
49 public:
50 
51 #if defined(XALAN_NO_STD_NAMESPACE)
52  typedef ostream StreamType;
53 #else
54  typedef std::ostream StreamType;
55 #endif
56 
57 #if defined(XALAN_STRICT_ANSI_HEADERS)
58  typedef std::FILE FILE;
59 #endif
60 
61 
62  explicit
64 
70  XSLTResultTarget(const XalanDOMString& fileName,
72 
78  XSLTResultTarget(const XalanDOMChar* fileName,
80 
86  XSLTResultTarget(const char* fileName,
88 
94  XSLTResultTarget(StreamType* theStream,
96 
102  XSLTResultTarget(StreamType& theStream,
104 
111  XSLTResultTarget(Writer* characterStream,
113 
120  XSLTResultTarget(FILE* characterStream,
122 
130 
131  XSLTResultTarget(const XSLTResultTarget& other,
133  ~XSLTResultTarget();
134 
140  void
141  setFileName(const char* fileName)
142  {
143  if (fileName == 0)
144  {
145  m_fileName.clear();
146  }
147  else
148  {
149  m_fileName = fileName;
150  }
151  }
152 
158  void
159  setFileName(const XalanDOMString& fileName)
160  {
161  m_fileName = fileName;
162  }
163 
169  const XalanDOMString&
170  getFileName() const
171  {
172  return m_fileName;
173  }
174 
181  void
183  {
184  m_byteStream = byteStream;
185  }
186 
192  StreamType*
194  {
195  return m_byteStream;
196  }
197 
203  void
204  setEncoding(const XalanDOMChar* encoding)
205  {
206  if (encoding == 0)
207  {
208  m_encoding.clear();
209  }
210  else
211  {
212  m_encoding = encoding;
213  }
214  }
215 
221  void
222  setEncoding(const XalanDOMString& encoding)
223  {
224  m_encoding = encoding;
225  }
226 
232  const XalanDOMString&
233  getEncoding() const
234  {
235  return m_encoding;
236  }
237 
244  void
245  setCharacterStream(Writer* characterStream)
246  {
247  m_characterStream = characterStream;
248  }
249 
255  Writer*
257  {
258  return m_characterStream;
259  }
260 
266  FILE*
267  getStream() const
268  {
269  return m_stream;
270  }
271 
277  void
278  setStream(FILE* theStream)
279  {
280  m_stream = theStream;
281  }
282 
288  void
290  {
291  m_formatterListener = handler;
292  }
293 
301  {
302  return m_formatterListener;
303  }
304 
305 private:
306 
307 #if defined(XALAN_DEVELOPMENT)
310 #endif
311 
312  XalanDOMString m_fileName;
313 
314  StreamType* m_byteStream;
315 
316  XalanDOMString m_encoding;
317 
318  Writer* m_characterStream;
319 
320  FormatterListener* m_formatterListener;
321 
322  FILE* m_stream;
323 };
324 
325 
326 
327 XALAN_CPP_NAMESPACE_END
328 
329 
330 
331 #endif // XALAN_XSLTRESULTTARGET_HEADER_GUARD
#define XALAN_DEFAULT_CONSTRACTOR_MEMORY_MGR
Definition: XalanMemoryManagement.hpp:401
void setEncoding(const XalanDOMString &encoding)
Set the character encoding, if known.
Definition: XSLTResultTarget.hpp:222
std::ostream StreamType
Definition: XSLTResultTarget.hpp:54
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType
Definition: XalanMemoryManagement.hpp:39
Definition: Writer.hpp:42
FormatterListener * getFormatterListener() const
Get the FormatterListener that will process the result tree events.
Definition: XSLTResultTarget.hpp:300
void setByteStream(StreamType *byteStream)
Set the byte stream for this output target.
Definition: XSLTResultTarget.hpp:182
FILE * getStream() const
Get the stream for this output target.
Definition: XSLTResultTarget.hpp:267
void setFormatterListener(FormatterListener *handler)
Set a FormatterListener to process the result tree events.
Definition: XSLTResultTarget.hpp:289
const XalanDOMString & getFileName() const
Get the file name where the results will be written to.
Definition: XSLTResultTarget.hpp:170
A SAX-based formatter interface for the XSL processor.
Definition: FormatterListener.hpp:62
Definition: XSLTResultTarget.hpp:47
const XalanDOMString & getEncoding() const
Get the character encoding in use.
Definition: XSLTResultTarget.hpp:233
#define XALAN_XSLT_EXPORT
Definition: XSLTDefinitions.hpp:25
Writer * getCharacterStream() const
Get the character stream for this output target.
Definition: XSLTResultTarget.hpp:256
StreamType * getByteStream() const
Get the byte stream for this output target.
Definition: XSLTResultTarget.hpp:193
Definition: XalanDOMString.hpp:42
void setEncoding(const XalanDOMChar *encoding)
Set the character encoding, if known.
Definition: XSLTResultTarget.hpp:204
void setStream(FILE *theStream)
Set the stream for this output target.
Definition: XSLTResultTarget.hpp:278
void setFileName(const char *fileName)
Set the file name where the results will be written.
Definition: XSLTResultTarget.hpp:141
void setCharacterStream(Writer *characterStream)
Set the character stream for this output target.
Definition: XSLTResultTarget.hpp:245
void setFileName(const XalanDOMString &fileName)
Set the file name where the results will be written.
Definition: XSLTResultTarget.hpp:159

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