Xalan-C++ API Reference  1.12.0
XalanStdOutputStream.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(XALANSTDOUTPUTSTREAM_HEADER_GUARD_1357924680)
19 #define XALANSTDOUTPUTSTREAM_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base include file. Must be first.
25 
26 
27 
28 #include <iosfwd>
29 #include <ios>
30 
31 
32 
33 // Base class header file.
35 
36 
37 
38 namespace XALAN_CPP_NAMESPACE {
39 
40 
41 
42 // A base class for all text output streams.
44 {
45 public:
46 
47  typedef std::ostream StreamType;
48 
49  typedef std::streamsize StreamSizeType;
50 
51  /**
52  * Construct a XalanStdOutputStream instance for output to the
53  * standard output device.
54  *
55  * @param theOutputStream output stream to use
56  */
57  XalanStdOutputStream(StreamType& theOutputStream,
58  MemoryManager& theManager XALAN_DEFAULT_MEMMGR);
59 
60  static XalanStdOutputStream*
61  create( StreamType& theOutputStream,
62  MemoryManager& theManager);
63 
64  virtual
66 
67 #if defined(XALAN_NEWLINE_IS_CRLF)
68  virtual void
69  newline();
70 
71  virtual const XalanDOMChar*
72  getNewlineString() const;
73 #endif
74 
75 
77  {
78  public:
79 
80  XalanStdOutputStreamWriteException(int theErrorCode,
81  XalanDOMString& theResult);
82 
83  virtual
85 
86  virtual const XalanDOMChar*
87  getType() const
88  {
89  return m_type;
90  }
91 
92  private:
93 
94  static const XalanDOMChar m_type[];
95 
96  };
97 
98 protected:
99 
100  virtual void
101  writeData(
102  const char* theBuffer,
103  size_type theBufferLength);
104 
105  virtual void
106  doFlush();
107 
108 private:
109 
110  // These are not implemented...
112 
114  operator=(const XalanStdOutputStream&);
115 
116  // Data members...
117  StreamType& m_outputStream;
118 
119 #if defined(XALAN_NEWLINE_IS_CRLF)
120  const XalanDOMChar* m_newlineString;
121 
122  XalanDOMString::size_type m_newlineStringLength;
123 #endif
124 };
125 
126 
127 
128 }
129 
130 
131 
132 #endif // XERCESSTDTEXTOUTPUTSTREAM_HEADER_GUARD_1357924680
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
XalanOutputStream.hpp
xalanc::XalanStdOutputStream::StreamType
std::ostream StreamType
Definition: XalanStdOutputStream.hpp:47
xalanc::size_type
size_t size_type
Definition: XalanMap.hpp:46
XALAN_DEFAULT_MEMMGR
#define XALAN_DEFAULT_MEMMGR
Definition: XalanMemoryManagement.hpp:516
xalanc::XalanOutputStream
Definition: XalanOutputStream.hpp:49
xalanc::XalanStdOutputStream::StreamSizeType
std::streamsize StreamSizeType
Definition: XalanStdOutputStream.hpp:49
XALAN_PLATFORMSUPPORT_EXPORT
#define XALAN_PLATFORMSUPPORT_EXPORT
Definition: PlatformSupportDefinitions.hpp:35
PlatformSupportDefinitions.hpp
xalanc::XalanStdOutputStream::XalanStdOutputStreamWriteException
Definition: XalanStdOutputStream.hpp:76
xalanc::XalanStdOutputStream
Definition: XalanStdOutputStream.hpp:43
xalanc::XalanOutputStream::XalanOutputStreamException
Definition: XalanOutputStream.hpp:288
xalanc::XalanStdOutputStream::XalanStdOutputStreamWriteException::getType
virtual const XalanDOMChar * getType() const
Retrieve type of exception.
Definition: XalanStdOutputStream.hpp:87
xalanc::XalanDOMString::size_type
XalanSize_t size_type
Definition: XalanDOMString.hpp:57
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:45