Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

FormatterToText.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #if !defined(FORMATTERTOTEXT_HEADER_GUARD_1357924680)
17 #define FORMATTERTOTEXT_HEADER_GUARD_1357924680
18 
19 
20 
21 // Base include file. Must be first.
23 
24 
25 
27 
28 
29 
30 // Base class header file.
32 
33 
34 
35 XALAN_CPP_NAMESPACE_BEGIN
36 
37 
38 
39 class Writer;
40 
41 
42 
48 {
49 public:
50 
55 
64  Writer& writer,
65  bool normalizeLinefeed = true,
66  bool handleIgnorableWhitespace = true,
68 
78  Writer& writer,
79  const XalanDOMString& encoding,
80  bool normalizeLinefeed = true,
81  bool handleIgnorableWhitespace = true,
82  MemoryManagerType& theManager XALAN_DEFAULT_MEMMGR);
83 
84  static FormatterToText*
85  create(
86  MemoryManagerType& theManager,
87  Writer& writer,
88  const XalanDOMString& encoding,
89  bool normalizeLinefeed = true,
90  bool handleIgnorableWhitespace = true);
91 
92  virtual
93  ~FormatterToText();
94 
97  {
98  return m_encoding.getMemoryManager();
99  }
100 
101  Writer*
102  getWriter() const
103  {
104  return m_writer;
105  }
106 
107  void
108  setWriter(Writer* theWriter)
109  {
110  m_writer = theWriter;
111 
112  update(false);
113  }
114 
115  void
116  clearEncoding();
117 
118  const XalanDOMString&
119  getEncoding() const
120  {
121  return m_encoding;
122  }
123 
124  void
125  setEncoding(const XalanDOMString& theEncoding)
126  {
127  m_encoding = theEncoding;
128 
129  update(false);
130  }
131 
132  XalanDOMChar
134  {
135  return m_maxCharacter;
136  }
137 
138  void
139  setMaxCharacter(XalanDOMChar theMaxChar)
140  {
141  m_maxCharacter = theMaxChar;
142  }
143 
144  bool
146  {
147  return m_normalize;
148  }
149 
150  void
151  setNormalizeLinefeed(bool fNormalize)
152  {
153  m_normalize = fNormalize;
154  }
155 
156  bool
158  {
159  return m_handleIgnorableWhitespace;
160  }
161 
162  void
164  {
165  m_handleIgnorableWhitespace = fHandle;
166  }
167 
168  // These methods are inherited from FormatterListener ...
169 
170  virtual void
171  setDocumentLocator(const LocatorType* const locator);
172 
173  virtual void
174  startDocument();
175 
176  virtual void
177  endDocument();
178 
179  virtual void
180  startElement(
181  const XMLCh* const name,
182  AttributeListType& attrs);
183 
184  virtual void
185  endElement(const XMLCh* const name);
186 
187  virtual void
188  characters(
189  const XMLCh* const chars,
190  const unsigned int length);
191 
192  virtual void
194  const XMLCh* const chars,
195  const unsigned int length);
196 
197  virtual void
198  entityReference(const XMLCh* const name);
199 
200  virtual void
202  const XMLCh* const chars,
203  const unsigned int length);
204 
205  virtual void
207  const XMLCh* const target,
208  const XMLCh* const data);
209 
210  virtual void
211  resetDocument();
212 
213  virtual void
214  comment(const XMLCh* const data);
215 
216  virtual void
217  cdata(
218  const XMLCh* const ch,
219  const unsigned int length);
220 
221 private:
222 
223  // These are not implemented.
225 
227  operator=(const FormatterToText&);
228 
229  bool
230  operator==(const FormatterToText&) const;
231 
232  // Utility function to update various member variables
233  // when data changes.
234  void
235  update(bool fNormalizationOnly);
236 
237  // Data members...
238  Writer* m_writer;
239 
240  XalanDOMChar m_maxCharacter;
241 
242  XalanDOMString m_encoding;
243 
244  bool m_haveEncoding;
245 
246  bool m_normalize;
247 
248  bool m_handleIgnorableWhitespace;
249 
250  const XalanDOMChar* m_newlineString;
251 
252  XalanDOMString::size_type m_newlineStringLength;
253 };
254 
255 
256 
257 XALAN_CPP_NAMESPACE_END
258 
259 
260 
261 #endif // FORMATTERTOTEXT_HEADER_GUARD_1357924680
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
Definition: XalanVector.hpp:1111
Writer * getWriter() const
Definition: FormatterToText.hpp:102
#define XALAN_DEFAULT_CONSTRACTOR_MEMORY_MGR
Definition: XalanMemoryManagement.hpp:401
void setHandleIgnorableWhitespace(bool fHandle)
Definition: FormatterToText.hpp:163
XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType
Definition: AttributeListImpl.hpp:39
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType
Definition: XalanMemoryManagement.hpp:39
Definition: Writer.hpp:42
virtual void startDocument()=0
const XalanDOMString & getEncoding() const
Definition: FormatterToText.hpp:119
virtual void setDocumentLocator(const Locator *const locator)=0
virtual void startElement(const XMLCh *const name, AttributeList &attrs)=0
MemoryManagerType & getMemoryManager()
Definition: FormatterToText.hpp:96
virtual void ignorableWhitespace(const XMLCh *const chars, const size_type length)=0
void setNormalizeLinefeed(bool fNormalize)
Definition: FormatterToText.hpp:151
#define XALAN_DEFAULT_MEMMGR
Definition: XalanMemoryManagement.hpp:402
virtual void resetDocument()=0
bool getNormalizeLinefeed() const
Definition: FormatterToText.hpp:145
virtual void charactersRaw(const XMLCh *const chars, const size_type length)=0
Receive notification of character data.
virtual void characters(const XMLCh *const chars, const size_type length)=0
void setMaxCharacter(XalanDOMChar theMaxChar)
Definition: FormatterToText.hpp:139
A SAX-based formatter interface for the XSL processor.
Definition: FormatterListener.hpp:62
virtual void endDocument()=0
#define XALAN_XMLSUPPORT_EXPORT
Definition: XMLSupportDefinitions.hpp:33
virtual void entityReference(const XMLCh *const name)=0
Receive notification of a entityReference.
virtual void cdata(const XMLCh *const ch, const size_type length)=0
Receive notification of cdata.
virtual void endElement(const XMLCh *const name)=0
XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType
Definition: FormatterListener.hpp:47
XalanDOMChar getMaxCharacter() const
Definition: FormatterToText.hpp:133
void setWriter(Writer *theWriter)
Definition: FormatterToText.hpp:108
Definition: XalanDOMString.hpp:42
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
Definition: DOMStringHelper.hpp:277
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)=0
This class takes SAX events (in addition to some extra events that SAX doesn't handle yet) and produc...
Definition: FormatterToText.hpp:47
void setEncoding(const XalanDOMString &theEncoding)
Definition: FormatterToText.hpp:125
bool getHandleIgnorableWhitespace() const
Definition: FormatterToText.hpp:157
unsigned int size_type
Definition: XalanDOMString.hpp:53
virtual void comment(const XMLCh *const data)=0
Called when a Comment is to be constructed.

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