Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.8

Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

FormatterToText.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 1999-2004 The Apache Software Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 #if !defined(FORMATTERTOTEXT_HEADER_GUARD_1357924680)
00017 #define FORMATTERTOTEXT_HEADER_GUARD_1357924680
00018 
00019 
00020 
00021 // Base include file.  Must be first.
00022 #include <xalanc/XMLSupport/XMLSupportDefinitions.hpp>
00023 
00024 
00025 
00026 #include <xalanc/XalanDOM/XalanDOMString.hpp>
00027 
00028 
00029 
00030 // Base class header file.
00031 #include <xalanc/PlatformSupport/FormatterListener.hpp>
00032 
00033 
00034 
00035 XALAN_CPP_NAMESPACE_BEGIN
00036 
00037 
00038 
00039 class Writer;
00040 
00041 
00042 
00047 class XALAN_XMLSUPPORT_EXPORT FormatterToText : public FormatterListener
00048 {
00049 public:
00050 
00054     FormatterToText();
00055 
00063     FormatterToText(
00064             Writer&     writer,
00065             bool        normalizeLinefeed = true,
00066             bool        handleIgnorableWhitespace = true);
00067 
00076     FormatterToText(
00077             Writer&                 writer,
00078             const XalanDOMString&   encoding,
00079             bool                    normalizeLinefeed = true,
00080             bool                    handleIgnorableWhitespace = true);
00081 
00082     virtual
00083     ~FormatterToText();
00084 
00085 
00086     Writer*
00087     getWriter() const
00088     {
00089         return m_writer;
00090     }
00091 
00092     void
00093     setWriter(Writer*   theWriter)
00094     {
00095         m_writer = theWriter;
00096 
00097         update(false);
00098     }
00099 
00100     void
00101     clearEncoding();
00102 
00103     const XalanDOMString&
00104     getEncoding() const
00105     {
00106         return m_encoding;
00107     }
00108 
00109     void
00110     setEncoding(const XalanDOMString&   theEncoding)
00111     {
00112         m_encoding = theEncoding;
00113 
00114         update(false);
00115     }
00116 
00117     XalanDOMChar
00118     getMaxCharacter() const
00119     {
00120         return m_maxCharacter;
00121     }
00122 
00123     void
00124     setMaxCharacter(XalanDOMChar    theMaxChar)
00125     {
00126         m_maxCharacter = theMaxChar;
00127     }
00128 
00129     bool
00130     getNormalizeLinefeed() const
00131     {
00132         return m_normalize;
00133     }
00134 
00135     void
00136     setNormalizeLinefeed(bool   fNormalize)
00137     {
00138         m_normalize = fNormalize;
00139     }
00140 
00141     bool
00142     getHandleIgnorableWhitespace() const
00143     {
00144         return m_handleIgnorableWhitespace;
00145     }
00146 
00147     void
00148     setHandleIgnorableWhitespace(bool   fHandle)
00149     {
00150         m_handleIgnorableWhitespace = fHandle;
00151     }
00152 
00153     // These methods are inherited from FormatterListener ...
00154 
00155     virtual void
00156     setDocumentLocator(const LocatorType* const     locator);
00157 
00158     virtual void
00159     startDocument();
00160 
00161     virtual void
00162     endDocument();
00163 
00164     virtual void
00165     startElement(
00166             const XMLCh* const  name,
00167             AttributeListType&  attrs);
00168 
00169     virtual void
00170     endElement(const XMLCh* const   name);
00171 
00172     virtual void
00173     characters(
00174             const XMLCh* const  chars,
00175             const unsigned int  length);
00176 
00177     virtual void
00178     charactersRaw(
00179             const XMLCh* const  chars,
00180             const unsigned int  length);
00181 
00182     virtual void
00183     entityReference(const XMLCh* const  name);
00184 
00185     virtual void
00186     ignorableWhitespace(
00187             const XMLCh* const  chars,
00188             const unsigned int  length);
00189 
00190     virtual void
00191     processingInstruction(
00192             const XMLCh* const  target,
00193             const XMLCh* const  data);
00194 
00195     virtual void
00196     resetDocument();
00197 
00198     virtual void
00199     comment(const XMLCh* const  data);
00200 
00201     virtual void
00202     cdata(
00203             const XMLCh* const  ch,
00204             const unsigned int  length);
00205 
00206 private:
00207 
00208     // These are not implemented.
00209     FormatterToText(const FormatterToText&);
00210 
00211     FormatterToText&
00212     operator=(const FormatterToText&);
00213 
00214     bool
00215     operator==(const FormatterToText&) const;
00216 
00217     // Utility function to update various member variables
00218     // when data changes.
00219     void
00220     update(bool fNormalizationOnly);
00221 
00222     // Data members...
00223     Writer*         m_writer;
00224 
00225     XalanDOMChar    m_maxCharacter;
00226 
00227     XalanDOMString  m_encoding;
00228 
00229     bool            m_haveEncoding;
00230 
00231     bool            m_normalize;
00232 
00233     bool            m_handleIgnorableWhitespace;
00234 
00235     const XalanDOMChar*         m_newlineString;
00236 
00237     XalanDOMString::size_type   m_newlineStringLength;
00238 };
00239 
00240 
00241 
00242 XALAN_CPP_NAMESPACE_END
00243 
00244 
00245 
00246 #endif  // FORMATTERTOTEXT_HEADER_GUARD_1357924680

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.8
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.