Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

XalanFileOutputStream.hpp

Go to the documentation of this file.
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 #if !defined(XALANFILEOUTPUTSTREAM_HEADER_GUARD_1357924680)
00017 #define XALANFILEOUTPUTSTREAM_HEADER_GUARD_1357924680
00018 
00019 
00020 
00021 // Base include file.  Must be first.
00022 #include <xalanc/PlatformSupport/PlatformSupportDefinitions.hpp>
00023 
00024 
00025 
00026 #if defined(WIN32)
00027 #include <windows.h>
00028 #else
00029 #include <cstdio>
00030 #endif
00031 
00032 
00033 
00034 // Base class header file.
00035 #include <xalanc/PlatformSupport/XalanOutputStream.hpp>
00036 
00037 
00038 
00039 XALAN_CPP_NAMESPACE_BEGIN
00040 
00041 
00042 
00043 class XALAN_PLATFORMSUPPORT_EXPORT XalanFileOutputStream : public XalanOutputStream
00044 {
00045 public :
00046 
00047     enum { eDefaultBufferSize = 8192 };
00048 
00049 #if defined(WIN32)
00050     typedef HANDLE  HandleType;
00051 #else
00052     typedef FILE*   HandleType;
00053 #endif
00054 
00061     XalanFileOutputStream(
00062             const XalanDOMString&   theFileName,
00063             MemoryManagerType&      theManager,
00064             unsigned int            theBufferSize = eDefaultBufferSize);
00065 
00066     static XalanFileOutputStream*
00067     create(
00068             const XalanDOMString&   theFileName,
00069             MemoryManagerType&      theManager,
00070             unsigned int            theBufferSize = eDefaultBufferSize);
00071     virtual
00072     ~XalanFileOutputStream();
00073 
00074 
00075     class XALAN_PLATFORMSUPPORT_EXPORT XalanFileOutputStreamOpenException : public XalanOutputStream::XalanOutputStreamException
00076     {
00077     public:
00078 
00086         XalanFileOutputStreamOpenException(
00087             const XalanDOMString&   theFileName,
00088             int                     theErrorCode,
00089             XalanDOMString&         theBuffer);
00090 
00091         static XalanFileOutputStreamOpenException*
00092         create(
00093             MemoryManagerType&      theManager,
00094             const XalanDOMString&   theFileName,
00095             int                     theErrorCode,
00096             XalanDOMString&         theBuffer);
00097 
00098         virtual
00099         ~XalanFileOutputStreamOpenException();
00100 
00101         virtual const XalanDOMChar*
00102         getType() const
00103         {
00104             return m_type;
00105         }
00106 
00107     private:
00108         static const XalanDOMChar   m_type[];
00109 
00110     };
00111 
00112     class XALAN_PLATFORMSUPPORT_EXPORT XalanFileOutputStreamWriteException : public XalanOutputStream::XalanOutputStreamException
00113     {
00114     public:
00115 
00123         XalanFileOutputStreamWriteException(
00124             const XalanDOMString&   theFileName,
00125             int                     theErrorCode,
00126             XalanDOMString&         theBuffer);
00127 
00128         virtual
00129         ~XalanFileOutputStreamWriteException();
00130 
00131         virtual const XalanDOMChar*
00132         getType() const
00133         {
00134             return m_type;
00135         }
00136 
00137     private:
00138         static const XalanDOMChar   m_type[];
00139 
00140     };
00141 
00142 protected:
00143 
00144     virtual void
00145     writeData(
00146             const char*     theBuffer,
00147             size_type       theBufferLength);
00148 
00149     virtual void
00150     doFlush();
00151 
00152 private:
00153 
00154     // These are not implemented...
00155     XalanFileOutputStream(const XalanFileOutputStream&);
00156 
00157     XalanFileOutputStream&
00158     operator=(const XalanFileOutputStream&);
00159 
00160     bool
00161     operator==(const XalanFileOutputStream&) const;
00162 
00163 
00164     // Data members...
00165     const XalanDOMString    m_fileName;
00166 
00167     const HandleType        m_handle;
00168 };
00169 
00170 
00171 
00172 XALAN_CPP_NAMESPACE_END
00173 
00174 
00175 
00176 #endif  // XALANFILEOUTPUTSTREAM_HEADER_GUARD_1357924680

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

dot

Xalan-C++ XSLT Processor Version 1.10
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.

Apache Logo