00001 /* 00002 * Copyright 1999-2004 The Apache Software Foundation. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #if !defined(XALAN_XSLTRESULTTARGET_HEADER_GUARD) 00018 #define XALAN_XSLTRESULTTARGET_HEADER_GUARD 00019 00020 // Base include file. Must be first. 00021 #include "XSLTDefinitions.hpp" 00022 00023 00024 00025 #include <cstdio> 00026 #if defined(XALAN_CLASSIC_IOSTREAMS) 00027 class ostream; 00028 #else 00029 #include <iosfwd> 00030 #endif 00031 00032 00033 00034 #include <xalanc/XalanDOM/XalanDOMString.hpp> 00035 00036 00037 00038 XALAN_CPP_NAMESPACE_BEGIN 00039 00040 00041 00042 class FormatterListener; 00043 class Writer; 00044 00045 00046 00047 class XALAN_XSLT_EXPORT XSLTResultTarget 00048 { 00049 public: 00050 00051 #if defined(XALAN_NO_STD_NAMESPACE) 00052 typedef ostream StreamType; 00053 #else 00054 typedef std::ostream StreamType; 00055 #endif 00056 00057 #if defined(XALAN_STRICT_ANSI_HEADERS) 00058 typedef std::FILE FILE; 00059 #endif 00060 00061 00062 explicit 00063 XSLTResultTarget(); 00064 00070 XSLTResultTarget(const XalanDOMString& fileName); 00071 00077 XSLTResultTarget(const XalanDOMChar* fileName); 00078 00084 XSLTResultTarget(const char* fileName); 00085 00091 XSLTResultTarget(StreamType* theStream); 00092 00098 XSLTResultTarget(StreamType& theStream); 00099 00106 XSLTResultTarget(Writer* characterStream); 00107 00114 XSLTResultTarget(FILE* characterStream); 00115 00121 XSLTResultTarget(FormatterListener& flistener); 00122 00123 ~XSLTResultTarget(); 00124 00130 void 00131 setFileName(const char* fileName) 00132 { 00133 if (fileName == 0) 00134 { 00135 m_fileName.clear(); 00136 } 00137 else 00138 { 00139 m_fileName = fileName; 00140 } 00141 } 00142 00148 void 00149 setFileName(const XalanDOMString& fileName) 00150 { 00151 m_fileName = fileName; 00152 } 00153 00159 const XalanDOMString& 00160 getFileName() const 00161 { 00162 return m_fileName; 00163 } 00164 00171 void 00172 setByteStream(StreamType* byteStream) 00173 { 00174 m_byteStream = byteStream; 00175 } 00176 00182 StreamType* 00183 getByteStream() const 00184 { 00185 return m_byteStream; 00186 } 00187 00193 void 00194 setEncoding(const XalanDOMChar* encoding) 00195 { 00196 if (encoding == 0) 00197 { 00198 m_encoding.clear(); 00199 } 00200 else 00201 { 00202 m_encoding = encoding; 00203 } 00204 } 00205 00211 void 00212 setEncoding(const XalanDOMString& encoding) 00213 { 00214 m_encoding = encoding; 00215 } 00216 00222 const XalanDOMString& 00223 getEncoding() const 00224 { 00225 return m_encoding; 00226 } 00227 00234 void 00235 setCharacterStream(Writer* characterStream) 00236 { 00237 m_characterStream = characterStream; 00238 } 00239 00245 Writer* 00246 getCharacterStream() const 00247 { 00248 return m_characterStream; 00249 } 00250 00256 FILE* 00257 getStream() const 00258 { 00259 return m_stream; 00260 } 00261 00267 void 00268 setStream(FILE* theStream) 00269 { 00270 m_stream = theStream; 00271 } 00272 00278 void 00279 setFormatterListener(FormatterListener* handler) 00280 { 00281 m_formatterListener = handler; 00282 } 00283 00289 FormatterListener* 00290 getFormatterListener() const 00291 { 00292 return m_formatterListener; 00293 } 00294 00295 private: 00296 00297 XalanDOMString m_fileName; 00298 00299 StreamType* m_byteStream; 00300 00301 XalanDOMString m_encoding; 00302 00303 Writer* m_characterStream; 00304 00305 FormatterListener* m_formatterListener; 00306 00307 FILE* m_stream; 00308 }; 00309 00310 00311 00312 XALAN_CPP_NAMESPACE_END 00313 00314 00315 00316 #endif // XALAN_XSLTRESULTTARGET_HEADER_GUARD
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
![]() |
Xalan-C++ XSLT Processor Version 1.8 |
|