Xalan-C++ API Reference 1.12.0
Writer.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(WRITER_HEADER_GUARD_1357924680)
19#define WRITER_HEADER_GUARD_1357924680
20
21
22
23// Base include file. Must be first.
25
26
27
28#include <cstddef>
29
30
31
33
34
35
36namespace XALAN_CPP_NAMESPACE {
37
38
39
40class XalanOutputStream;
41
42
43
45{
46public:
47
49
50 virtual
52
53 /**
54 * Close the stream
55 */
56 virtual void
57 close() = 0;
58
59 /**
60 * Flush the stream
61 */
62 virtual void
63 flush() = 0;
64
65 /**
66 * Get the stream associated with the writer...
67 */
68 virtual XalanOutputStream*
70
71 /**
72 * Get the stream associated with the writer...
73 */
74 virtual const XalanOutputStream*
75 getStream() const;
76
77
78 // Output functions
79
80 static const size_t npos;
81
82 /**
83 * Writes a string
84 *
85 * @param s string to write
86 * @param theOffset starting offset in string to begin writing, default 0
87 * @param theLength number of characters to write. If the length is npos, then the array is assumed to be null-terminated.
88 */
89 virtual void
91 const char* s,
92 size_t theOffset = 0,
93 size_t theLength = npos) = 0;
94
95 /**
96 * Writes a string
97 *
98 * @param s string to write
99 * @param theOffset starting offset in string to begin writing, default 0
100 * @param theLength number of characters to write. If the length is XalanDOMString::npos, then the array is assumed to be null-terminated.
101 */
102 virtual void
104 const XalanDOMChar* s,
106 XalanDOMString::size_type theLength = XalanDOMString::npos) = 0;
107
108 /**
109 * Writes a character
110 *
111 * @param c character to write
112 */
113 virtual void
115
116 /**
117 * Writes a string
118 *
119 * @param s string to write
120 * @param theOffset starting offset in string to begin writing, default 0
121 * @param theLength number of characters to write. If the length is XalanDOMString::npos, then the entire string is printed.
122 */
123 virtual void
125 const XalanDOMString& s,
127 XalanDOMString::size_type theLength = XalanDOMString::npos) = 0;
128
129private:
130
131 // Not implemented
132 Writer(const Writer&);
133
134 Writer&
135 operator=(const Writer&);
136
137 bool
138 operator==(const Writer&);
139};
140
141
142
143}
144
145
146
147#endif // WRITER_HEADER_GUARD_1357924680
#define XALAN_PLATFORMSUPPORT_EXPORT
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
virtual void write(const char *s, size_t theOffset=0, size_t theLength=npos)=0
Writes a string.
static const size_t npos
Definition Writer.hpp:80
virtual void close()=0
Close the stream.
virtual void write(XalanDOMChar c)=0
Writes a character.
virtual void flush()=0
Flush the stream.
virtual void write(const XalanDOMString &s, XalanDOMString::size_type theOffset=0, XalanDOMString::size_type theLength=XalanDOMString::npos)=0
Writes a string.
virtual const XalanOutputStream * getStream() const
Get the stream associated with the writer...
virtual ~Writer()
virtual XalanOutputStream * getStream()
Get the stream associated with the writer...
virtual void write(const XalanDOMChar *s, XalanDOMString::size_type theOffset=0, XalanDOMString::size_type theLength=XalanDOMString::npos)=0
Writes a string.
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)