Xalan-C++ API Documentation

The Xalan C++ XSL Transformer Version 1.1

Main Page   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_OLD_STREAM_HEADERS)
00070 #include <iostream.h>
00071 #else
00072 #if defined(XALAN_NO_IOSFWD)
00073 #include <ostream>
00074 #else
00075 #include <iosfwd>
00076 #endif
00077 #endif
00078 
00079 
00080 
00081 #include <XalanDOM/XalanDOMString.hpp>
00082 
00083 
00084 
00085 #include <XMLSupport/FormatterListener.hpp>
00086 
00087 
00088 
00089 class XalanDocument;
00090 class XalanDocumentFragment;
00091 class XalanElement;
00092 class Writer;
00093 
00094 
00095 
00096 class XALAN_XSLT_EXPORT XSLTResultTarget
00097 {
00098 public:
00099 
00100     explicit
00101     XSLTResultTarget();
00102 
00108     XSLTResultTarget(const XalanDOMString&  fileName);
00109 
00115 #if defined(XALAN_NO_NAMESPACES)
00116     XSLTResultTarget(ostream*       theStream);
00117 #else
00118     XSLTResultTarget(std::ostream*  theStream);
00119 #endif
00120  
00127     XSLTResultTarget(Writer*    characterStream);
00128 
00134     XSLTResultTarget(XalanDocument*     document);
00135 
00141     XSLTResultTarget(XalanDocumentFragment*     documentFragment);
00142 
00148     XSLTResultTarget(XalanElement*  element);
00149 
00155     void
00156     setFileName(const XalanDOMString&   fileName)
00157     {
00158         m_fileName = fileName;
00159     }
00160 
00166     const XalanDOMString&
00167     getFileName() const
00168     {
00169         return m_fileName;
00170     }
00171 
00178     void
00179 #if defined(XALAN_NO_NAMESPACES)
00180     setByteStream(ostream*          byteStream)
00181 #else
00182     setByteStream(std::ostream*     byteStream)
00183 #endif
00184     {
00185         m_byteStream = byteStream;
00186     }
00187 
00193 #if defined(XALAN_NO_NAMESPACES)
00194     ostream*
00195 #else
00196     std::ostream*
00197 #endif
00198     getByteStream() const
00199     {
00200         return m_byteStream;
00201     }
00202 
00208     void
00209     setEncoding(const XalanDOMString&   encoding)
00210     {
00211         m_encoding = encoding;
00212     }
00213 
00219     const XalanDOMString&
00220     getEncoding() const
00221     {
00222         return m_encoding;
00223     }
00224 
00231     void
00232     setCharacterStream(Writer*  characterStream)
00233     {
00234         m_characterStream = characterStream;
00235     }
00236 
00242     Writer*
00243     getCharacterStream() const
00244     {
00245         return m_characterStream;
00246     }
00247 
00248     bool
00249     hasDOMTarget() const
00250     {
00251         return m_document != 0 || m_documentFragment != 0 || m_element != 0;
00252     }
00253 
00259     void
00260     setDocument(XalanDocument*      document)
00261     {
00262         m_document = document;
00263 
00264         m_documentFragment = 0;
00265         m_element = 0;
00266     }
00267 
00273     XalanDocument*
00274     getDocument() const
00275     {
00276         return m_document;
00277     }
00278 
00284     void
00285     setDocumentFragment(XalanDocumentFragment*  documentFragment)
00286     {
00287         m_documentFragment = documentFragment;
00288 
00289         m_document = 0;
00290         m_element = 0;
00291     }
00292 
00298     XalanDocumentFragment*
00299     getDocumentFragment() const
00300     {
00301         return m_documentFragment;
00302     }
00303 
00309     void
00310     setElement(XalanElement*    element)
00311     {
00312         m_element = element;
00313 
00314         m_documentFragment = 0;
00315         m_document = 0;
00316     }
00317 
00323     XalanElement*
00324     getElement() const
00325     {
00326         return m_element;
00327     }
00328 
00334     void
00335     setDocumentHandler(FormatterListener*   handler)
00336     {
00337         m_formatterListener = handler;
00338     }
00339 
00345     FormatterListener*
00346     getDocumentHandler() const
00347     {
00348         return m_formatterListener;
00349     }
00350 
00356     void
00357     setFormatterListener(FormatterListener*     handler)
00358     {
00359         m_formatterListener = handler;
00360     }
00361 
00367     FormatterListener*
00368     getFormatterListener() const
00369     {
00370         return m_formatterListener;
00371     }
00372 
00373 private:
00374 
00375     XalanDOMString          m_fileName;
00376 
00377 #if defined(XALAN_NO_NAMESPACES)
00378     ostream*                m_byteStream;
00379 #else
00380     std::ostream*           m_byteStream;
00381 #endif
00382 
00383     XalanDOMString          m_encoding;
00384 
00385     Writer*                 m_characterStream;
00386 
00387     XalanDocument*          m_document;
00388 
00389     XalanDocumentFragment*  m_documentFragment;
00390 
00391     XalanElement*           m_element;
00392 
00393     FormatterListener*      m_formatterListener;
00394 };
00395 
00396 
00397 
00398 #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.1
Copyright © 2000, 2001 The Apache Software Foundation. All Rights Reserved.