Xalan-C++ API Reference  1.12.0
XalanFStreamOutputStream.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #if !defined(XALANFSTREAMOUTPUTSTREAM_HEADER_GUARD_1357924680)
19 #define XALANFSTREAMOUTPUTSTREAM_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base include file. Must be first.
25 
26 
27 
28 #include <cstdio>
29 
30 
31 
32 // Base class header file.
34 
35 
36 
37 namespace XALAN_CPP_NAMESPACE {
38 
39 using std::FILE;
40 
42 {
43 public :
44 
45  enum { eDefaultBufferSize = 8192u };
46 
47 
48  /**
49  * Construct a XalanFStreamOutputStream object.
50  *
51  * @param theHandle handle of file. Must not be null.
52  * @param theBufferSize The size of the transcoding buffer
53  */
55  FILE* theFileHandle,
56  MemoryManager& theManager,
57  size_type theBufferSize = eDefaultBufferSize);
58 
61  FILE* theFileHandle,
62  MemoryManager& theManager,
63  size_type theBufferSize = eDefaultBufferSize);
64 
65  virtual
67 
69  {
70  public:
71 
72  /**
73  * Construct an XalanFStreamOutputStreamWriteException exception object for an exception
74  * that occurred while writing to a file stream.
75  *
76  * @param theErrorCode number of error encountered
77  */
79  int theErrorCode,
80  XalanDOMString& theBuffer);
81 
82  virtual
84 
85  virtual const XalanDOMChar*
86  getType() const
87  {
88  return m_type;
89  }
90 
91  private:
92  static const XalanDOMChar m_type[];
93  };
94 
95 protected:
96 
97  virtual void
99  const char* theBuffer,
100  size_type theBufferLength);
101 
102  virtual void
104 
105 private:
106 
107  // These are not implemented...
109 
111  operator=(const XalanFStreamOutputStream&);
112 
113  bool
114  operator==(const XalanFStreamOutputStream&) const;
115 
116 
117  // Data members...
118  FILE* const m_handle;
119 };
120 
121 
122 
123 }
124 
125 
126 
127 #endif // XALANFSTREAMOUTPUTSTREAM_HEADER_GUARD_1357924680
#define XALAN_PLATFORMSUPPORT_EXPORT
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
virtual const XalanDOMChar * getType() const
Retrieve type of exception.
XalanFStreamOutputStreamWriteException(int theErrorCode, XalanDOMString &theBuffer)
Construct an XalanFStreamOutputStreamWriteException exception object for an exception that occurred w...
static XalanFStreamOutputStream * create(FILE *theFileHandle, MemoryManager &theManager, size_type theBufferSize=eDefaultBufferSize)
virtual void doFlush()
Flush the stream.
XalanFStreamOutputStream(FILE *theFileHandle, MemoryManager &theManager, size_type theBufferSize=eDefaultBufferSize)
Construct a XalanFStreamOutputStream object.
virtual void writeData(const char *theBuffer, size_type theBufferLength)
Write the data in the buffer.
XalanTranscodingServices::size_type size_type
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)