00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one 00003 * or more contributor license agreements. See the NOTICE file 00004 * distributed with this work for additional information 00005 * regarding copyright ownership. The ASF licenses this file 00006 * to you under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 #if !defined(FORMATTERSTRINGLENGTHCOUNTER_HEADER_GUARD_1357924680) 00019 #define FORMATTERSTRINGLENGTHCOUNTER_HEADER_GUARD_1357924680 00020 00021 00022 00023 // Base include file. Must be first. 00024 #include <xalanc/XPath/XPathDefinitions.hpp> 00025 00026 00027 00028 // Base class header file. 00029 #include <xalanc/PlatformSupport/FormatterListener.hpp> 00030 00031 00032 00033 XALAN_CPP_NAMESPACE_BEGIN 00034 00035 00036 00037 /** 00038 * This class takes SAX events (in addition to some extra events 00039 * that SAX doesn't handle yet) and produces counts the characters 00040 * sent to the characters event. 00041 */ 00042 class XALAN_XPATH_EXPORT FormatterStringLengthCounter : public FormatterListener 00043 { 00044 public: 00045 00046 /** 00047 * FormatterStringLengthCounter instance constructor. 00048 */ 00049 explicit 00050 FormatterStringLengthCounter(); 00051 00052 virtual 00053 ~FormatterStringLengthCounter(); 00054 00055 00056 size_type 00057 getCount() const 00058 { 00059 return m_count; 00060 } 00061 00062 // These methods are inherited from FormatterListener ... 00063 00064 virtual void 00065 setDocumentLocator(const Locator* const locator); 00066 00067 virtual void 00068 startDocument(); 00069 00070 virtual void 00071 endDocument(); 00072 00073 virtual void 00074 startElement( 00075 const XMLCh* const name, 00076 AttributeListType& attrs); 00077 00078 virtual void 00079 endElement(const XMLCh* const name); 00080 00081 virtual void 00082 characters( 00083 const XMLCh* const chars, 00084 const size_type length); 00085 00086 virtual void 00087 charactersRaw( 00088 const XMLCh* const chars, 00089 const size_type length); 00090 00091 virtual void 00092 entityReference(const XMLCh* const name); 00093 00094 virtual void 00095 ignorableWhitespace( 00096 const XMLCh* const chars, 00097 const size_type length); 00098 00099 virtual void 00100 processingInstruction( 00101 const XMLCh* const target, 00102 const XMLCh* const data); 00103 00104 virtual void 00105 resetDocument(); 00106 00107 virtual void 00108 comment(const XMLCh* const data); 00109 00110 virtual void 00111 cdata( 00112 const XMLCh* const ch, 00113 const size_type length); 00114 00115 private: 00116 00117 // These are not implemented. 00118 FormatterStringLengthCounter(const FormatterStringLengthCounter&); 00119 00120 FormatterStringLengthCounter& 00121 operator=(const FormatterStringLengthCounter&); 00122 00123 bool 00124 operator==(const FormatterStringLengthCounter&) const; 00125 00126 // Data members... 00127 size_type m_count; 00128 }; 00129 00130 00131 00132 XALAN_CPP_NAMESPACE_END 00133 00134 00135 00136 #endif // FORMATTERSTRINGLENGTHCOUNTER_HEADER_GUARD_1357924680
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11 |
|