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 00019 // This file is simplified version of XalanFileOutputStream.hpp / .cpp 00020 00021 #if !defined(MSGFILEOUTPUTSTREAM_1357924680) 00022 #define MSGFILEOUTPUTSTREAM_1357924680 00023 00024 #include "xalanc/Include/PlatformDefinitions.hpp" 00025 00026 00027 00028 #include <cstdio> 00029 00030 00031 00032 XALAN_CPP_NAMESPACE_BEGIN 00033 00034 00035 00036 XERCES_CPP_NAMESPACE_USE 00037 00038 00039 00040 // Class responsible for printing into file with UTF16 00041 class MsgFileOutputStream 00042 { 00043 public : 00044 00045 #if defined(XALAN_STRICT_ANSI_HEADERS) 00046 typedef std::FILE* HandleType; 00047 #else 00048 typedef FILE* HandleType; 00049 #endif 00050 00051 /** 00052 * Construct an MsgFileOutputStream object. 00053 * 00054 * @param theFileName name of file 00055 * @param theBufferSize The size of the transcoding buffer 00056 */ 00057 MsgFileOutputStream(const char* theFileName); 00058 00059 virtual 00060 ~MsgFileOutputStream(); 00061 00062 00063 class OpenException 00064 { 00065 public: 00066 00067 /** 00068 * Construct an OpenException exception object for an exception 00069 * that occurred when opening a file. 00070 * 00071 * @param theFileName The name of file. 00072 * @param theErrorCode The errno for the error encountered 00073 */ 00074 OpenException( 00075 const char* theFileName, 00076 int theErrorCode); 00077 00078 ~OpenException(); 00079 00080 char m_message[1200]; 00081 }; 00082 00083 class WriteException 00084 { 00085 public: 00086 00087 /** 00088 * Construct an WriteException exception object for an exception 00089 * that occurred while writing to a file. 00090 * 00091 * @param theFileName The name of file. 00092 * @param theErrorCode The errno for the error encountered 00093 */ 00094 WriteException( 00095 const char* theFileName, 00096 int theErrorCode); 00097 00098 ~WriteException(); 00099 00100 char m_message[1200]; 00101 }; 00102 00103 void 00104 write( 00105 const XMLCh* theString, 00106 XalanSize_t theLength); 00107 00108 void 00109 write( 00110 const char* theString, 00111 XalanSize_t theLength); 00112 00113 void 00114 writeAsASCII( 00115 const char* theString, 00116 XalanSize_t theLength); 00117 00118 void 00119 writeAsASCII( 00120 const XMLCh* theString, 00121 XalanSize_t theLength); 00122 00123 void 00124 writeUTFPrefix(); 00125 00126 protected: 00127 00128 void 00129 writeData( 00130 const char* theBuffer, 00131 XalanSize_t theBufferLength); 00132 00133 void 00134 doFlush(); 00135 00136 private: 00137 00138 // These are not implemented... 00139 MsgFileOutputStream(const MsgFileOutputStream&); 00140 00141 MsgFileOutputStream& 00142 operator=(const MsgFileOutputStream&); 00143 00144 bool 00145 operator==(const MsgFileOutputStream&) const; 00146 00147 00148 // Data members... 00149 const char* const m_fileName; 00150 00151 const HandleType m_handle; 00152 }; 00153 00154 00155 00156 XALAN_CPP_NAMESPACE_END 00157 00158 00159 00160 #endif // MSGFILEOUTPUTSTREAM_1357924680
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11 |
|