Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


FormatterToText.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(FORMATTERTOTEXT_HEADER_GUARD_1357924680)
19 #define FORMATTERTOTEXT_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base include file. Must be first.
25 
26 
27 
29 
30 
31 
32 // Base class header file.
34 
35 
36 
37 XALAN_CPP_NAMESPACE_BEGIN
38 
39 
40 
41 class Writer;
42 
43 
44 
45 /**
46  * This class takes SAX events (in addition to some extra events
47  * that SAX doesn't handle yet) and produces simple text only.
48  */
50 {
51 public:
52 
53  /**
54  * FormatterToText instance constructor.
55  */
57 
58  /**
59  * FormatterToText instance constructor.
60  *
61  * @param writer writer for output
62  * @param normalizeLindefeed Normalize \n or \r\n (on certain platforms).
63  * @param handleIgnorableWhitespace If true ignorableWhitespace() will write data to the Writer
64  */
66  Writer& writer,
67  bool normalizeLinefeed = true,
68  bool handleIgnorableWhitespace = true,
69  MemoryManager& theManager XALAN_DEFAULT_MEMMGR);
70 
71  /**
72  * FormatterToText instance constructor.
73  *
74  * @param writer writer for output
75  * @param encoding character encoding for the writer
76  * @param normalizeLindefeed Normalize \n or \r\n on certain platforms.
77  * @param handleIgnorableWhitespace If true ignorableWhitespace() will write data to the Writer
78  */
80  Writer& writer,
81  const XalanDOMString& encoding,
82  bool normalizeLinefeed = true,
83  bool handleIgnorableWhitespace = true,
84  MemoryManager& theManager XALAN_DEFAULT_MEMMGR);
85 
86  static FormatterToText*
88  MemoryManager& theManager,
89  Writer& writer,
90  const XalanDOMString& encoding,
91  bool normalizeLinefeed = true,
92  bool handleIgnorableWhitespace = true);
93 
94  virtual
96 
97  MemoryManager&
99  {
100  return m_encoding.getMemoryManager();
101  }
102 
103  Writer*
104  getWriter() const
105  {
106  return m_writer;
107  }
108 
109  void
110  setWriter(Writer* theWriter)
111  {
112  m_writer = theWriter;
113 
114  update(false);
115  }
116 
117  void
119 
120  const XalanDOMString&
121  getEncoding() const
122  {
123  return m_encoding;
124  }
125 
126  void
127  setEncoding(const XalanDOMString& theEncoding)
128  {
129  m_encoding = theEncoding;
130 
131  update(false);
132  }
133 
134  XalanDOMChar
136  {
137  return m_maxCharacter;
138  }
139 
140  void
141  setMaxCharacter(XalanDOMChar theMaxChar)
142  {
143  m_maxCharacter = theMaxChar;
144  }
145 
146  bool
148  {
149  return m_normalize;
150  }
151 
152  void
153  setNormalizeLinefeed(bool fNormalize)
154  {
155  m_normalize = fNormalize;
156  }
157 
158  bool
160  {
161  return m_handleIgnorableWhitespace;
162  }
163 
164  void
166  {
167  m_handleIgnorableWhitespace = fHandle;
168  }
169 
170  // These methods are inherited from FormatterListener ...
171 
172  virtual void
173  setDocumentLocator(const Locator* const locator);
174 
175  virtual void
177 
178  virtual void
180 
181  virtual void
183  const XMLCh* const name,
184  AttributeListType& attrs);
185 
186  virtual void
187  endElement(const XMLCh* const name);
188 
189  virtual void
191  const XMLCh* const chars,
192  const size_type length);
193 
194  virtual void
196  const XMLCh* const chars,
197  const size_type length);
198 
199  virtual void
200  entityReference(const XMLCh* const name);
201 
202  virtual void
204  const XMLCh* const chars,
205  const size_type length);
206 
207  virtual void
209  const XMLCh* const target,
210  const XMLCh* const data);
211 
212  virtual void
214 
215  virtual void
216  comment(const XMLCh* const data);
217 
218  virtual void
220  const XMLCh* const ch,
221  const size_type length);
222 
223 private:
224 
225  // These are not implemented.
227 
229  operator=(const FormatterToText&);
230 
231  bool
232  operator==(const FormatterToText&) const;
233 
234  // Utility function to update various member variables
235  // when data changes.
236  void
237  update(bool fNormalizationOnly);
238 
239  // Data members...
240  Writer* m_writer;
241 
242  XalanDOMChar m_maxCharacter;
243 
244  XalanDOMString m_encoding;
245 
246  bool m_haveEncoding;
247 
248  bool m_normalize;
249 
250  bool m_handleIgnorableWhitespace;
251 
252  const XalanDOMChar* m_newlineString;
253 
254  XalanDOMString::size_type m_newlineStringLength;
255 };
256 
257 
258 
259 XALAN_CPP_NAMESPACE_END
260 
261 
262 
263 #endif // FORMATTERTOTEXT_HEADER_GUARD_1357924680
FormatterToText::setNormalizeLinefeed
void setNormalizeLinefeed(bool fNormalize)
Definition: FormatterToText.hpp:153
FormatterToText::startDocument
virtual void startDocument()
FormatterToText::resetDocument
virtual void resetDocument()
FormatterToText::entityReference
virtual void entityReference(const XMLCh *const name)
Receive notification of a entityReference.
FormatterToText::~FormatterToText
virtual ~FormatterToText()
length
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
Definition: DOMStringHelper.hpp:239
FormatterToText::characters
virtual void characters(const XMLCh *const chars, const size_type length)
XalanDOMString::size_type
XalanSize_t size_type
Definition: XalanDOMString.hpp:57
operator==
bool operator==(const ElemAttributeSet &theLHS, const ElemAttributeSet &theRHS)
Definition: ElemAttributeSet.hpp:111
FormatterListener
A SAX-based formatter interface for the XSL processor.
Definition: FormatterListener.hpp:57
XalanDOMString.hpp
FormatterListener.hpp
XALAN_DEFAULT_MEMMGR
#define XALAN_DEFAULT_MEMMGR
Definition: XalanMemoryManagement.hpp:524
FormatterToText::getMaxCharacter
XalanDOMChar getMaxCharacter() const
Definition: FormatterToText.hpp:135
FormatterToText::getNormalizeLinefeed
bool getNormalizeLinefeed() const
Definition: FormatterToText.hpp:147
FormatterToText::startElement
virtual void startElement(const XMLCh *const name, AttributeListType &attrs)
FormatterToText::setDocumentLocator
virtual void setDocumentLocator(const Locator *const locator)
FormatterToText::charactersRaw
virtual void charactersRaw(const XMLCh *const chars, const size_type length)
Receive notification of character data.
FormatterToText::setEncoding
void setEncoding(const XalanDOMString &theEncoding)
Definition: FormatterToText.hpp:127
FormatterToText::processingInstruction
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)
FormatterToText::ignorableWhitespace
virtual void ignorableWhitespace(const XMLCh *const chars, const size_type length)
FormatterListener::size_type
XalanSize_t size_type
Definition: FormatterListener.hpp:63
FormatterToText::getMemoryManager
MemoryManager & getMemoryManager()
Definition: FormatterToText.hpp:98
FormatterToText::endElement
virtual void endElement(const XMLCh *const name)
FormatterToText::endDocument
virtual void endDocument()
XalanDOMString
Definition: XalanDOMString.hpp:46
FormatterToText::FormatterToText
FormatterToText(MemoryManager &theManager XALAN_DEFAULT_CONSTRUCTOR_MEMMGR)
FormatterToText instance constructor.
FormatterToText::FormatterToText
FormatterToText(Writer &writer, bool normalizeLinefeed=true, bool handleIgnorableWhitespace=true, MemoryManager &theManager XALAN_DEFAULT_MEMMGR)
FormatterToText instance constructor.
FormatterToText::getWriter
Writer * getWriter() const
Definition: FormatterToText.hpp:104
FormatterToText
This class takes SAX events (in addition to some extra events that SAX doesn't handle yet) and produc...
Definition: FormatterToText.hpp:50
FormatterToText::setWriter
void setWriter(Writer *theWriter)
Definition: FormatterToText.hpp:110
FormatterToText::FormatterToText
FormatterToText(Writer &writer, const XalanDOMString &encoding, bool normalizeLinefeed=true, bool handleIgnorableWhitespace=true, MemoryManager &theManager XALAN_DEFAULT_MEMMGR)
FormatterToText instance constructor.
FormatterToText::getEncoding
const XalanDOMString & getEncoding() const
Definition: FormatterToText.hpp:121
FormatterToText::setMaxCharacter
void setMaxCharacter(XalanDOMChar theMaxChar)
Definition: FormatterToText.hpp:141
FormatterToText::getHandleIgnorableWhitespace
bool getHandleIgnorableWhitespace() const
Definition: FormatterToText.hpp:159
AttributeListType
XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType
Definition: XalanSourceTreeContentHandler.hpp:61
Writer
Definition: Writer.hpp:45
FormatterToText::setHandleIgnorableWhitespace
void setHandleIgnorableWhitespace(bool fHandle)
Definition: FormatterToText.hpp:165
XMLSupportDefinitions.hpp
XALAN_XMLSUPPORT_EXPORT
#define XALAN_XMLSUPPORT_EXPORT
Definition: XMLSupportDefinitions.hpp:35
FormatterToText::comment
virtual void comment(const XMLCh *const data)
Called when a Comment is to be constructed.
FormatterToText::create
static FormatterToText * create(MemoryManager &theManager, Writer &writer, const XalanDOMString &encoding, bool normalizeLinefeed=true, bool handleIgnorableWhitespace=true)
XALAN_DEFAULT_CONSTRUCTOR_MEMMGR
#define XALAN_DEFAULT_CONSTRUCTOR_MEMMGR
Definition: XalanMemoryManagement.hpp:523
FormatterToText::clearEncoding
void clearEncoding()
FormatterToText::cdata
virtual void cdata(const XMLCh *const ch, const size_type length)
Receive notification of cdata.

Interpreting class diagrams

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

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

Apache Logo