Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.5

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

DOMStringHelper.hpp

Go to the documentation of this file.
00001 /*
00002  * The Apache Software License, Version 1.1
00003  *
00004  *
00005  * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights 
00006  * reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions
00010  * are met:
00011  *
00012  * 1. Redistributions of source code must retain the above copyright
00013  *    notice, this list of conditions and the following disclaimer. 
00014  *
00015  * 2. Redistributions in binary form must reproduce the above copyright
00016  *    notice, this list of conditions and the following disclaimer in
00017  *    the documentation and/or other materials provided with the
00018  *    distribution.
00019  *
00020  * 3. The end-user documentation included with the redistribution,
00021  *    if any, must include the following acknowledgment:  
00022  *       "This product includes software developed by the
00023  *        Apache Software Foundation (http://www.apache.org/)."
00024  *    Alternately, this acknowledgment may appear in the software itself,
00025  *    if and wherever such third-party acknowledgments normally appear.
00026  *
00027  * 4. The names "Xalan" and "Apache Software Foundation" must
00028  *    not be used to endorse or promote products derived from this
00029  *    software without prior written permission. For written 
00030  *    permission, please contact apache@apache.org.
00031  *
00032  * 5. Products derived from this software may not be called "Apache",
00033  *    nor may "Apache" appear in their name, without prior written
00034  *    permission of the Apache Software Foundation.
00035  *
00036  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
00037  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00038  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00039  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
00040  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00041  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00042  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
00043  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00044  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00045  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
00046  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00047  * SUCH DAMAGE.
00048  * ====================================================================
00049  *
00050  * This software consists of voluntary contributions made by many
00051  * individuals on behalf of the Apache Software Foundation and was
00052  * originally based on software copyright (c) 1999, International
00053  * Business Machines, Inc., http://www.ibm.com.  For more
00054  * information on the Apache Software Foundation, please see
00055  * <http://www.apache.org/>.
00056  */
00057 #if !defined(DOMSTRINGHELPER_HEADER_GUARD_1357924680)
00058 #define DOMSTRINGHELPER_HEADER_GUARD_1357924680
00059 
00060 
00061 
00062 // Base include file.  Must be first.
00063 #include <PlatformSupport/PlatformSupportDefinitions.hpp>
00064 
00065 
00066 
00067 #include <algorithm>
00068 #include <cassert>
00069 #include <functional>
00070 #if defined(XALAN_CLASSIC_IOSTREAMS)
00071 class ostream;
00072 #else
00073 #include <iosfwd>
00074 #endif
00075 #include <vector>
00076 
00077 
00078 
00079 #include <XalanDOM/XalanDOMString.hpp>
00080 
00081 
00082 
00083 #include <PlatformSupport/FormatterListener.hpp>
00084 #include <PlatformSupport/XalanUnicode.hpp>
00085 #include <PlatformSupport/XalanXMLChar.hpp>
00086 
00087 
00088 
00089 XALAN_CPP_NAMESPACE_BEGIN
00090 
00091 
00092 
00093 class XalanOutputStream;
00094 
00095 
00096 
00097 // This macro has been defined to deal with certain C++ compilers which
00098 // do not create Unicode strings when the "L" string constant prefix is
00099 // used.  It is meant _only_ for use with static strings.
00100 #if defined(XALAN_LSTRSUPPORT) && !defined(XALAN_XALANDOMCHAR_USHORT_MISMATCH)
00101 
00102 #define XALAN_STATIC_UCODE_STRING(str) L##str
00103 
00114 inline const XalanDOMString
00115 StaticStringToDOMString(const XalanDOMChar*     theString)
00116 {
00117     return XalanDOMString(theString);
00118 }
00119 
00120 #else
00121 
00122 #define XALAN_STATIC_UCODE_STRING(str) XALAN_CPP_NAMESPACE_QUALIFIER TranscodeFromLocalCodePage(str)
00123 
00132 inline const XalanDOMString&
00133 StaticStringToDOMString(const XalanDOMString&   theString)
00134 {
00135     return theString;
00136 }
00137 
00138 #endif
00139 
00140 
00141 
00142 #if defined(XALAN_NO_ALGORITHMS_WITH_BUILTINS)
00143 
00144 template<class InputIteratorType, class OutputIteratorType>
00145 inline OutputIteratorType
00146 XalanCopy(
00147             InputIteratorType   begin,
00148             InputIteratorType   end,
00149             OutputIteratorType  iterator)
00150 {
00151     for(; begin != end; ++iterator, ++begin)
00152     {
00153         *iterator = *begin;
00154     }
00155 
00156     return iterator;
00157 }
00158 
00159 
00160 
00161 template<class InputIteratorType, class OutputIteratorType, class UnaryFunction>
00162 inline OutputIteratorType
00163 XalanTransform(
00164             InputIteratorType   begin,
00165             InputIteratorType   end,
00166             OutputIteratorType  iterator,
00167             UnaryFunction       function)
00168 {
00169     for(; begin != end; ++iterator, ++begin)
00170     {
00171         *iterator = function(*begin);
00172     }
00173 
00174     return iterator;
00175 }
00176 
00177 #else
00178 
00179 template<class InputIteratorType, class OutputIteratorType>
00180 inline OutputIteratorType
00181 XalanCopy(
00182             InputIteratorType   begin,
00183             InputIteratorType   end,
00184             OutputIteratorType  iterator)
00185 {
00186     return XALAN_STD_QUALIFIER copy(begin, end, iterator);
00187 }
00188 
00189 
00190 
00191 template<class InputIteratorType, class OutputIteratorType, class UnaryFunction>
00192 inline OutputIteratorType
00193 XalanTransform(
00194             InputIteratorType   begin,
00195             InputIteratorType   end,
00196             OutputIteratorType  iterator,
00197             UnaryFunction       function)
00198 {
00199     return XALAN_STD_QUALIFIER transform(begin, end, iterator);
00200 }
00201 
00202 #endif
00203 
00204 
00205 
00213 inline const XalanDOMChar*
00214 c_wstr(const XalanDOMString&    theString)
00215 {
00216     return theString.c_str();
00217 }
00218 
00219 
00220 
00228 inline const char*
00229 c_str(const CharVectorType&     theString)
00230 {
00231     if (theString.empty() == true)
00232     {
00233         return 0;
00234     }
00235     else
00236     {
00237         const char* const   ptr = &theString[0];
00238 
00239         assert(ptr[theString.size() - 1] == '\0');
00240 
00241         return ptr;
00242     }
00243 }
00244 
00245 
00246 
00262 inline const XalanDOMChar*
00263 c_wstr(const XalanDOMChar*  theString)
00264 {
00265     return theString;
00266 }
00267 
00268 
00269 
00277 inline const XalanDOMChar*
00278 toCharArray(const XalanDOMString&   theString)
00279 {
00280     return theString.c_str();
00281 }
00282 
00283 
00284 
00291 inline const XalanDOMChar*
00292 toCharArray(const XalanDOMChar*     theString)
00293 {
00294     return theString;
00295 }
00296 
00297 
00298 
00306 inline const char*
00307 toCharArray(const CharVectorType&   theString)
00308 {
00309     return theString.empty() == true ? 0 : &theString[0];
00310 }
00311 
00312 
00313 
00321 inline void
00322 reserve(
00323             XalanDOMString&             theString,
00324             XalanDOMString::size_type   theCount)
00325 {
00326     theString.reserve(theCount);
00327 }
00328 
00329 
00330 
00337 inline XalanDOMString::size_type
00338 length(const XalanDOMString&    theString)
00339 {
00340     return theString.length();
00341 }
00342 
00343 
00344 
00352 inline XalanDOMString::size_type
00353 length(const XalanDOMChar*  theString)
00354 {
00355     assert(theString != 0);
00356 
00357     const XalanDOMChar*     theBufferPointer = theString;
00358 
00359     while(*theBufferPointer != 0)
00360     {
00361         theBufferPointer++;
00362     }
00363 
00364     return XalanDOMString::size_type(theBufferPointer - theString);
00365 }
00366 
00367 
00368 
00375 inline XalanDOMString::size_type
00376 length(const char*  theString)
00377 {
00378     assert(theString != 0);
00379 
00380     return XalanDOMString::length(theString);
00381 }
00382 
00383 
00384 
00391 inline bool 
00392 isEmpty(const XalanDOMString&   str)
00393 {
00394     return str.empty(); 
00395 }
00396 
00397 
00398 
00408 inline XalanDOMString::size_type
00409 indexOf(
00410             const XalanDOMChar*     theString,
00411             XalanDOMChar            theChar)
00412 {
00413     assert(theString != 0);
00414 
00415     const XalanDOMChar*     thePointer = theString;
00416 
00417     while(*thePointer != theChar && *thePointer != 0)
00418     {
00419         ++thePointer;
00420     }
00421 
00422     return XalanDOMString::size_type(thePointer - theString);
00423 }
00424 
00425 
00426 
00437 inline XalanDOMString::size_type
00438 indexOf(
00439             const XalanDOMChar*         theString,
00440             XalanDOMString::size_type   theStringLength,
00441             XalanDOMChar                theChar)
00442 {
00443     assert(theString != 0);
00444 
00445     const XalanDOMChar*         thePointer = theString;
00446     const XalanDOMChar* const   theEndPointer = theString + theStringLength;
00447 
00448     while(*thePointer != theChar && thePointer != theEndPointer)
00449     {
00450         ++thePointer;
00451     }
00452 
00453     return XalanDOMString::size_type(thePointer - theString);
00454 }
00455 
00456 
00457 
00467 inline XalanDOMString::size_type
00468 indexOf(
00469             const XalanDOMString&   theString,
00470             XalanDOMChar            theChar)
00471 {
00472     return length(theString) == 0 ? 0 : indexOf(c_wstr(theString), theChar);
00473 }
00474 
00475 
00476 
00486 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString::size_type)
00487 indexOf(
00488             const XalanDOMChar*     theString,
00489             const XalanDOMChar*     theSubstring);
00490 
00491 
00501 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString::size_type)
00502 indexOf(
00503             const XalanDOMString&   theString,
00504             const XalanDOMString&   theSubstring);
00505 
00506 
00507 
00518 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString::size_type)
00519 lastIndexOf(
00520             const XalanDOMChar*     theString,
00521             XalanDOMChar            theChar);
00522 
00523 
00524 
00534 inline XalanDOMString::size_type
00535 lastIndexOf(
00536             const XalanDOMString&   theString,
00537             XalanDOMChar            theChar)
00538 {
00539     return lastIndexOf(c_wstr(theString), theChar);
00540 }
00541 
00542 
00543 
00551 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(bool)
00552 startsWith(
00553             const XalanDOMChar*         theString,
00554             XalanDOMString::size_type   theStringLength,
00555             const XalanDOMChar*         theSubstring,
00556             XalanDOMString::size_type   theSubstringLength);
00557 
00558 
00559 
00567 inline bool
00568 startsWith(
00569             const XalanDOMChar*     theString,
00570             const XalanDOMChar*     theSubstring)
00571 {
00572     assert(theString != 0 && theSubstring != 0);
00573 
00574     return startsWith(theString, length(theString), theSubstring, length(theSubstring));
00575 }
00576 
00577 
00578 
00586 inline bool
00587 startsWith(
00588             const XalanDOMChar*     theString,
00589             const XalanDOMString&   theSubstring)
00590 {
00591     assert(theString != 0);
00592 
00593     return startsWith(theString, length(theString), c_wstr(theSubstring), length(theSubstring));
00594 }
00595 
00596 
00597 
00605 inline bool
00606 startsWith(
00607             const XalanDOMString&   theString,
00608             const XalanDOMChar*     theSubstring)
00609 {
00610     assert(theSubstring != 0);
00611 
00612     return startsWith(c_wstr(theString), length(theString), theSubstring, length(theSubstring));
00613 }
00614 
00615 
00616 
00624 inline bool
00625 startsWith(
00626             const XalanDOMString&   theString,
00627             const XalanDOMString&   theSubstring)
00628 {
00629     return startsWith(c_wstr(theString), length(theString), c_wstr(theSubstring), length(theSubstring));
00630 }
00631 
00632 
00633 
00641 inline bool
00642 startsWith(
00643             const XalanDOMString&   theString,
00644             const char*             theSubstring)
00645 {
00646     return startsWith(
00647             theString,
00648             XalanDOMString(theSubstring));
00649 }
00650 
00651 
00652 
00660 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(bool)
00661 endsWith(
00662             const XalanDOMChar*         theString,
00663             XalanDOMString::size_type   theStringLength,
00664             const XalanDOMChar*         theSubstring,
00665             XalanDOMString::size_type   theSubstringLength);
00666 
00667 
00668 
00676 inline bool
00677 endsWith(
00678             const XalanDOMChar*     theString,
00679             const XalanDOMChar*     theSubstring)
00680 {
00681     assert(theString != 0 && theSubstring != 0);
00682 
00683     return endsWith(theString, length(theString), theSubstring, length(theSubstring));
00684 }
00685 
00686 
00687 
00695 inline bool
00696 endsWith(
00697             const XalanDOMString&   theString,
00698             const XalanDOMString&   theSubstring)
00699 {
00700     return endsWith(c_wstr(theString), length(theString), c_wstr(theSubstring), length(theSubstring));
00701 }
00702 
00703 
00704 
00712 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)&
00713 PointerToDOMString(
00714             const void*         theValue,
00715             XalanDOMString&     theResult);
00716 
00717 
00718 
00725 inline const XalanDOMString
00726 PointerToDOMString(const void*  theValue)
00727 {
00728     XalanDOMString  theResult;
00729 
00730     PointerToDOMString(theValue, theResult);
00731 
00732     return theResult;
00733 }
00734 
00735 
00736 
00744 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)&
00745 DoubleToDOMString(
00746             double              theValue,
00747             XalanDOMString&     theResult);
00748 
00749 
00750 
00757 inline const XalanDOMString
00758 DoubleToDOMString(double    theValue)
00759 {
00760     XalanDOMString  theResult;
00761 
00762     DoubleToDOMString(theValue, theResult);
00763 
00764     return theResult;
00765 }
00766 
00767 
00768 
00769 class XALAN_PLATFORMSUPPORT_EXPORT DOMStringHelper
00770 {
00771 public:
00772 
00773     typedef void (FormatterListener::*MemberFunctionPtr)(const XMLCh* const, const unsigned int);
00774 
00775     static void
00776     DoubleToCharacters(
00777             double              theDouble,
00778             FormatterListener&  formatterListener,
00779             MemberFunctionPtr   function);
00780 
00781     static void
00782     LongToCharacters(
00783             long                theLong,
00784             FormatterListener&  formatterListener,
00785             MemberFunctionPtr   function);
00786 };
00787 
00788 
00789 
00798 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)&
00799 LongToHexDOMString(
00800             long                theValue,
00801             XalanDOMString&     theResult);
00802 
00803 
00804 
00812 inline const XalanDOMString
00813 LongToHexDOMString(long     theValue)
00814 {
00815     XalanDOMString  theResult;
00816 
00817     LongToHexDOMString(theValue, theResult);
00818 
00819     return theResult;
00820 }
00821 
00822 
00823 
00832 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)&
00833 UnsignedLongToHexDOMString(
00834             unsigned long       theValue,
00835             XalanDOMString&     theResult);
00836 
00837 
00838 
00846 inline const XalanDOMString
00847 UnsignedLongToHexDOMString(unsigned long    theValue)
00848 {
00849     XalanDOMString  theResult;
00850 
00851     UnsignedLongToHexDOMString(theValue, theResult);
00852 
00853     return theResult;
00854 }
00855 
00856 
00857 
00865 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)&
00866 LongToDOMString(
00867             long                theValue,
00868             XalanDOMString&     theResult);
00869 
00870 
00871 
00878 inline const XalanDOMString
00879 LongToDOMString(long    theValue)
00880 {
00881     XalanDOMString  theResult;
00882 
00883     LongToDOMString(theValue, theResult);
00884 
00885     return theResult;
00886 }
00887 
00888 
00889 
00898 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)&
00899 UnsignedLongToDOMString(
00900             unsigned long       theValue,
00901             XalanDOMString&     theResult);
00902 
00903 
00904 
00911 inline const XalanDOMString
00912 UnsignedLongToDOMString(unsigned long   theValue)
00913 {
00914     XalanDOMString  theResult;
00915 
00916     UnsignedLongToDOMString(theValue, theResult);
00917 
00918     return theResult;
00919 }
00920 
00921 
00922 
00929 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
00930 WideStringToInt(const XalanDOMChar*     theString);
00931 
00932 
00933 
00940 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(long)
00941 WideStringToLong(const XalanDOMChar*    theString);
00942 
00943 
00944 
00951 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(unsigned long)
00952 WideStringToUnsignedLong(const XalanDOMChar*    theString);
00953 
00954 
00955 
00962 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(double)
00963 WideStringToDouble(const XalanDOMChar*  theString);
00964 
00965 
00966 
00973 inline int
00974 DOMStringToInt(const XalanDOMString&    theString)
00975 {
00976     return WideStringToInt(c_wstr(theString));
00977 }
00978 
00979 
00980 
00987 inline long
00988 DOMStringToLong(const XalanDOMString&   theString)
00989 {
00990     return WideStringToLong(c_wstr(theString));
00991 }
00992 
00993 
00994 
01001 inline unsigned long
01002 DOMStringToUnsignedLong(const XalanDOMString&   theString)
01003 {
01004     return WideStringToUnsignedLong(c_wstr(theString));
01005 }
01006 
01007 
01008 
01015 inline double
01016 DOMStringToDouble(const XalanDOMString&     theString)
01017 {
01018     return WideStringToDouble(c_wstr(theString));
01019 }
01020 
01021 
01022 
01030 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
01031 OutputString(
01032             XalanOutputStream&      theStream,
01033             const CharVectorType&   theString);
01034 
01035 
01036 
01044 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
01045 OutputString(
01046 #if defined(XALAN_NO_STD_NAMESPACE)
01047             ostream&                theStream,
01048 #else
01049             std::ostream&           theStream,
01050 #endif
01051             const CharVectorType&   theString);
01052 
01053 
01054 
01062 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
01063 OutputString(
01064             XalanOutputStream&      theStream,
01065             const XalanDOMChar*     theString);
01066 
01067 
01068 
01076 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
01077 OutputString(
01078 #if defined(XALAN_NO_STD_NAMESPACE)
01079             ostream&                theStream,
01080 #else
01081             std::ostream&           theStream,
01082 #endif
01083             const XalanDOMChar*     theString);
01084 
01085 
01086 
01094 inline void
01095 OutputString(
01096             XalanOutputStream&      theStream,
01097             const XalanDOMString&   theString)
01098 {
01099     if (isEmpty(theString) == false)
01100     {
01101         OutputString(theStream, c_wstr(theString));
01102     }
01103 }
01104 
01105 
01106 
01114 inline void
01115 OutputString(
01116 #if defined(XALAN_NO_STD_NAMESPACE)
01117             ostream&                theStream,
01118 #else
01119             std::ostream&           theStream,
01120 #endif
01121             const XalanDOMString&   theString)
01122 {
01123     OutputString(theStream, c_wstr(theString));
01124 }
01125 
01126 
01127 
01135 inline XalanOutputStream&
01136 operator<<(
01137             XalanOutputStream&      theStream,
01138             const CharVectorType&   theString)
01139 {
01140     OutputString(theStream, theString);
01141 
01142     return theStream;
01143 }
01144 
01145 
01146 
01154 #if defined(XALAN_NO_STD_NAMESPACE)
01155 inline ostream&
01156 operator<<(
01157             ostream&                theStream,
01158 #else
01159 inline std::ostream&
01160 operator<<(
01161             std::ostream&           theStream,
01162 #endif
01163             const CharVectorType&   theString)
01164 {
01165     OutputString(theStream, theString);
01166 
01167     return theStream;
01168 }
01169 
01170 
01171 
01179 inline XalanOutputStream&
01180 operator<<(
01181             XalanOutputStream&      theStream,
01182             const XalanDOMChar*     theString)
01183 {
01184     OutputString(theStream,
01185                  theString);
01186 
01187     return theStream;
01188 }
01189 
01190 
01191 
01199 #if defined(XALAN_NO_STD_NAMESPACE)
01200 inline ostream&
01201 operator<<(
01202             ostream&                theStream,
01203 #else
01204 inline std::ostream&
01205 operator<<(
01206             std::ostream&           theStream,
01207 #endif
01208             const XalanDOMChar*     theString)
01209 {
01210     OutputString(theStream,
01211                  theString);
01212 
01213     return theStream;
01214 }
01215 
01216 
01217 
01225 inline XalanOutputStream&
01226 operator<<(
01227             XalanOutputStream&      theStream,
01228             const XalanDOMString&   theString)
01229 {
01230     OutputString(theStream,
01231                  theString);
01232 
01233     return theStream;
01234 }
01235 
01236 
01237 
01245 #if defined(XALAN_NO_STD_NAMESPACE)
01246 inline ostream&
01247 operator<<(
01248             ostream&                theStream,
01249 #else
01250 inline std::ostream&
01251 operator<<(
01252             std::ostream&           theStream,
01253 #endif
01254             const XalanDOMString&   theString)
01255 {
01256     OutputString(theStream,
01257                  theString);
01258 
01259     return theStream;
01260 }
01261 
01262 
01263 
01271 inline XalanDOMChar
01272 charAt(
01273             const XalanDOMString&       theString,
01274             XalanDOMString::size_type   theIndex)
01275 {
01276     return theString[theIndex];
01277 }
01278 
01279 
01280 
01287 inline bool
01288 isXMLWhitespace(XalanDOMChar    theChar)
01289 {
01290     return XalanXMLChar::isWhitespace(theChar);
01291 }
01292 
01293 
01294 
01301 inline bool
01302 isXMLDigit(XalanDOMChar     theChar)
01303 {   
01304     return XalanXMLChar::isDigit(theChar);
01305 }
01306 
01307 
01308 
01315 inline bool
01316 isXMLLetterOrDigit(XalanDOMChar     theChar)
01317 {
01318     return  XalanXMLChar::isDigit(theChar) || 
01319             XalanXMLChar::isLetter(theChar);
01320 }
01321 
01322 
01323 
01335 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)
01336 substring(
01337             const XalanDOMChar*         theString,
01338             XalanDOMString::size_type   theStartIndex,
01339             XalanDOMString::size_type   theEndIndex = XalanDOMString::npos);
01340 
01341 
01342 
01355 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)&
01356 substring(
01357             const XalanDOMChar*         theString,
01358             XalanDOMString&             theSubstring,
01359             XalanDOMString::size_type   theStartIndex,
01360             XalanDOMString::size_type   theEndIndex = XalanDOMString::npos);
01361 
01362 
01363 
01375 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
01376 substring(
01377             const XalanDOMString&       theString,
01378             XalanDOMString&             theSubstring,
01379             XalanDOMString::size_type   theStartIndex,
01380             XalanDOMString::size_type   theEndIndex = XalanDOMString::npos);
01381 
01382 
01383 
01395 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)
01396 substring(
01397             const XalanDOMString&       theString,
01398             XalanDOMString::size_type   theStartIndex,
01399             XalanDOMString::size_type   theEndIndex = XalanDOMString::npos);
01400 
01401 
01402 
01411 inline XalanDOMChar
01412 toLowerASCII(XalanDOMChar   theChar)
01413 {
01414     if (theChar >= XalanUnicode::charLetter_A && theChar <= XalanUnicode::charLetter_Z)
01415     {
01416         return XalanDOMChar(theChar - (XalanUnicode::charLetter_A - XalanUnicode::charLetter_a));
01417     }
01418     else
01419     {
01420         return theChar;
01421     }
01422 }
01423 
01424 
01425 
01434 inline XalanDOMChar
01435 toUpperASCII(XalanDOMChar   theChar)
01436 {
01437     if (theChar >= XalanUnicode::charLetter_a && theChar <= XalanUnicode::charLetter_z)
01438     {
01439         return XalanDOMChar(theChar + (XalanUnicode::charLetter_A - XalanUnicode::charLetter_a));
01440     }
01441     else
01442     {
01443         return theChar;
01444     }
01445 }
01446 
01447 
01448 
01457 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)
01458 toLowerCaseASCII(const XalanDOMChar*    theString);
01459 
01460 
01461 
01470 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)
01471 toLowerCaseASCII(const XalanDOMString&  theString);
01472 
01473 
01474 
01483 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)
01484 toUpperCaseASCII(const XalanDOMChar*    theString);
01485 
01486 
01487 
01496 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)
01497 toUpperCaseASCII(const XalanDOMString&  theString);
01498 
01499 
01500 
01513 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
01514 compare(
01515             const CharVectorType&   theLHS,
01516             const CharVectorType&   theRHS);
01517 
01518 
01519 
01533 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
01534 compare(
01535             const XalanDOMChar*         theLHS,
01536             XalanDOMString::size_type   theLHSLength,
01537             const XalanDOMChar*         theRHS,
01538             XalanDOMString::size_type   theRHSLength);
01539 
01540 
01541 
01553 inline int
01554 compare(
01555             const XalanDOMChar*     theLHS,
01556             const XalanDOMChar*     theRHS)
01557 {
01558     return compare(theLHS, length(theLHS), theRHS, length(theRHS));
01559 }
01560 
01561 
01562 
01576 inline int
01577 compare(
01578             const XalanDOMString&   theLHS,
01579             const XalanDOMString&   theRHS)
01580 {
01581     return compare(toCharArray(theLHS), length(theLHS), toCharArray(theRHS), length(theRHS));
01582 }
01583 
01584 
01585 
01597 inline int
01598 compare(
01599             const XalanDOMChar*     theLHS,
01600             const XalanDOMString&   theRHS)
01601 {
01602     return compare(theLHS, length(theLHS), toCharArray(theRHS), length(theRHS));
01603 }
01604 
01605 
01606 
01618 inline int
01619 compare(
01620             const XalanDOMString&   theLHS,
01621             const XalanDOMChar*     theRHS)
01622 {
01623     return compare(toCharArray(theLHS), length(theLHS), theRHS, length(theRHS));
01624 }
01625 
01626 
01627 
01643 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
01644 compareIgnoreCaseASCII(
01645             const XalanDOMChar*         theLHS,
01646             XalanDOMString::size_type   theLHSLength,
01647             const XalanDOMChar*         theRHS,
01648             XalanDOMString::size_type   theRHSLength);
01649 
01650 
01651 
01665 inline int
01666 compareIgnoreCaseASCII(
01667             const XalanDOMChar*     theLHS,
01668             const XalanDOMChar*     theRHS)
01669 {
01670     return compareIgnoreCaseASCII(theLHS, length(theLHS), theRHS, length(theRHS));
01671 }
01672 
01673 
01674 
01690 inline int
01691 compareIgnoreCaseASCII(
01692             const XalanDOMString&   theLHS,
01693             const XalanDOMString&   theRHS)
01694 {
01695     return compareIgnoreCaseASCII(toCharArray(theLHS), length(theLHS), toCharArray(theRHS), length(theRHS));
01696 }
01697 
01698 
01699 
01713 inline int
01714 compareIgnoreCaseASCII(
01715             const XalanDOMString&   theLHS,
01716             const XalanDOMChar*     theRHS)
01717 {
01718     return compareIgnoreCaseASCII(toCharArray(theLHS), length(theLHS), theRHS, length(theRHS));
01719 }
01720 
01721 
01722 
01736 inline int
01737 compareIgnoreCaseASCII(
01738             const XalanDOMChar*     theLHS,
01739             const XalanDOMString&   theRHS)
01740 {
01741     return compareIgnoreCaseASCII(theLHS, length(theLHS), toCharArray(theRHS), length(theRHS));
01742 }
01743 
01744 
01745 
01756 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
01757 collationCompare(
01758             const XalanDOMChar*         theLHS,
01759             XalanDOMString::size_type   theLHSLength,
01760             const XalanDOMChar*         theRHS,
01761             XalanDOMString::size_type   theRHSLength);
01762 
01763  
01764  
01775 inline int
01776 collationCompare(
01777             const XalanDOMChar*     theLHS,
01778             const XalanDOMChar*     theRHS)
01779 {
01780     return collationCompare(theLHS, length(theLHS), theRHS, length(theRHS));
01781 }
01782 
01783 
01784 
01795 inline int
01796 collationCompare(
01797             const XalanDOMString&   theLHS,
01798             const XalanDOMString&   theRHS)
01799 {
01800     return collationCompare(toCharArray(theLHS), length(theLHS), toCharArray(theRHS), length(theRHS));
01801 }
01802 
01803 
01804 
01813 inline int
01814 collationCompare(
01815             const XalanDOMChar*     theLHS,
01816             const XalanDOMString&   theRHS)
01817 {
01818     return collationCompare(theLHS, length(theLHS), toCharArray(theRHS), length(theRHS));
01819 }
01820 
01821 
01822 
01831 inline int
01832 collationCompare(
01833             const XalanDOMString&   theLHS,
01834             const XalanDOMChar*     theRHS)
01835 {
01836     return collationCompare(toCharArray(theLHS), length(theLHS), theRHS, length(theRHS));
01837 }
01838 
01839 
01840 
01849 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(bool)
01850 equals(
01851             const XalanDOMChar*         theLHS,
01852             const XalanDOMChar*         theRHS,
01853             XalanDOMString::size_type   theLength);
01854 
01855 
01856 
01866 inline bool
01867 equals(
01868             const XalanDOMChar*         theLHS,
01869             XalanDOMString::size_type   theLHSLength,
01870             const XalanDOMChar*         theRHS,
01871             XalanDOMString::size_type   theRHSLength)
01872 {
01873     return theLHSLength != theRHSLength ? false : equals(theLHS, theRHS, theLHSLength);
01874 }
01875 
01876 
01877 
01885 inline bool
01886 equals(
01887             const XalanDOMChar*     theLHS,
01888             const XalanDOMChar*     theRHS)
01889 {
01890     const XalanDOMString::size_type     theLHSLength = length(theLHS);
01891 
01892     return theLHSLength != length(theRHS) ? false : equals(theLHS, theRHS, theLHSLength);
01893 }
01894 
01895 
01896 
01904 inline bool
01905 equals(
01906             const XalanDOMString&   theLHS,
01907             const XalanDOMString&   theRHS)
01908 {
01909     return theLHS == theRHS;
01910 }
01911 
01912 
01913 
01921 inline bool
01922 equals(
01923             const XalanDOMChar*     theLHS,
01924             const XalanDOMString&   theRHS)
01925 {
01926     assert(theLHS != 0);
01927 
01928     // Swap them...
01929     return theRHS == theLHS;
01930 }
01931 
01932 
01933 
01941 inline bool
01942 equals(const XalanDOMString&    theLHS,
01943        const XalanDOMChar*      theRHS)
01944 {
01945     return equals(theRHS, theLHS);
01946 }
01947 
01948 
01949 
01958 inline bool
01959 equals(
01960             const XalanDOMString&       theLHS,
01961             const XalanDOMChar*         theRHS,
01962             XalanDOMString::size_type   theRHSLength)
01963 {
01964     return theRHSLength != length(theLHS) ? false : equals(c_wstr(theLHS), theRHSLength, theRHS, theRHSLength);
01965 }
01966 
01967 
01968 
01976 inline bool
01977 equals(const XalanDOMString&    theLHS,
01978        const char*              theRHS)
01979 {
01980     assert(theRHS != 0);
01981 
01982     const XalanDOMString::size_type     theRHSLength = length(theRHS);
01983 
01984     if (theRHSLength != length(theLHS))
01985     {
01986         return false;
01987     }
01988     else
01989     {
01990         return theLHS == XalanDOMString(theRHS, theRHSLength);
01991     }
01992 }
01993 
01994 
01995 
02003 inline bool
02004 equals(const char*              theLHS,
02005        const XalanDOMString&    theRHS)
02006 {
02007     return equals(theRHS, theLHS);
02008 }
02009 
02010 
02011 
02019 inline bool
02020 equals(const XalanDOMChar*  theLHS,
02021        const char*          theRHS)
02022 {
02023     assert(theLHS != 0);
02024     assert(theRHS != 0);
02025 
02026     const XalanDOMString::size_type     theRHSLength = length(theRHS);
02027 
02028     if (theRHSLength != length(theLHS))
02029     {
02030         return false;
02031     }
02032     else
02033     {
02034         return equals(XalanDOMString(theRHS, theRHSLength), theLHS);
02035     }
02036 }
02037 
02038 
02039 
02047 inline bool
02048 equals(const char*          theLHS,
02049        const XalanDOMChar*  theRHS)
02050 {
02051     return equals(theRHS, theLHS);
02052 }
02053 
02054 
02055 
02064 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(bool)
02065 equalsIgnoreCaseASCII(
02066             const XalanDOMChar*         theLHS,
02067             const XalanDOMChar*         theRHS,
02068             XalanDOMString::size_type   theLength);
02069 
02070 
02071 
02082 inline bool
02083 equalsIgnoreCaseASCII(
02084             const XalanDOMChar*         theLHS,
02085             XalanDOMString::size_type   theLHSLength,
02086             const XalanDOMChar*         theRHS,
02087             XalanDOMString::size_type   theRHSLength)
02088 {
02089     return theLHSLength != theRHSLength ? false :
02090         equalsIgnoreCaseASCII(theLHS, theRHS, theLHSLength);
02091 }
02092 
02093 
02094 
02103 inline bool
02104 equalsIgnoreCaseASCII(
02105             const XalanDOMChar*     theLHS,
02106             const XalanDOMChar*     theRHS)
02107 {
02108     const XalanDOMString::size_type     theLength = length(theLHS);
02109 
02110     return theLength != length(theRHS) ? false :
02111         equalsIgnoreCaseASCII(theLHS, theRHS, theLength);
02112 }
02113 
02114 
02115 
02124 inline bool
02125 equalsIgnoreCaseASCII(
02126             const XalanDOMString&   theLHS,
02127             const XalanDOMString&   theRHS)
02128 {
02129     const XalanDOMString::size_type     theLength = length(theLHS);
02130 
02131     return theLength != length(theRHS) ? false :
02132         equalsIgnoreCaseASCII(toCharArray(theLHS), toCharArray(theRHS), theLength);
02133 }
02134 
02135 
02136 
02145 inline bool
02146 equalsIgnoreCaseASCII(
02147             const XalanDOMChar*     theLHS,
02148             const XalanDOMString&   theRHS)
02149 {
02150     const XalanDOMString::size_type     theRHSLength = length(theRHS);
02151 
02152     return theRHSLength != length(theLHS) ? false :
02153         equalsIgnoreCaseASCII(theLHS, toCharArray(theRHS), theRHSLength);
02154 }
02155 
02156 
02157 
02166 inline bool
02167 equalsIgnoreCaseASCII(
02168             const XalanDOMString&   theLHS,
02169             const XalanDOMChar*     theRHS)
02170 {
02171     return equalsIgnoreCaseASCII(theRHS, theLHS);
02172 }
02173 
02174 
02175 
02185 inline bool
02186 operator<(
02187             const CharVectorType&   theLHS,
02188             const CharVectorType&   theRHS)
02189 {
02190     return compare(theLHS, theRHS) < 0 ? true : false;
02191 }
02192 
02193 
02194 
02204 inline bool
02205 operator<(
02206             const XalanDOMString&   theLHS,
02207             const XalanDOMString&   theRHS)
02208 {
02209     return compare(theLHS, theRHS) < 0 ? true : false;
02210 }
02211 
02212 
02213 
02222 inline XalanDOMString&
02223 assign(
02224             XalanDOMString&         theString,
02225             const XalanDOMString&   theStringToAssign)
02226 {
02227     theString = theStringToAssign;
02228 
02229     return theString;
02230 }
02231 
02232 
02233 
02242 inline XalanDOMString&
02243 assign(
02244             XalanDOMString&             theString,
02245             const XalanDOMChar*         theStringToAssign,
02246             XalanDOMString::size_type   theStringToAssignLength = XalanDOMString::npos)
02247 {
02248     if (theStringToAssignLength == XalanDOMString::npos)
02249     {
02250         theString.assign(theStringToAssign);
02251     }
02252     else
02253     {
02254         theString.assign(theStringToAssign, theStringToAssignLength);
02255     }
02256 
02257     return theString;
02258 }
02259 
02260 
02261 
02269 inline XalanDOMString&
02270 append(
02271             XalanDOMString&         theString,
02272             const XalanDOMString&   theStringToAppend)
02273 {
02274     theString.append(theStringToAppend);
02275 
02276     return theString;
02277 }
02278 
02279 
02280 
02289 inline XalanDOMString&
02290 append(
02291             XalanDOMString&             theString,
02292             const XalanDOMChar*         theStringToAppend,
02293             XalanDOMString::size_type   theStringToAppendLength = XalanDOMString::npos)
02294 {
02295     assert(theStringToAppend != 0);
02296 
02297     if (theStringToAppendLength == XalanDOMString::npos)
02298     {
02299         theString.append(theStringToAppend);
02300     }
02301     else
02302     {
02303         theString.append(theStringToAppend, theStringToAppendLength);
02304     }
02305 
02306     return theString;
02307 }
02308 
02309 
02310 
02319 inline XalanDOMString&
02320 append(
02321             XalanDOMString&             theString,
02322             const char*                 theStringToAppend,
02323             XalanDOMString::size_type   theStringToAppendLength = XalanDOMString::npos)
02324 {
02325     theString.append(TranscodeFromLocalCodePage(theStringToAppend, theStringToAppendLength));
02326 
02327     return theString;
02328 }
02329 
02330 
02331 
02339 inline XalanDOMString&
02340 append(
02341             XalanDOMString&     theString,
02342             const XalanDOMChar  theCharToAppend)
02343 {
02344     theString.append(1, theCharToAppend);
02345 
02346     return theString;
02347 }
02348 
02349 
02350 
02358 inline XalanDOMString&
02359 append(
02360             XalanDOMString&     theString,
02361             char                theCharToAppend)
02362 {
02363     // We have to transcode before appending...
02364     char    theTempBuffer[] = { theCharToAppend, '\0' };
02365 
02366     return append(theString, theTempBuffer);
02367 }
02368 
02369 
02370 
02379 inline XalanDOMString&
02380 insert(
02381             XalanDOMString&             theString,
02382             XalanDOMString::size_type   thePosition,
02383             const XalanDOMString&       theStringToInsert)
02384 {
02385     theString.insert(thePosition, theStringToInsert);
02386 
02387     return theString;
02388 }
02389 
02390 
02391 
02400 inline XalanDOMString&
02401 insert(
02402             XalanDOMString&             theString,
02403             XalanDOMString::size_type   thePosition,
02404             const XalanDOMChar*         theStringToInsert)
02405 {
02406     theString.insert(thePosition, theStringToInsert);
02407 
02408     return theString;
02409 }
02410 
02411 
02412 
02419 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)
02420 trim(const XalanDOMString&  theString);
02421 
02422 
02423 
02429 inline void
02430 clear(XalanDOMString&   theString)
02431 {
02432     theString.clear();
02433 }
02434 
02435 
02436 
02442 inline void
02443 erase(XalanDOMString&   theString)
02444 {
02445     theString.erase();
02446 }
02447 
02448 
02449 
02456 inline void
02457 releaseMemory(XalanDOMString&   theString)
02458 {
02459     XalanDOMString().swap(theString);
02460 }
02461 
02462 
02463 
02464 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
02465 CopyWideStringToVector(
02466             const XalanDOMChar*     theString,
02467             CharVectorType&         theVector);
02468 
02469 
02470 
02471 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
02472 CopyStringToVector(
02473             const char*         theString,
02474             CharVectorType&     theVector);
02475 
02476 
02477 
02486 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMCharVectorType)
02487 MakeXalanDOMCharVector(
02488             const char*     data,
02489             bool            fTranscode = true);
02490 
02491 
02492 
02500 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMCharVectorType)
02501 MakeXalanDOMCharVector(const XalanDOMChar*  data);
02502 
02503 
02504 
02512 inline XalanDOMCharVectorType
02513 MakeXalanDOMCharVector(const XalanDOMString&    data)
02514 {
02515     return MakeXalanDOMCharVector(c_wstr(data));
02516 }
02517 
02518 
02519 
02520 #if defined(XALAN_NO_STD_NAMESPACE)
02521 struct c_wstr_functor : public unary_function<XalanDOMString, const XalanDOMChar*>
02522 #else
02523 struct c_wstr_functor : public std::unary_function<XalanDOMString, const XalanDOMChar*>
02524 #endif
02525 {
02526     result_type
02527     operator() (const argument_type&    theString) const
02528     {
02529         return c_wstr(theString);
02530     }
02531 };
02532 
02533 
02534 
02541 #if defined(XALAN_NO_STD_NAMESPACE)
02542 struct DOMStringHashFunction : public unary_function<const XalanDOMString&, size_t>
02543 #else
02544 struct DOMStringHashFunction : public std::unary_function<const XalanDOMString&, size_t>
02545 #endif
02546 {
02547     result_type
02548     operator() (argument_type   theKey) const
02549     {
02550         const XalanDOMChar*     theRawBuffer = c_wstr(theKey);
02551 
02552         result_type     theHashValue = 0; 
02553 
02554         if (theRawBuffer != 0)
02555         {
02556             while (*theRawBuffer)
02557             {
02558                 theHashValue = 5 * theHashValue + *theRawBuffer;
02559 
02560                 theRawBuffer++;
02561             }
02562         }
02563 
02564         return theHashValue++;
02565     }
02566 };
02567 
02568 
02569 
02577 #if defined(XALAN_NO_STD_NAMESPACE)
02578 struct DOMStringEqualsFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
02579 #else
02580 struct DOMStringEqualsFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
02581 #endif
02582 {
02583     result_type
02584     operator() (first_argument_type     theLHS,
02585                 second_argument_type    theRHS) const
02586     {
02587         return equals(theLHS, theRHS);
02588     }
02589 };
02590 
02591 
02592 
02600 #if defined(XALAN_NO_STD_NAMESPACE)
02601 struct DOMStringNotEqualsFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
02602 #else
02603 struct DOMStringNotEqualsFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
02604 #endif
02605 {
02606     result_type
02607     operator() (first_argument_type     theLHS,
02608                 second_argument_type    theRHS) const
02609     {
02610         return !equals(theLHS, theRHS);
02611     }
02612 };
02613 
02614 
02615 
02623 #if defined(XALAN_NO_STD_NAMESPACE)
02624 struct DOMStringLessThanFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
02625 #else
02626 struct DOMStringLessThanFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
02627 #endif
02628 {
02629     result_type
02630     operator() (first_argument_type     theLHS,
02631                 second_argument_type    theRHS) const
02632     {
02633         return compare(theLHS, theRHS) < 0 ? true : false;
02634     }
02635 };
02636 
02637 
02638 
02646 #if defined(XALAN_NO_STD_NAMESPACE)
02647 struct DOMStringPointerLessThanFunction : public binary_function<const XalanDOMString*, const XalanDOMString*, bool>
02648 #else
02649 struct DOMStringPointerLessThanFunction : public std::binary_function<const XalanDOMString*, const XalanDOMString*, bool>
02650 #endif
02651 {
02652     result_type
02653     operator() (first_argument_type     theLHS,
02654                 second_argument_type    theRHS) const
02655     {
02656         assert(theLHS != 0 && theRHS != 0);
02657 
02658         return compare(*theLHS, *theRHS) < 0 ? true : false;
02659     }
02660 };
02661 
02662 
02663 
02671 #if defined(XALAN_NO_STD_NAMESPACE)
02672 struct DOMStringLessThanIgnoreCaseASCIIFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
02673 #else
02674 struct DOMStringLessThanIgnoreCaseASCIIFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
02675 #endif
02676 {
02677     result_type
02678     operator() (first_argument_type     theLHS,
02679                 second_argument_type    theRHS) const
02680     {
02681         return compareIgnoreCaseASCII(theLHS, theRHS) < 0 ? true : false;
02682     }
02683 };
02684 
02685 
02686 
02694 #if defined(XALAN_NO_STD_NAMESPACE)
02695 struct DOMStringLessThanOrEqualFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
02696 #else
02697 struct DOMStringLessThanOrEqualFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
02698 #endif
02699 {
02700     result_type
02701     operator() (first_argument_type     theLHS,
02702                 second_argument_type    theRHS) const
02703     {
02704         return compare(theLHS, theRHS) <= 0 ? true : false;
02705     }
02706 };
02707 
02708 
02709 
02717 #if defined(XALAN_NO_STD_NAMESPACE)
02718 struct DOMStringGreaterThanFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
02719 #else
02720 struct DOMStringGreaterThanFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
02721 #endif
02722 {
02723     result_type
02724     operator() (first_argument_type     theLHS,
02725                 second_argument_type    theRHS) const
02726     {
02727         return compare(theLHS, theRHS) > 0 ? true : false;
02728     }
02729 };
02730 
02731 
02732 
02740 #if defined(XALAN_NO_STD_NAMESPACE)
02741 struct DOMStringGreaterThanOrEqualFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
02742 #else
02743 struct DOMStringGreaterThanOrEqualFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
02744 #endif
02745 {
02746     result_type
02747     operator() (first_argument_type     theLHS,
02748                 second_argument_type    theRHS) const
02749     {
02750         return compare(theLHS, theRHS) >= 0 ? true : false;
02751     }
02752 };
02753 
02754 
02755 
02761 #if defined(XALAN_NO_STD_NAMESPACE)
02762 struct less_no_case_ascii_wide_string : public binary_function<const XalanDOMChar*, const XalanDOMChar*, bool>
02763 #else
02764 struct less_no_case_ascii_wide_string : public std::binary_function<const XalanDOMChar*, const XalanDOMChar*, bool>
02765 #endif
02766 {
02775     result_type
02776     operator()(
02777             first_argument_type     theLHS,
02778             second_argument_type    theRHS) const
02779     {
02780         return compareIgnoreCaseASCII(theLHS, theRHS) < 0 ? true : false;
02781     }
02782 };
02783 
02784 
02785 
02792 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(bool)
02793 isXMLWhitespace(const XalanDOMString&   string);
02794 
02795 
02796 
02805 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(bool)
02806 isXMLWhitespace(
02807             const XalanDOMChar          ch[],
02808             XalanDOMString::size_type   start,
02809             XalanDOMString::size_type   length);
02810 
02811 
02812 
02819 inline bool
02820 isXMLWhitespace(const XalanDOMChar*     theString)
02821 {
02822     assert(theString != 0);
02823 
02824     return isXMLWhitespace(theString, 0, length(theString));
02825 }
02826 
02827 
02828 
02829 XALAN_CPP_NAMESPACE_END
02830 
02831 
02832 
02833 #endif  // DOMSTRINGHELPER_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.5
Copyright © 2000, 2001, 2002, 2003 The Apache Software Foundation. All Rights Reserved.