Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.7

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-2004 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 #include <cstdio>
00070 #if defined(XALAN_CLASSIC_IOSTREAMS)
00071 class ostream;
00072 #else
00073 #include <iosfwd>
00074 #endif
00075 
00076 
00077 
00078 #include <xalanc/XalanDOM/XalanDOMString.hpp>
00079 
00080 
00081 
00082 XALAN_CPP_NAMESPACE_BEGIN
00083 
00084 
00085 
00086 class FormatterListener;
00087 class Writer;
00088 
00089 
00090 
00091 class XALAN_XSLT_EXPORT XSLTResultTarget
00092 {
00093 public:
00094 
00095 #if defined(XALAN_NO_STD_NAMESPACE)
00096     typedef ostream         StreamType;
00097 #else
00098     typedef std::ostream    StreamType;
00099 #endif
00100 
00101 #if defined(XALAN_STRICT_ANSI_HEADERS)
00102     typedef std::FILE   FILE;
00103 #endif
00104 
00105 
00106     explicit
00107     XSLTResultTarget();
00108 
00114     XSLTResultTarget(const XalanDOMString&  fileName);
00115 
00121     XSLTResultTarget(const XalanDOMChar*    fileName);
00122 
00128     XSLTResultTarget(const char*    fileName);
00129 
00135     XSLTResultTarget(StreamType*    theStream);
00136 
00142     XSLTResultTarget(StreamType&    theStream);
00143  
00150     XSLTResultTarget(Writer*    characterStream);
00151  
00158     XSLTResultTarget(FILE*  characterStream);
00159 
00165     XSLTResultTarget(FormatterListener&     flistener);
00166 
00167     ~XSLTResultTarget();
00168 
00174     void
00175     setFileName(const char*     fileName)
00176     {
00177         if (fileName == 0)
00178         {
00179             m_fileName.clear();
00180         }
00181         else
00182         {
00183             m_fileName = fileName;
00184         }
00185     }
00186 
00192     void
00193     setFileName(const XalanDOMString&   fileName)
00194     {
00195         m_fileName = fileName;
00196     }
00197 
00203     const XalanDOMString&
00204     getFileName() const
00205     {
00206         return m_fileName;
00207     }
00208 
00215     void
00216     setByteStream(StreamType*           byteStream)
00217     {
00218         m_byteStream = byteStream;
00219     }
00220 
00226     StreamType*
00227     getByteStream() const
00228     {
00229         return m_byteStream;
00230     }
00231 
00237     void
00238     setEncoding(const XalanDOMChar*     encoding)
00239     {
00240         if (encoding == 0)
00241         {
00242             m_encoding.clear();
00243         }
00244         else
00245         {
00246             m_encoding = encoding;
00247         }
00248     }
00249 
00255     void
00256     setEncoding(const XalanDOMString&   encoding)
00257     {
00258         m_encoding = encoding;
00259     }
00260 
00266     const XalanDOMString&
00267     getEncoding() const
00268     {
00269         return m_encoding;
00270     }
00271 
00278     void
00279     setCharacterStream(Writer*  characterStream)
00280     {
00281         m_characterStream = characterStream;
00282     }
00283 
00289     Writer*
00290     getCharacterStream() const
00291     {
00292         return m_characterStream;
00293     }
00294 
00300     FILE*
00301     getStream() const
00302     {
00303         return m_stream;
00304     }
00305 
00311     void
00312     setStream(FILE*     theStream)
00313     {
00314         m_stream = theStream;
00315     }
00316 
00322     void
00323     setFormatterListener(FormatterListener*     handler)
00324     {
00325         m_formatterListener = handler;
00326     }
00327 
00333     FormatterListener*
00334     getFormatterListener() const
00335     {
00336         return m_formatterListener;
00337     }
00338 
00339 private:
00340 
00341     XalanDOMString          m_fileName;
00342 
00343     StreamType*             m_byteStream;
00344 
00345     XalanDOMString          m_encoding;
00346 
00347     Writer*                 m_characterStream;
00348 
00349     FormatterListener*      m_formatterListener;
00350 
00351     FILE*                   m_stream;
00352 };
00353 
00354 
00355 
00356 XALAN_CPP_NAMESPACE_END
00357 
00358 
00359 
00360 #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++ XSLT Processor Version 1.7
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.