16 #if !defined(DOMSTRINGHELPER_HEADER_GUARD_1357924680)
17 #define DOMSTRINGHELPER_HEADER_GUARD_1357924680
29 #if defined(XALAN_CLASSIC_IOSTREAMS)
54 XALAN_CPP_NAMESPACE_BEGIN
58 XALAN_USING_XERCES(MemoryManager)
69 #if defined(XALAN_LSTRSUPPORT) && !defined(XALAN_XALANDOMCHAR_USHORT_MISMATCH)
71 #define XALAN_STATIC_UCODE_STRING(str) L##str
75 #define XALAN_STATIC_UCODE_STRING(str) str
81 #if defined(XALAN_NO_ALGORITHMS_WITH_BUILTINS)
83 template<
class InputIteratorType,
class OutputIteratorType>
84 inline OutputIteratorType
86 InputIteratorType begin,
87 InputIteratorType end,
88 OutputIteratorType iterator)
90 for(; begin != end; ++iterator, ++begin)
100 template<
class InputIteratorType,
class OutputIteratorType,
class UnaryFunction>
101 inline OutputIteratorType
103 InputIteratorType begin,
104 InputIteratorType end,
105 OutputIteratorType iterator,
106 UnaryFunction
function)
108 for(; begin != end; ++iterator, ++begin)
110 *iterator =
function(*begin);
118 template<
class InputIteratorType,
class OutputIteratorType>
119 inline OutputIteratorType
121 InputIteratorType begin,
122 InputIteratorType end,
123 OutputIteratorType iterator)
125 return XALAN_STD_QUALIFIER copy(begin, end, iterator);
130 template<
class InputIteratorType,
class OutputIteratorType,
class UnaryFunction>
131 inline OutputIteratorType
133 InputIteratorType begin,
134 InputIteratorType end,
135 OutputIteratorType iterator,
136 UnaryFunction
function)
138 return XALAN_STD_QUALIFIER transform(begin, end, iterator);
152 inline const XalanDOMChar*
155 return theString.
c_str();
170 if (theString.
empty() ==
true)
176 const char*
const ptr = &theString[0];
178 assert(ptr[theString.
size() - 1] ==
'\0');
201 inline const XalanDOMChar*
216 inline const XalanDOMChar*
219 return theString.
c_str();
230 inline const XalanDOMChar*
248 return theString.
empty() ==
true ? 0 : &theString[0];
279 return theString.
length();
294 assert(theString != 0);
296 const XalanDOMChar* theBufferPointer = theString;
298 while(*theBufferPointer != 0)
317 assert(theString != 0);
349 const XalanDOMChar* theString,
350 XalanDOMChar theChar)
352 assert(theString != 0);
354 const XalanDOMChar* thePointer = theString;
356 while(*thePointer != theChar && *thePointer != 0)
378 const XalanDOMChar* theString,
380 XalanDOMChar theChar)
382 assert(theString != 0);
384 const XalanDOMChar* thePointer = theString;
385 const XalanDOMChar*
const theEndPointer = theString + theStringLength;
387 while(*thePointer != theChar && thePointer != theEndPointer)
409 XalanDOMChar theChar)
429 const XalanDOMChar* theString,
431 const XalanDOMChar* theSubstring,
447 const XalanDOMChar* theString,
448 const XalanDOMChar* theSubstring);
480 const XalanDOMChar* theString,
481 XalanDOMChar theChar);
497 XalanDOMChar theChar)
515 const XalanDOMChar* theString,
517 const XalanDOMChar* theSubstring,
531 const XalanDOMChar* theString,
532 const XalanDOMChar* theSubstring)
534 assert(theString != 0 && theSubstring != 0);
550 const XalanDOMChar* theString,
553 assert(theString != 0);
570 const XalanDOMChar* theSubstring)
572 assert(theSubstring != 0);
590 const XalanDOMChar* theSubstring,
593 assert(theSubstring != 0);
630 const XalanDOMChar* theString,
632 const XalanDOMChar* theSubstring,
646 const XalanDOMChar* theString,
647 const XalanDOMChar* theSubstring)
649 assert(theString != 0 && theSubstring != 0);
682 const
void* theValue,
714 MemberFunctionPtr
function);
720 MemberFunctionPtr
function);
753 unsigned long theValue,
783 unsigned long theValue,
832 const XalanDOMChar* theString,
833 MemoryManager& theMemoryManager);
889 MemoryManager& theMemoryManager)
907 XalanOutputStream& theStream,
921 #if defined(XALAN_NO_STD_NAMESPACE)
924 std::ostream& theStream,
939 XalanOutputStream& theStream,
940 const XalanDOMChar* theString);
953 #if defined(XALAN_NO_STD_NAMESPACE)
956 std::ostream& theStream,
958 const XalanDOMChar* theString,
959 MemoryManager& theMemoryManager);
972 XalanOutputStream& theStream,
975 if (
isEmpty(theString) ==
false)
998 std::ostream& theStream,
1001 MemoryManager& theMemoryManager)
1018 inline XalanOutputStream&
1020 XalanOutputStream& theStream,
1039 #if defined(XALAN_NO_STD_NAMESPACE)
1044 inline std::ostream&
1046 std::ostream& theStream,
1066 inline XalanOutputStream&
1068 XalanOutputStream& theStream,
1069 const XalanDOMChar* theString)
1087 #if defined(XALAN_NO_STD_NAMESPACE)
1092 inline std::ostream&
1094 std::ostream& theStream,
1096 const XalanDOMChar* theString)
1115 inline XalanOutputStream&
1117 XalanOutputStream& theStream,
1135 #if defined(XALAN_NO_STD_NAMESPACE)
1140 inline std::ostream&
1142 std::ostream& theStream,
1163 #if defined(XALAN_NO_STD_NAMESPACE)
1168 inline std::ostream&
1170 std::ostream& theStream,
1177 theString.getMemoryManager());
1196 return theString[theIndex];
1261 const XalanDOMChar* theString,
1365 const XalanDOMChar* theString,
1410 const XalanDOMChar* theString,
1478 const XalanDOMChar* theLHS,
1480 const XalanDOMChar* theRHS,
1498 const XalanDOMChar* theLHS,
1499 const XalanDOMChar* theRHS)
1542 const XalanDOMChar* theLHS,
1564 const XalanDOMChar* theRHS)
1588 const XalanDOMChar* theLHS,
1590 const XalanDOMChar* theRHS,
1610 const XalanDOMChar* theLHS,
1611 const XalanDOMChar* theRHS)
1659 const XalanDOMChar* theRHS)
1681 const XalanDOMChar* theLHS,
1701 const XalanDOMChar* theLHS,
1703 const XalanDOMChar* theRHS,
1720 const XalanDOMChar* theLHS,
1721 const XalanDOMChar* theRHS)
1758 const XalanDOMChar* theLHS,
1777 const XalanDOMChar* theRHS)
1794 const XalanDOMChar* theLHS,
1795 const XalanDOMChar* theRHS,
1811 const XalanDOMChar* theLHS,
1813 const XalanDOMChar* theRHS,
1816 return theLHSLength != theRHSLength ?
false :
equals(theLHS, theRHS, theLHSLength);
1830 const XalanDOMChar* theLHS,
1831 const XalanDOMChar* theRHS)
1835 return theLHSLength !=
length(theRHS) ?
false :
equals(theLHS, theRHS, theLHSLength);
1852 return theLHS == theRHS;
1866 const XalanDOMChar* theLHS,
1869 assert(theLHS != 0);
1872 return theRHS == theLHS;
1886 const XalanDOMChar* theRHS)
1888 return equals(theRHS, theLHS);
1904 const XalanDOMChar* theRHS,
1907 return theRHSLength !=
length(theLHS) ?
false :
equals(
c_wstr(theLHS), theRHSLength, theRHS, theRHSLength);
1923 const XalanDOMChar* theLHS,
1924 const XalanDOMChar* theRHS,
1941 const XalanDOMChar* theLHS,
1943 const XalanDOMChar* theRHS,
1946 return theLHSLength != theRHSLength ?
false :
1962 const XalanDOMChar* theLHS,
1963 const XalanDOMChar* theRHS)
1967 return theLength !=
length(theRHS) ?
false :
1988 return theLength !=
length(theRHS) ?
false :
2004 const XalanDOMChar* theLHS,
2009 return theRHSLength !=
length(theLHS) ?
false :
2026 const XalanDOMChar* theRHS)
2047 return compare(theLHS, theRHS) < 0 ?
true :
false;
2066 return compare(theLHS, theRHS) < 0 ?
true :
false;
2084 theString = theStringToAssign;
2102 const XalanDOMChar* theStringToAssign,
2107 theString.
assign(theStringToAssign);
2111 theString.
assign(theStringToAssign, theStringToAssignLength);
2131 theString.
append(theStringToAppend);
2149 const XalanDOMChar* theStringToAppend,
2152 assert(theStringToAppend != 0);
2156 theString.
append(theStringToAppend);
2160 theString.
append(theStringToAppend, theStringToAppendLength);
2179 const char* theStringToAppend,
2203 const XalanDOMChar theCharToAppend)
2205 theString.
append(1, theCharToAppend);
2222 char theCharToAppend)
2225 char theTempBuffer[] = { theCharToAppend,
'\0' };
2227 return append(theString, theTempBuffer);
2246 theString.
insert(thePosition, theStringToInsert);
2265 const XalanDOMChar* theStringToInsert)
2267 theString.
insert(thePosition, theStringToInsert);
2327 const XalanDOMChar* theString,
2334 const
char* theString,
2351 bool fTranscode = true);
2384 #if defined(XALAN_NO_STD_NAMESPACE)
2385 struct c_wstr_functor :
public unary_function<XalanDOMString, const XalanDOMChar*>
2387 struct
c_wstr_functor :
public std::unary_function<XalanDOMString, const XalanDOMChar*>
2393 return c_wstr(theString);
2410 const XalanDOMChar* theRawBuffer =
c_wstr(theKey);
2414 return hasher(theRawBuffer);
2440 assert (theKey != 0);
2469 #if defined(XALAN_NO_STD_NAMESPACE)
2477 second_argument_type theRHS)
const
2479 return equals(theLHS, theRHS);
2492 #if defined(XALAN_NO_STD_NAMESPACE)
2500 second_argument_type theRHS)
const
2502 return !
equals(theLHS, theRHS);
2515 #if defined(XALAN_NO_STD_NAMESPACE)
2523 second_argument_type theRHS)
const
2525 return compare(theLHS, theRHS) < 0 ?
true :
false;
2541 second_argument_type theRHS)
const
2543 assert(theLHS != 0 && theRHS != 0);
2545 return compare(*theLHS, *theRHS) == 0 ?
true :
false;
2557 #if defined(XALAN_NO_STD_NAMESPACE)
2565 second_argument_type theRHS)
const
2567 assert(theLHS != 0 && theRHS != 0);
2569 return compare(*theLHS, *theRHS) < 0 ?
true :
false;
2582 #if defined(XALAN_NO_STD_NAMESPACE)
2590 second_argument_type theRHS)
const
2605 #if defined(XALAN_NO_STD_NAMESPACE)
2613 second_argument_type theRHS)
const
2615 return compare(theLHS, theRHS) <= 0 ?
true :
false;
2628 #if defined(XALAN_NO_STD_NAMESPACE)
2636 second_argument_type theRHS)
const
2638 return compare(theLHS, theRHS) > 0 ?
true :
false;
2651 #if defined(XALAN_NO_STD_NAMESPACE)
2659 second_argument_type theRHS)
const
2661 return compare(theLHS, theRHS) >= 0 ?
true :
false;
2672 #if defined(XALAN_NO_STD_NAMESPACE)
2688 first_argument_type theLHS,
2689 second_argument_type theRHS)
const
2718 const XalanDOMChar ch[],
2733 assert(theString != 0);
2740 XALAN_CPP_NAMESPACE_END
2744 #endif // DOMSTRINGHELPER_HEADER_GUARD_1357924680