## Xalan-C++ API Documentation

### The Xalan C++ XSLT Processor Version 1.6

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 <xalanc/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 <xalanc/XalanDOM/XalanDOMString.hpp>
    00080
    00081
    00082
    00083 #include <xalanc/PlatformSupport/FormatterListener.hpp>
    00084 #include <xalanc/PlatformSupport/XalanUnicode.hpp>
    00085 #include <xalanc/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
    00488 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString::size_type)
    00489 indexOf(
    00490             const XalanDOMChar*         theString,
    00491             XalanDOMString::size_type   theStringLength,
    00492             const XalanDOMChar*         theSubstring,
    00493             XalanDOMString::size_type   theSubstringLength);
    00494
    00495
    00496
    00506 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString::size_type)
    00507 indexOf(
    00508             const XalanDOMChar*     theString,
    00509             const XalanDOMChar*     theSubstring);
    00510
    00511
    00512
    00522 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString::size_type)
    00523 indexOf(
    00524             const XalanDOMString&   theString,
    00525             const XalanDOMString&   theSubstring);
    00526
    00527
    00528
    00538
    00539 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString::size_type)
    00540 lastIndexOf(
    00541             const XalanDOMChar*     theString,
    00542             XalanDOMChar            theChar);
    00543
    00544
    00545
    00555 inline XalanDOMString::size_type
    00556 lastIndexOf(
    00557             const XalanDOMString&   theString,
    00558             XalanDOMChar            theChar)
    00559 {
    00560     return lastIndexOf(c_wstr(theString), theChar);
    00561 }
    00562
    00563
    00564
    00574 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(bool)
    00575 startsWith(
    00576             const XalanDOMChar*         theString,
    00577             XalanDOMString::size_type   theStringLength,
    00578             const XalanDOMChar*         theSubstring,
    00579             XalanDOMString::size_type   theSubstringLength);
    00580
    00581
    00582
    00590 inline bool
    00591 startsWith(
    00592             const XalanDOMChar*     theString,
    00593             const XalanDOMChar*     theSubstring)
    00594 {
    00595     assert(theString != 0 && theSubstring != 0);
    00596
    00597     return startsWith(theString, length(theString), theSubstring, length(theSubstring));
    00598 }
    00599
    00600
    00601
    00609 inline bool
    00610 startsWith(
    00611             const XalanDOMChar*     theString,
    00612             const XalanDOMString&   theSubstring)
    00613 {
    00614     assert(theString != 0);
    00615
    00616     return startsWith(theString, length(theString), c_wstr(theSubstring), length(theSubstring));
    00617 }
    00618
    00619
    00620
    00628 inline bool
    00629 startsWith(
    00630             const XalanDOMString&   theString,
    00631             const XalanDOMChar*     theSubstring)
    00632 {
    00633     assert(theSubstring != 0);
    00634
    00635     return startsWith(c_wstr(theString), length(theString), theSubstring, length(theSubstring));
    00636 }
    00637
    00638
    00639
    00648 inline bool
    00649 startsWith(
    00650             const XalanDOMString&       theString,
    00651             const XalanDOMChar*         theSubstring,
    00652             XalanDOMString::size_type   theSubstringLength)
    00653 {
    00654     assert(theSubstring != 0);
    00655
    00656     return startsWith(c_wstr(theString), length(theString), theSubstring, theSubstringLength);
    00657 }
    00658
    00659
    00660
    00668 inline bool
    00669 startsWith(
    00670             const XalanDOMString&   theString,
    00671             const XalanDOMString&   theSubstring)
    00672 {
    00673     return startsWith(c_wstr(theString), length(theString), c_wstr(theSubstring), length(theSubstring));
    00674 }
    00675
    00676
    00677
    00685 inline bool
    00686 startsWith(
    00687             const XalanDOMString&   theString,
    00688             const char*             theSubstring)
    00689 {
    00690     return startsWith(
    00691             theString,
    00692             XalanDOMString(theSubstring));
    00693 }
    00694
    00695
    00696
    00704 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(bool)
    00705 endsWith(
    00706             const XalanDOMChar*         theString,
    00707             XalanDOMString::size_type   theStringLength,
    00708             const XalanDOMChar*         theSubstring,
    00709             XalanDOMString::size_type   theSubstringLength);
    00710
    00711
    00712
    00720 inline bool
    00721 endsWith(
    00722             const XalanDOMChar*     theString,
    00723             const XalanDOMChar*     theSubstring)
    00724 {
    00725     assert(theString != 0 && theSubstring != 0);
    00726
    00727     return endsWith(theString, length(theString), theSubstring, length(theSubstring));
    00728 }
    00729
    00730
    00731
    00739 inline bool
    00740 endsWith(
    00741             const XalanDOMString&   theString,
    00742             const XalanDOMString&   theSubstring)
    00743 {
    00744     return endsWith(c_wstr(theString), length(theString), c_wstr(theSubstring), length(theSubstring));
    00745 }
    00746
    00747
    00748
    00756 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
    00757 PointerToDOMString(
    00758             const void*         theValue,
    00759             XalanDOMString&     theResult);
    00760
    00761
    00762
    00769 inline const XalanDOMString
    00770 PointerToDOMString(const void*  theValue)
    00771 {
    00772     XalanDOMString  theResult;
    00773
    00774     PointerToDOMString(theValue, theResult);
    00775
    00776     return theResult;
    00777 }
    00778
    00779
    00780
    00788 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
    00789 DoubleToDOMString(
    00790             double              theValue,
    00791             XalanDOMString&     theResult);
    00792
    00793
    00794
    00801 inline const XalanDOMString
    00802 DoubleToDOMString(double    theValue)
    00803 {
    00804     XalanDOMString  theResult;
    00805
    00806     DoubleToDOMString(theValue, theResult);
    00807
    00808     return theResult;
    00809 }
    00810
    00811
    00812
    00813 class XALAN_PLATFORMSUPPORT_EXPORT DOMStringHelper
    00814 {
    00815 public:
    00816
    00817     typedef void (FormatterListener::*MemberFunctionPtr)(const XMLCh* const, const unsigned int);
    00818
    00819     static void
    00820     DoubleToCharacters(
    00821             double              theDouble,
    00822             FormatterListener&  formatterListener,
    00823             MemberFunctionPtr   function);
    00824
    00825     static void
    00826     LongToCharacters(
    00827             long                theLong,
    00828             FormatterListener&  formatterListener,
    00829             MemberFunctionPtr   function);
    00830 };
    00831
    00832
    00833
    00842 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
    00843 LongToHexDOMString(
    00844             long                theValue,
    00845             XalanDOMString&     theResult);
    00846
    00847
    00848
    00856 inline const XalanDOMString
    00857 LongToHexDOMString(long     theValue)
    00858 {
    00859     XalanDOMString  theResult;
    00860
    00861     LongToHexDOMString(theValue, theResult);
    00862
    00863     return theResult;
    00864 }
    00865
    00866
    00867
    00876 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
    00877 UnsignedLongToHexDOMString(
    00878             unsigned long       theValue,
    00879             XalanDOMString&     theResult);
    00880
    00881
    00882
    00890 inline const XalanDOMString
    00891 UnsignedLongToHexDOMString(unsigned long    theValue)
    00892 {
    00893     XalanDOMString  theResult;
    00894
    00895     UnsignedLongToHexDOMString(theValue, theResult);
    00896
    00897     return theResult;
    00898 }
    00899
    00900
    00901
    00909 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
    00910 LongToDOMString(
    00911             long                theValue,
    00912             XalanDOMString&     theResult);
    00913
    00914
    00915
    00922 inline const XalanDOMString
    00923 LongToDOMString(long    theValue)
    00924 {
    00925     XalanDOMString  theResult;
    00926
    00927     LongToDOMString(theValue, theResult);
    00928
    00929     return theResult;
    00930 }
    00931
    00932
    00933
    00942 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
    00943 UnsignedLongToDOMString(
    00944             unsigned long       theValue,
    00945             XalanDOMString&     theResult);
    00946
    00947
    00948
    00955 inline const XalanDOMString
    00956 UnsignedLongToDOMString(unsigned long   theValue)
    00957 {
    00958     XalanDOMString  theResult;
    00959
    00960     UnsignedLongToDOMString(theValue, theResult);
    00961
    00962     return theResult;
    00963 }
    00964
    00965
    00966
    00973 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
    00974 WideStringToInt(const XalanDOMChar*     theString);
    00975
    00976
    00977
    00984 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(long)
    00985 WideStringToLong(const XalanDOMChar*    theString);
    00986
    00987
    00988
    00995 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(unsigned long)
    00996 WideStringToUnsignedLong(const XalanDOMChar*    theString);
    00997
    00998
    00999
    01006 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(double)
    01007 WideStringToDouble(const XalanDOMChar*  theString);
    01008
    01009
    01010
    01017 inline int
    01018 DOMStringToInt(const XalanDOMString&    theString)
    01019 {
    01020     return WideStringToInt(c_wstr(theString));
    01021 }
    01022
    01023
    01024
    01031 inline long
    01032 DOMStringToLong(const XalanDOMString&   theString)
    01033 {
    01034     return WideStringToLong(c_wstr(theString));
    01035 }
    01036
    01037
    01038
    01045 inline unsigned long
    01046 DOMStringToUnsignedLong(const XalanDOMString&   theString)
    01047 {
    01048     return WideStringToUnsignedLong(c_wstr(theString));
    01049 }
    01050
    01051
    01052
    01059 inline double
    01060 DOMStringToDouble(const XalanDOMString&     theString)
    01061 {
    01062     return WideStringToDouble(c_wstr(theString));
    01063 }
    01064
    01065
    01066
    01074 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
    01075 OutputString(
    01076             XalanOutputStream&      theStream,
    01077             const CharVectorType&   theString);
    01078
    01079
    01080
    01088 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
    01089 OutputString(
    01090 #if defined(XALAN_NO_STD_NAMESPACE)
    01091             ostream&                theStream,
    01092 #else
    01093             std::ostream&           theStream,
    01094 #endif
    01095             const CharVectorType&   theString);
    01096
    01097
    01098
    01106 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
    01107 OutputString(
    01108             XalanOutputStream&      theStream,
    01109             const XalanDOMChar*     theString);
    01110
    01111
    01112
    01120 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
    01121 OutputString(
    01122 #if defined(XALAN_NO_STD_NAMESPACE)
    01123             ostream&                theStream,
    01124 #else
    01125             std::ostream&           theStream,
    01126 #endif
    01127             const XalanDOMChar*     theString);
    01128
    01129
    01130
    01138 inline void
    01139 OutputString(
    01140             XalanOutputStream&      theStream,
    01141             const XalanDOMString&   theString)
    01142 {
    01143     if (isEmpty(theString) == false)
    01144     {
    01145         OutputString(theStream, c_wstr(theString));
    01146     }
    01147 }
    01148
    01149
    01150
    01158 inline void
    01159 OutputString(
    01160 #if defined(XALAN_NO_STD_NAMESPACE)
    01161             ostream&                theStream,
    01162 #else
    01163             std::ostream&           theStream,
    01164 #endif
    01165             const XalanDOMString&   theString)
    01166 {
    01167     OutputString(theStream, c_wstr(theString));
    01168 }
    01169
    01170
    01171
    01179 inline XalanOutputStream&
    01180 operator<<(
    01181             XalanOutputStream&      theStream,
    01182             const CharVectorType&   theString)
    01183 {
    01184     OutputString(theStream, theString);
    01185
    01186     return theStream;
    01187 }
    01188
    01189
    01190
    01198 #if defined(XALAN_NO_STD_NAMESPACE)
    01199 inline ostream&
    01200 operator<<(
    01201             ostream&                theStream,
    01202 #else
    01203 inline std::ostream&
    01204 operator<<(
    01205             std::ostream&           theStream,
    01206 #endif
    01207             const CharVectorType&   theString)
    01208 {
    01209     OutputString(theStream, theString);
    01210
    01211     return theStream;
    01212 }
    01213
    01214
    01215
    01223 inline XalanOutputStream&
    01224 operator<<(
    01225             XalanOutputStream&      theStream,
    01226             const XalanDOMChar*     theString)
    01227 {
    01228     OutputString(theStream,
    01229                  theString);
    01230
    01231     return theStream;
    01232 }
    01233
    01234
    01235
    01243 #if defined(XALAN_NO_STD_NAMESPACE)
    01244 inline ostream&
    01245 operator<<(
    01246             ostream&                theStream,
    01247 #else
    01248 inline std::ostream&
    01249 operator<<(
    01250             std::ostream&           theStream,
    01251 #endif
    01252             const XalanDOMChar*     theString)
    01253 {
    01254     OutputString(theStream,
    01255                  theString);
    01256
    01257     return theStream;
    01258 }
    01259
    01260
    01261
    01269 inline XalanOutputStream&
    01270 operator<<(
    01271             XalanOutputStream&      theStream,
    01272             const XalanDOMString&   theString)
    01273 {
    01274     OutputString(theStream,
    01275                  theString);
    01276
    01277     return theStream;
    01278 }
    01279
    01280
    01281
    01289 #if defined(XALAN_NO_STD_NAMESPACE)
    01290 inline ostream&
    01291 operator<<(
    01292             ostream&                theStream,
    01293 #else
    01294 inline std::ostream&
    01295 operator<<(
    01296             std::ostream&           theStream,
    01297 #endif
    01298             const XalanDOMString&   theString)
    01299 {
    01300     OutputString(theStream,
    01301                  theString);
    01302
    01303     return theStream;
    01304 }
    01305
    01306
    01307
    01315 inline XalanDOMChar
    01316 charAt(
    01317             const XalanDOMString&       theString,
    01318             XalanDOMString::size_type   theIndex)
    01319 {
    01320     return theString[theIndex];
    01321 }
    01322
    01323
    01324
    01331 inline bool
    01332 isXMLWhitespace(XalanDOMChar    theChar)
    01333 {
    01334     return XalanXMLChar::isWhitespace(theChar);
    01335 }
    01336
    01337
    01338
    01345 inline bool
    01346 isXMLDigit(XalanDOMChar     theChar)
    01347 {
    01348     return XalanXMLChar::isDigit(theChar);
    01349 }
    01350
    01351
    01352
    01359 inline bool
    01360 isXMLLetterOrDigit(XalanDOMChar     theChar)
    01361 {
    01362     return  XalanXMLChar::isDigit(theChar) ||
    01363             XalanXMLChar::isLetter(theChar);
    01364 }
    01365
    01366
    01367
    01379 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)
    01380 substring(
    01381             const XalanDOMChar*         theString,
    01382             XalanDOMString::size_type   theStartIndex,
    01383             XalanDOMString::size_type   theEndIndex = XalanDOMString::npos);
    01384
    01385
    01386
    01399 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
    01400 substring(
    01401             const XalanDOMChar*         theString,
    01402             XalanDOMString&             theSubstring,
    01403             XalanDOMString::size_type   theStartIndex,
    01404             XalanDOMString::size_type   theEndIndex = XalanDOMString::npos);
    01405
    01406
    01407
    01419 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
    01420 substring(
    01421             const XalanDOMString&       theString,
    01422             XalanDOMString&             theSubstring,
    01423             XalanDOMString::size_type   theStartIndex,
    01424             XalanDOMString::size_type   theEndIndex = XalanDOMString::npos);
    01425
    01426
    01427
    01439 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)
    01440 substring(
    01441             const XalanDOMString&       theString,
    01442             XalanDOMString::size_type   theStartIndex,
    01443             XalanDOMString::size_type   theEndIndex = XalanDOMString::npos);
    01444
    01445
    01446
    01455 inline XalanDOMChar
    01456 toLowerASCII(XalanDOMChar   theChar)
    01457 {
    01458     if (theChar >= XalanUnicode::charLetter_A && theChar <= XalanUnicode::charLetter_Z)
    01459     {
    01460         return XalanDOMChar(theChar - (XalanUnicode::charLetter_A - XalanUnicode::charLetter_a));
    01461     }
    01462     else
    01463     {
    01464         return theChar;
    01465     }
    01466 }
    01467
    01468
    01469
    01478 inline XalanDOMChar
    01479 toUpperASCII(XalanDOMChar   theChar)
    01480 {
    01481     if (theChar >= XalanUnicode::charLetter_a && theChar <= XalanUnicode::charLetter_z)
    01482     {
    01483         return XalanDOMChar(theChar + (XalanUnicode::charLetter_A - XalanUnicode::charLetter_a));
    01484     }
    01485     else
    01486     {
    01487         return theChar;
    01488     }
    01489 }
    01490
    01491
    01492
    01501 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)
    01502 toLowerCaseASCII(const XalanDOMChar*    theString);
    01503
    01504
    01505
    01514 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)
    01515 toLowerCaseASCII(const XalanDOMString&  theString);
    01516
    01517
    01518
    01527 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)
    01528 toUpperCaseASCII(const XalanDOMChar*    theString);
    01529
    01530
    01531
    01540 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)
    01541 toUpperCaseASCII(const XalanDOMString&  theString);
    01542
    01543
    01544
    01557 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
    01558 compare(
    01559             const CharVectorType&   theLHS,
    01560             const CharVectorType&   theRHS);
    01561
    01562
    01563
    01577 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
    01578 compare(
    01579             const XalanDOMChar*         theLHS,
    01580             XalanDOMString::size_type   theLHSLength,
    01581             const XalanDOMChar*         theRHS,
    01582             XalanDOMString::size_type   theRHSLength);
    01583
    01584
    01585
    01597 inline int
    01598 compare(
    01599             const XalanDOMChar*     theLHS,
    01600             const XalanDOMChar*     theRHS)
    01601 {
    01602     return compare(theLHS, length(theLHS), theRHS, length(theRHS));
    01603 }
    01604
    01605
    01606
    01620 inline int
    01621 compare(
    01622             const XalanDOMString&   theLHS,
    01623             const XalanDOMString&   theRHS)
    01624 {
    01625     return compare(toCharArray(theLHS), length(theLHS), toCharArray(theRHS), length(theRHS));
    01626 }
    01627
    01628
    01629
    01641 inline int
    01642 compare(
    01643             const XalanDOMChar*     theLHS,
    01644             const XalanDOMString&   theRHS)
    01645 {
    01646     return compare(theLHS, length(theLHS), toCharArray(theRHS), length(theRHS));
    01647 }
    01648
    01649
    01650
    01662 inline int
    01663 compare(
    01664             const XalanDOMString&   theLHS,
    01665             const XalanDOMChar*     theRHS)
    01666 {
    01667     return compare(toCharArray(theLHS), length(theLHS), theRHS, length(theRHS));
    01668 }
    01669
    01670
    01671
    01687 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
    01688 compareIgnoreCaseASCII(
    01689             const XalanDOMChar*         theLHS,
    01690             XalanDOMString::size_type   theLHSLength,
    01691             const XalanDOMChar*         theRHS,
    01692             XalanDOMString::size_type   theRHSLength);
    01693
    01694
    01695
    01709 inline int
    01710 compareIgnoreCaseASCII(
    01711             const XalanDOMChar*     theLHS,
    01712             const XalanDOMChar*     theRHS)
    01713 {
    01714     return compareIgnoreCaseASCII(theLHS, length(theLHS), theRHS, length(theRHS));
    01715 }
    01716
    01717
    01718
    01734 inline int
    01735 compareIgnoreCaseASCII(
    01736             const XalanDOMString&   theLHS,
    01737             const XalanDOMString&   theRHS)
    01738 {
    01739     return compareIgnoreCaseASCII(toCharArray(theLHS), length(theLHS), toCharArray(theRHS), length(theRHS));
    01740 }
    01741
    01742
    01743
    01757 inline int
    01758 compareIgnoreCaseASCII(
    01759             const XalanDOMString&   theLHS,
    01760             const XalanDOMChar*     theRHS)
    01761 {
    01762     return compareIgnoreCaseASCII(toCharArray(theLHS), length(theLHS), theRHS, length(theRHS));
    01763 }
    01764
    01765
    01766
    01780 inline int
    01781 compareIgnoreCaseASCII(
    01782             const XalanDOMChar*     theLHS,
    01783             const XalanDOMString&   theRHS)
    01784 {
    01785     return compareIgnoreCaseASCII(theLHS, length(theLHS), toCharArray(theRHS), length(theRHS));
    01786 }
    01787
    01788
    01789
    01800 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
    01801 collationCompare(
    01802             const XalanDOMChar*         theLHS,
    01803             XalanDOMString::size_type   theLHSLength,
    01804             const XalanDOMChar*         theRHS,
    01805             XalanDOMString::size_type   theRHSLength);
    01806
    01807
    01808
    01819 inline int
    01820 collationCompare(
    01821             const XalanDOMChar*     theLHS,
    01822             const XalanDOMChar*     theRHS)
    01823 {
    01824     return collationCompare(theLHS, length(theLHS), theRHS, length(theRHS));
    01825 }
    01826
    01827
    01828
    01839 inline int
    01840 collationCompare(
    01841             const XalanDOMString&   theLHS,
    01842             const XalanDOMString&   theRHS)
    01843 {
    01844     return collationCompare(toCharArray(theLHS), length(theLHS), toCharArray(theRHS), length(theRHS));
    01845 }
    01846
    01847
    01848
    01857 inline int
    01858 collationCompare(
    01859             const XalanDOMChar*     theLHS,
    01860             const XalanDOMString&   theRHS)
    01861 {
    01862     return collationCompare(theLHS, length(theLHS), toCharArray(theRHS), length(theRHS));
    01863 }
    01864
    01865
    01866
    01875 inline int
    01876 collationCompare(
    01877             const XalanDOMString&   theLHS,
    01878             const XalanDOMChar*     theRHS)
    01879 {
    01880     return collationCompare(toCharArray(theLHS), length(theLHS), theRHS, length(theRHS));
    01881 }
    01882
    01883
    01884
    01893 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(bool)
    01894 equals(
    01895             const XalanDOMChar*         theLHS,
    01896             const XalanDOMChar*         theRHS,
    01897             XalanDOMString::size_type   theLength);
    01898
    01899
    01900
    01910 inline bool
    01911 equals(
    01912             const XalanDOMChar*         theLHS,
    01913             XalanDOMString::size_type   theLHSLength,
    01914             const XalanDOMChar*         theRHS,
    01915             XalanDOMString::size_type   theRHSLength)
    01916 {
    01917     return theLHSLength != theRHSLength ? false : equals(theLHS, theRHS, theLHSLength);
    01918 }
    01919
    01920
    01921
    01929 inline bool
    01930 equals(
    01931             const XalanDOMChar*     theLHS,
    01932             const XalanDOMChar*     theRHS)
    01933 {
    01934     const XalanDOMString::size_type     theLHSLength = length(theLHS);
    01935
    01936     return theLHSLength != length(theRHS) ? false : equals(theLHS, theRHS, theLHSLength);
    01937 }
    01938
    01939
    01940
    01948 inline bool
    01949 equals(
    01950             const XalanDOMString&   theLHS,
    01951             const XalanDOMString&   theRHS)
    01952 {
    01953     return theLHS == theRHS;
    01954 }
    01955
    01956
    01957
    01965 inline bool
    01966 equals(
    01967             const XalanDOMChar*     theLHS,
    01968             const XalanDOMString&   theRHS)
    01969 {
    01970     assert(theLHS != 0);
    01971
    01972     // Swap them...
    01973     return theRHS == theLHS;
    01974 }
    01975
    01976
    01977
    01985 inline bool
    01986 equals(const XalanDOMString&    theLHS,
    01987        const XalanDOMChar*      theRHS)
    01988 {
    01989     return equals(theRHS, theLHS);
    01990 }
    01991
    01992
    01993
    02002 inline bool
    02003 equals(
    02004             const XalanDOMString&       theLHS,
    02005             const XalanDOMChar*         theRHS,
    02006             XalanDOMString::size_type   theRHSLength)
    02007 {
    02008     return theRHSLength != length(theLHS) ? false : equals(c_wstr(theLHS), theRHSLength, theRHS, theRHSLength);
    02009 }
    02010
    02011
    02012
    02020 inline bool
    02021 equals(const XalanDOMString&    theLHS,
    02022        const char*              theRHS)
    02023 {
    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 theLHS == XalanDOMString(theRHS, theRHSLength);
    02035     }
    02036 }
    02037
    02038
    02039
    02047 inline bool
    02048 equals(const char*              theLHS,
    02049        const XalanDOMString&    theRHS)
    02050 {
    02051     return equals(theRHS, theLHS);
    02052 }
    02053
    02054
    02055
    02063 inline bool
    02064 equals(const XalanDOMChar*  theLHS,
    02065        const char*          theRHS)
    02066 {
    02067     assert(theLHS != 0);
    02068     assert(theRHS != 0);
    02069
    02070     const XalanDOMString::size_type     theRHSLength = length(theRHS);
    02071
    02072     if (theRHSLength != length(theLHS))
    02073     {
    02074         return false;
    02075     }
    02076     else
    02077     {
    02078         return equals(XalanDOMString(theRHS, theRHSLength), theLHS);
    02079     }
    02080 }
    02081
    02082
    02083
    02091 inline bool
    02092 equals(const char*          theLHS,
    02093        const XalanDOMChar*  theRHS)
    02094 {
    02095     return equals(theRHS, theLHS);
    02096 }
    02097
    02098
    02099
    02108 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(bool)
    02109 equalsIgnoreCaseASCII(
    02110             const XalanDOMChar*         theLHS,
    02111             const XalanDOMChar*         theRHS,
    02112             XalanDOMString::size_type   theLength);
    02113
    02114
    02115
    02126 inline bool
    02127 equalsIgnoreCaseASCII(
    02128             const XalanDOMChar*         theLHS,
    02129             XalanDOMString::size_type   theLHSLength,
    02130             const XalanDOMChar*         theRHS,
    02131             XalanDOMString::size_type   theRHSLength)
    02132 {
    02133     return theLHSLength != theRHSLength ? false :
    02134         equalsIgnoreCaseASCII(theLHS, theRHS, theLHSLength);
    02135 }
    02136
    02137
    02138
    02147 inline bool
    02148 equalsIgnoreCaseASCII(
    02149             const XalanDOMChar*     theLHS,
    02150             const XalanDOMChar*     theRHS)
    02151 {
    02152     const XalanDOMString::size_type     theLength = length(theLHS);
    02153
    02154     return theLength != length(theRHS) ? false :
    02155         equalsIgnoreCaseASCII(theLHS, theRHS, theLength);
    02156 }
    02157
    02158
    02159
    02168 inline bool
    02169 equalsIgnoreCaseASCII(
    02170             const XalanDOMString&   theLHS,
    02171             const XalanDOMString&   theRHS)
    02172 {
    02173     const XalanDOMString::size_type     theLength = length(theLHS);
    02174
    02175     return theLength != length(theRHS) ? false :
    02176         equalsIgnoreCaseASCII(toCharArray(theLHS), toCharArray(theRHS), theLength);
    02177 }
    02178
    02179
    02180
    02189 inline bool
    02190 equalsIgnoreCaseASCII(
    02191             const XalanDOMChar*     theLHS,
    02192             const XalanDOMString&   theRHS)
    02193 {
    02194     const XalanDOMString::size_type     theRHSLength = length(theRHS);
    02195
    02196     return theRHSLength != length(theLHS) ? false :
    02197         equalsIgnoreCaseASCII(theLHS, toCharArray(theRHS), theRHSLength);
    02198 }
    02199
    02200
    02201
    02210 inline bool
    02211 equalsIgnoreCaseASCII(
    02212             const XalanDOMString&   theLHS,
    02213             const XalanDOMChar*     theRHS)
    02214 {
    02215     return equalsIgnoreCaseASCII(theRHS, theLHS);
    02216 }
    02217
    02218
    02219
    02229 inline bool
    02230 operator<(
    02231             const CharVectorType&   theLHS,
    02232             const CharVectorType&   theRHS)
    02233 {
    02234     return compare(theLHS, theRHS) < 0 ? true : false;
    02235 }
    02236
    02237
    02238
    02248 inline bool
    02249 operator<(
    02250             const XalanDOMString&   theLHS,
    02251             const XalanDOMString&   theRHS)
    02252 {
    02253     return compare(theLHS, theRHS) < 0 ? true : false;
    02254 }
    02255
    02256
    02257
    02266 inline XalanDOMString&
    02267 assign(
    02268             XalanDOMString&         theString,
    02269             const XalanDOMString&   theStringToAssign)
    02270 {
    02271     theString = theStringToAssign;
    02272
    02273     return theString;
    02274 }
    02275
    02276
    02277
    02286 inline XalanDOMString&
    02287 assign(
    02288             XalanDOMString&             theString,
    02289             const XalanDOMChar*         theStringToAssign,
    02290             XalanDOMString::size_type   theStringToAssignLength = XalanDOMString::npos)
    02291 {
    02292     if (theStringToAssignLength == XalanDOMString::npos)
    02293     {
    02294         theString.assign(theStringToAssign);
    02295     }
    02296     else
    02297     {
    02298         theString.assign(theStringToAssign, theStringToAssignLength);
    02299     }
    02300
    02301     return theString;
    02302 }
    02303
    02304
    02305
    02313 inline XalanDOMString&
    02314 append(
    02315             XalanDOMString&         theString,
    02316             const XalanDOMString&   theStringToAppend)
    02317 {
    02318     theString.append(theStringToAppend);
    02319
    02320     return theString;
    02321 }
    02322
    02323
    02324
    02333 inline XalanDOMString&
    02334 append(
    02335             XalanDOMString&             theString,
    02336             const XalanDOMChar*         theStringToAppend,
    02337             XalanDOMString::size_type   theStringToAppendLength = XalanDOMString::npos)
    02338 {
    02339     assert(theStringToAppend != 0);
    02340
    02341     if (theStringToAppendLength == XalanDOMString::npos)
    02342     {
    02343         theString.append(theStringToAppend);
    02344     }
    02345     else
    02346     {
    02347         theString.append(theStringToAppend, theStringToAppendLength);
    02348     }
    02349
    02350     return theString;
    02351 }
    02352
    02353
    02354
    02363 inline XalanDOMString&
    02364 append(
    02365             XalanDOMString&             theString,
    02366             const char*                 theStringToAppend,
    02367             XalanDOMString::size_type   theStringToAppendLength = XalanDOMString::npos)
    02368 {
    02369     theString.append(TranscodeFromLocalCodePage(theStringToAppend, theStringToAppendLength));
    02370
    02371     return theString;
    02372 }
    02373
    02374
    02375
    02383 inline XalanDOMString&
    02384 append(
    02385             XalanDOMString&     theString,
    02386             const XalanDOMChar  theCharToAppend)
    02387 {
    02388     theString.append(1, theCharToAppend);
    02389
    02390     return theString;
    02391 }
    02392
    02393
    02394
    02402 inline XalanDOMString&
    02403 append(
    02404             XalanDOMString&     theString,
    02405             char                theCharToAppend)
    02406 {
    02407     // We have to transcode before appending...
    02408     char    theTempBuffer[] = { theCharToAppend, '\0' };
    02409
    02410     return append(theString, theTempBuffer);
    02411 }
    02412
    02413
    02414
    02423 inline XalanDOMString&
    02424 insert(
    02425             XalanDOMString&             theString,
    02426             XalanDOMString::size_type   thePosition,
    02427             const XalanDOMString&       theStringToInsert)
    02428 {
    02429     theString.insert(thePosition, theStringToInsert);
    02430
    02431     return theString;
    02432 }
    02433
    02434
    02435
    02444 inline XalanDOMString&
    02445 insert(
    02446             XalanDOMString&             theString,
    02447             XalanDOMString::size_type   thePosition,
    02448             const XalanDOMChar*         theStringToInsert)
    02449 {
    02450     theString.insert(thePosition, theStringToInsert);
    02451
    02452     return theString;
    02453 }
    02454
    02455
    02456
    02463 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)
    02464 trim(const XalanDOMString&  theString);
    02465
    02466
    02467
    02473 inline void
    02474 clear(XalanDOMString&   theString)
    02475 {
    02476     theString.clear();
    02477 }
    02478
    02479
    02480
    02486 inline void
    02487 erase(XalanDOMString&   theString)
    02488 {
    02489     theString.erase();
    02490 }
    02491
    02492
    02493
    02500 inline void
    02501 releaseMemory(XalanDOMString&   theString)
    02502 {
    02503     XalanDOMString().swap(theString);
    02504 }
    02505
    02506
    02507
    02508 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
    02509 CopyWideStringToVector(
    02510             const XalanDOMChar*     theString,
    02511             CharVectorType&         theVector);
    02512
    02513
    02514
    02515 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
    02516 CopyStringToVector(
    02517             const char*         theString,
    02518             CharVectorType&     theVector);
    02519
    02520
    02521
    02530 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMCharVectorType)
    02531 MakeXalanDOMCharVector(
    02532             const char*     data,
    02533             bool            fTranscode = true);
    02534
    02535
    02536
    02544 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMCharVectorType)
    02545 MakeXalanDOMCharVector(const XalanDOMChar*  data);
    02546
    02547
    02548
    02556 inline XalanDOMCharVectorType
    02557 MakeXalanDOMCharVector(const XalanDOMString&    data)
    02558 {
    02559     return MakeXalanDOMCharVector(c_wstr(data));
    02560 }
    02561
    02562
    02563
    02564 #if defined(XALAN_NO_STD_NAMESPACE)
    02565 struct c_wstr_functor : public unary_function<XalanDOMString, const XalanDOMChar*>
    02566 #else
    02567 struct c_wstr_functor : public std::unary_function<XalanDOMString, const XalanDOMChar*>
    02568 #endif
    02569 {
    02570     result_type
    02571 	operator() (const argument_type&   theString) const
    02572     {
    02573         return c_wstr(theString);
    02574     }
    02575 };
    02576
    02577
    02578
    02585 #if defined(XALAN_NO_STD_NAMESPACE)
    02586 struct DOMStringHashFunction : public unary_function<const XalanDOMString&, size_t>
    02587 #else
    02588 struct DOMStringHashFunction : public std::unary_function<const XalanDOMString&, size_t>
    02589 #endif
    02590 {
    02591     result_type
    02592 	operator() (argument_type  theKey) const
    02593     {
    02594         const XalanDOMChar*     theRawBuffer = c_wstr(theKey);
    02595
    02596         result_type     theHashValue = 0;
    02597
    02598         if (theRawBuffer != 0)
    02599         {
    02600             while (*theRawBuffer)
    02601             {
    02602                 theHashValue = 5 * theHashValue + *theRawBuffer;
    02603
    02604                 theRawBuffer++;
    02605             }
    02606         }
    02607
    02608         return theHashValue++;
    02609     }
    02610 };
    02611
    02612
    02613
    02621 #if defined(XALAN_NO_STD_NAMESPACE)
    02622 struct DOMStringEqualsFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
    02623 #else
    02624 struct DOMStringEqualsFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
    02625 #endif
    02626 {
    02627     result_type
    02628 	operator() (first_argument_type        theLHS,
    02629                 second_argument_type    theRHS) const
    02630     {
    02631         return equals(theLHS, theRHS);
    02632     }
    02633 };
    02634
    02635
    02636
    02644 #if defined(XALAN_NO_STD_NAMESPACE)
    02645 struct DOMStringNotEqualsFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
    02646 #else
    02647 struct DOMStringNotEqualsFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
    02648 #endif
    02649 {
    02650     result_type
    02651 	operator() (first_argument_type        theLHS,
    02652                 second_argument_type    theRHS) const
    02653     {
    02654         return !equals(theLHS, theRHS);
    02655     }
    02656 };
    02657
    02658
    02659
    02667 #if defined(XALAN_NO_STD_NAMESPACE)
    02668 struct DOMStringLessThanFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
    02669 #else
    02670 struct DOMStringLessThanFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
    02671 #endif
    02672 {
    02673     result_type
    02674 	operator() (first_argument_type        theLHS,
    02675                 second_argument_type    theRHS) const
    02676     {
    02677         return compare(theLHS, theRHS) < 0 ? true : false;
    02678     }
    02679 };
    02680
    02681
    02682
    02690 #if defined(XALAN_NO_STD_NAMESPACE)
    02691 struct DOMStringPointerLessThanFunction : public binary_function<const XalanDOMString*, const XalanDOMString*, bool>
    02692 #else
    02693 struct DOMStringPointerLessThanFunction : public std::binary_function<const XalanDOMString*, const XalanDOMString*, bool>
    02694 #endif
    02695 {
    02696     result_type
    02697 	operator() (first_argument_type        theLHS,
    02698                 second_argument_type    theRHS) const
    02699     {
    02700         assert(theLHS != 0 && theRHS != 0);
    02701
    02702         return compare(*theLHS, *theRHS) < 0 ? true : false;
    02703     }
    02704 };
    02705
    02706
    02707
    02715 #if defined(XALAN_NO_STD_NAMESPACE)
    02716 struct DOMStringLessThanIgnoreCaseASCIIFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
    02717 #else
    02718 struct DOMStringLessThanIgnoreCaseASCIIFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
    02719 #endif
    02720 {
    02721     result_type
    02722 	operator() (first_argument_type        theLHS,
    02723                 second_argument_type    theRHS) const
    02724     {
    02725         return compareIgnoreCaseASCII(theLHS, theRHS) < 0 ? true : false;
    02726     }
    02727 };
    02728
    02729
    02730
    02738 #if defined(XALAN_NO_STD_NAMESPACE)
    02739 struct DOMStringLessThanOrEqualFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
    02740 #else
    02741 struct DOMStringLessThanOrEqualFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
    02742 #endif
    02743 {
    02744     result_type
    02745 	operator() (first_argument_type        theLHS,
    02746                 second_argument_type    theRHS) const
    02747     {
    02748         return compare(theLHS, theRHS) <= 0 ? true : false;
    02749     }
    02750 };
    02751
    02752
    02753
    02761 #if defined(XALAN_NO_STD_NAMESPACE)
    02762 struct DOMStringGreaterThanFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
    02763 #else
    02764 struct DOMStringGreaterThanFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
    02765 #endif
    02766 {
    02767     result_type
    02768 	operator() (first_argument_type        theLHS,
    02769                 second_argument_type    theRHS) const
    02770     {
    02771         return compare(theLHS, theRHS) > 0 ? true : false;
    02772     }
    02773 };
    02774
    02775
    02776
    02784 #if defined(XALAN_NO_STD_NAMESPACE)
    02785 struct DOMStringGreaterThanOrEqualFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
    02786 #else
    02787 struct DOMStringGreaterThanOrEqualFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
    02788 #endif
    02789 {
    02790     result_type
    02791 	operator() (first_argument_type        theLHS,
    02792                 second_argument_type    theRHS) const
    02793     {
    02794         return compare(theLHS, theRHS) >= 0 ? true : false;
    02795     }
    02796 };
    02797
    02798
    02799
    02805 #if defined(XALAN_NO_STD_NAMESPACE)
    02806 struct less_no_case_ascii_wide_string : public binary_function<const XalanDOMChar*, const XalanDOMChar*, bool>
    02807 #else
    02808 struct less_no_case_ascii_wide_string : public std::binary_function<const XalanDOMChar*, const XalanDOMChar*, bool>
    02809 #endif
    02810 {
    02819     result_type
    02820 	operator()(
    02821             first_argument_type     theLHS,
    02822             second_argument_type    theRHS) const
    02823     {
    02824         return compareIgnoreCaseASCII(theLHS, theRHS) < 0 ? true : false;
    02825     }
    02826 };
    02827
    02828
    02829
    02836 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(bool)
    02837 isXMLWhitespace(const XalanDOMString&   string);
    02838
    02839
    02840
    02849 XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(bool)
    02850 isXMLWhitespace(
    02851             const XalanDOMChar          ch[],
    02852             XalanDOMString::size_type   start,
    02853             XalanDOMString::size_type   length);
    02854
    02855
    02856
    02863 inline bool
    02864 isXMLWhitespace(const XalanDOMChar*     theString)
    02865 {
    02866     assert(theString != 0);
    02867
    02868     return isXMLWhitespace(theString, 0, length(theString));
    02869 }
    02870
    02871
    02872
    02873 XALAN_CPP_NAMESPACE_END
    02874
    02875
    02876
    02877 #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.6 Copyright © 2000, 2001, 2002, 2003 The Apache Software Foundation. All Rights Reserved.