00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one 00003 * or more contributor license agreements. See the NOTICE file 00004 * distributed with this work for additional information 00005 * regarding copyright ownership. The ASF licenses this file 00006 * to you under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 #if !defined(XALANFILEOUTPUTSTREAM_HEADER_GUARD_1357924680) 00019 #define XALANFILEOUTPUTSTREAM_HEADER_GUARD_1357924680 00020 00021 00022 00023 // Base include file. Must be first. 00024 #include <xalanc/PlatformSupport/PlatformSupportDefinitions.hpp> 00025 00026 00027 00028 #if defined(XALAN_WINDOWS) 00029 #include <windows.h> 00030 #else 00031 #include <cstdio> 00032 #endif 00033 00034 00035 00036 // Base class header file. 00037 #include <xalanc/PlatformSupport/XalanOutputStream.hpp> 00038 00039 00040 00041 XALAN_CPP_NAMESPACE_BEGIN 00042 00043 00044 #if defined(XALAN_STRICT_ANSI_HEADERS) 00045 using std::FILE; 00046 #endif 00047 00048 class XALAN_PLATFORMSUPPORT_EXPORT XalanFileOutputStream : public XalanOutputStream 00049 { 00050 public : 00051 00052 enum { eDefaultBufferSize = 8192u }; 00053 00054 #if defined(XALAN_WINDOWS) 00055 typedef HANDLE HandleType; 00056 #else 00057 typedef FILE* HandleType; 00058 #endif 00059 00060 /** 00061 * Construct an XalanFileOutputStream object. 00062 * 00063 * @param theFileName name of file 00064 * @param theBufferSize The size of the transcoding buffer 00065 */ 00066 XalanFileOutputStream( 00067 const XalanDOMString& theFileName, 00068 MemoryManager& theManager, 00069 size_type theBufferSize = eDefaultBufferSize); 00070 00071 static XalanFileOutputStream* 00072 create( 00073 const XalanDOMString& theFileName, 00074 MemoryManager& theManager, 00075 size_type theBufferSize = eDefaultBufferSize); 00076 virtual 00077 ~XalanFileOutputStream(); 00078 00079 00080 class XALAN_PLATFORMSUPPORT_EXPORT XalanFileOutputStreamOpenException : public XalanOutputStream::XalanOutputStreamException 00081 { 00082 public: 00083 00084 /** 00085 * Construct an XalanFileOutputStreamOpen exception object for an exception 00086 * that occurred on opening a text file stream. 00087 * 00088 * @param theFileName name of file causing the exception 00089 * @param theErrorCode number of error encountered 00090 */ 00091 XalanFileOutputStreamOpenException( 00092 const XalanDOMString& theFileName, 00093 int theErrorCode, 00094 XalanDOMString& theBuffer, 00095 const Locator* theLocator = 0); 00096 00097 virtual 00098 ~XalanFileOutputStreamOpenException(); 00099 00100 virtual const XalanDOMChar* 00101 getType() const 00102 { 00103 return m_type; 00104 } 00105 00106 private: 00107 00108 static const XalanDOMChar m_type[]; 00109 00110 }; 00111 00112 class XALAN_PLATFORMSUPPORT_EXPORT XalanFileOutputStreamWriteException : public XalanOutputStream::XalanOutputStreamException 00113 { 00114 public: 00115 00116 /** 00117 * Construct an XalanFileOutputStreamOpen exception object for an exception 00118 * that occurred while writing to a text file stream. 00119 * 00120 * @param theFileName name of file causing the exception 00121 * @param theErrorCode number of error encountered 00122 */ 00123 XalanFileOutputStreamWriteException( 00124 const XalanDOMString& theFileName, 00125 int theErrorCode, 00126 XalanDOMString& theBuffer, 00127 const Locator* theLocator = 0); 00128 00129 virtual 00130 ~XalanFileOutputStreamWriteException(); 00131 00132 virtual const XalanDOMChar* 00133 getType() const 00134 { 00135 return m_type; 00136 } 00137 00138 private: 00139 static const XalanDOMChar m_type[]; 00140 00141 }; 00142 00143 protected: 00144 00145 virtual void 00146 writeData( 00147 const char* theBuffer, 00148 size_type theBufferLength); 00149 00150 virtual void 00151 doFlush(); 00152 00153 private: 00154 00155 // These are not implemented... 00156 XalanFileOutputStream(const XalanFileOutputStream&); 00157 00158 XalanFileOutputStream& 00159 operator=(const XalanFileOutputStream&); 00160 00161 bool 00162 operator==(const XalanFileOutputStream&) const; 00163 00164 00165 // Data members... 00166 const XalanDOMString m_fileName; 00167 00168 const HandleType m_handle; 00169 }; 00170 00171 00172 00173 XALAN_CPP_NAMESPACE_END 00174 00175 00176 00177 #endif // XALANFILEOUTPUTSTREAM_HEADER_GUARD_1357924680
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11 |
|