Xalan-C++ API Documentation

The Xalan-C++ XSL Transformer Version 1.0

Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

XSLTResultTarget.hpp

Go to the documentation of this file.
00001 /*
00002  * The Apache Software License, Version 1.1
00003  *
00004  *
00005  * Copyright (c) 1999 The Apache Software Foundation.  All rights 
00006  * reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions
00010  * are met:
00011  *
00012  * 1. Redistributions of source code must retain the above copyright
00013  *    notice, this list of conditions and the following disclaimer. 
00014  *
00015  * 2. Redistributions in binary form must reproduce the above copyright
00016  *    notice, this list of conditions and the following disclaimer in
00017  *    the documentation and/or other materials provided with the
00018  *    distribution.
00019  *
00020  * 3. The end-user documentation included with the redistribution,
00021  *    if any, must include the following acknowledgment:  
00022  *       "This product includes software developed by the
00023  *        Apache Software Foundation (http://www.apache.org/)."
00024  *    Alternately, this acknowledgment may appear in the software itself,
00025  *    if and wherever such third-party acknowledgments normally appear.
00026  *
00027  * 4. The names "Xalan" and "Apache Software Foundation" must
00028  *    not be used to endorse or promote products derived from this
00029  *    software without prior written permission. For written 
00030  *    permission, please contact apache@apache.org.
00031  *
00032  * 5. Products derived from this software may not be called "Apache",
00033  *    nor may "Apache" appear in their name, without prior written
00034  *    permission of the Apache Software Foundation.
00035  *
00036  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
00037  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00038  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00039  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
00040  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00041  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00042  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
00043  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00044  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00045  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
00046  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00047  * SUCH DAMAGE.
00048  * ====================================================================
00049  *
00050  * This software consists of voluntary contributions made by many
00051  * individuals on behalf of the Apache Software Foundation and was
00052  * originally based on software copyright (c) 1999, International
00053  * Business Machines, Inc., http://www.ibm.com.  For more
00054  * information on the Apache Software Foundation, please see
00055  * <http://www.apache.org/>.
00056  *
00057  * $ Id: $
00058  
00059  */
00060 
00061 #if !defined(XALAN_XSLTRESULTTARGET_HEADER_GUARD)
00062 #define XALAN_XSLTRESULTTARGET_HEADER_GUARD
00063 
00064 // Base include file.  Must be first.
00065 #include "XSLTDefinitions.hpp"
00066 
00067 
00068 
00069 #if defined(XALAN_NO_IOSFWD)
00070 #include <ostream>
00071 #else
00072 #include <iosfwd>
00073 #endif
00074 
00075 
00076 
00077 #include <XalanDOM/XalanDOMString.hpp>
00078 
00079 
00080 
00081 #include <XMLSupport/FormatterListener.hpp>
00082 
00083 
00084 
00085 class XalanDocument;
00086 class XalanDocumentFragment;
00087 class XalanElement;
00088 class Writer;
00089 
00090 
00091 
00092 class XALAN_XSLT_EXPORT XSLTResultTarget
00093 {
00094 public:
00095 
00096     explicit
00097     XSLTResultTarget();
00098 
00104     XSLTResultTarget(const XalanDOMString&  fileName);
00105 
00111 #if defined(XALAN_NO_NAMESPACES)
00112     XSLTResultTarget(ostream*       theStream);
00113 #else
00114     XSLTResultTarget(std::ostream*  theStream);
00115 #endif
00116  
00123     XSLTResultTarget(Writer*    characterStream);
00124 
00130     XSLTResultTarget(XalanDocument*     document);
00131 
00137     XSLTResultTarget(XalanDocumentFragment*     documentFragment);
00138 
00144     XSLTResultTarget(XalanElement*  element);
00145 
00151     void
00152     setFileName(const XalanDOMString&   fileName)
00153     {
00154         m_fileName = fileName;
00155     }
00156 
00162     const XalanDOMString&
00163     getFileName() const
00164     {
00165         return m_fileName;
00166     }
00167 
00174     void
00175 #if defined(XALAN_NO_NAMESPACES)
00176     setByteStream(ostream*          byteStream)
00177 #else
00178     setByteStream(std::ostream*     byteStream)
00179 #endif
00180     {
00181         m_byteStream = byteStream;
00182     }
00183 
00189 #if defined(XALAN_NO_NAMESPACES)
00190     ostream*
00191 #else
00192     std::ostream*
00193 #endif
00194     getByteStream() const
00195     {
00196         return m_byteStream;
00197     }
00198 
00204     void
00205     setEncoding(const XalanDOMString&   encoding)
00206     {
00207         m_encoding = encoding;
00208     }
00209 
00215     const XalanDOMString&
00216     getEncoding() const
00217     {
00218         return m_encoding;
00219     }
00220 
00227     void
00228     setCharacterStream(Writer*  characterStream)
00229     {
00230         m_characterStream = characterStream;
00231     }
00232 
00238     Writer*
00239     getCharacterStream()
00240     {
00241         return m_characterStream;
00242     }
00243 
00244     bool
00245     hasDOMTarget() const
00246     {
00247         return m_document != 0 || m_documentFragment != 0 || m_element != 0;
00248     }
00249 
00255     void
00256     setDocument(XalanDocument*      document)
00257     {
00258         m_document = document;
00259 
00260         m_documentFragment = 0;
00261         m_element = 0;
00262     }
00263 
00269     XalanDocument*
00270     getDocument() const
00271     {
00272         return m_document;
00273     }
00274 
00280     void
00281     setDocumentFragment(XalanDocumentFragment*  documentFragment)
00282     {
00283         m_documentFragment = documentFragment;
00284 
00285         m_document = 0;
00286         m_element = 0;
00287     }
00288 
00294     XalanDocumentFragment*
00295     getDocumentFragment() const
00296     {
00297         return m_documentFragment;
00298     }
00299 
00305     void
00306     setElement(XalanElement*    element)
00307     {
00308         m_element = element;
00309 
00310         m_documentFragment = 0;
00311         m_document = 0;
00312     }
00313 
00319     XalanElement*
00320     getElement() const
00321     {
00322         return m_element;
00323     }
00324 
00330     void
00331     setDocumentHandler(FormatterListener*   handler)
00332     {
00333         m_formatterListener = handler;
00334     }
00335 
00341     FormatterListener*
00342     getDocumentHandler() const
00343     {
00344         return m_formatterListener;
00345     }
00346 
00352     void
00353     setFormatterListener(FormatterListener*     handler)
00354     {
00355         m_formatterListener = handler;
00356     }
00357 
00363     FormatterListener*
00364     getFormatterListener() const
00365     {
00366         return m_formatterListener;
00367     }
00368 
00369 private:
00370 
00371     XalanDOMString          m_fileName;
00372 
00373 #if defined(XALAN_NO_NAMESPACES)
00374     ostream*                m_byteStream;
00375 #else
00376     std::ostream*           m_byteStream;
00377 #endif
00378 
00379     XalanDOMString          m_encoding;
00380 
00381     Writer*                 m_characterStream;
00382 
00383     XalanDocument*          m_document;
00384 
00385     XalanDocumentFragment*  m_documentFragment;
00386 
00387     XalanElement*           m_element;
00388 
00389     FormatterListener*      m_formatterListener;
00390 };
00391 
00392 
00393 
00394 #endif  // XALAN_XSLTRESULTTARGET_HEADER_GUARD

Interpreting class diagrams

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

Xalan-C++ XSL Transformer Version 1.0
Copyright © 2000 The Apache Software Foundation. All Rights Reserved.