18 #if !defined(DOMSTRINGHELPER_HEADER_GUARD_1357924680) 19 #define DOMSTRINGHELPER_HEADER_GUARD_1357924680 31 #if defined(XALAN_CLASSIC_IOSTREAMS) 56 XALAN_CPP_NAMESPACE_BEGIN
68 template<
class InputIteratorType,
class OutputIteratorType>
69 inline OutputIteratorType
71 InputIteratorType begin,
72 InputIteratorType end,
73 OutputIteratorType iterator)
75 return XALAN_STD_QUALIFIER copy(begin, end, iterator);
80 template<
class InputIteratorType,
class OutputIteratorType,
class UnaryFunction>
81 inline OutputIteratorType
83 InputIteratorType begin,
84 InputIteratorType end,
85 OutputIteratorType iterator,
86 UnaryFunction
function)
88 return XALAN_STD_QUALIFIER transform(begin, end, iterator);
102 inline const XalanDOMChar*
105 return theString.
c_str();
120 if (theString.
empty() ==
true)
126 const char*
const ptr = &theString[0];
128 assert(ptr[theString.
size() - 1] ==
'\0');
153 inline const XalanDOMChar*
170 inline const XalanDOMChar*
173 return theString.
c_str();
186 inline const XalanDOMChar*
206 return theString.
empty() ==
true ? 0 : &theString[0];
241 return theString.
length();
256 assert(theString != 0);
258 const XalanDOMChar* theBufferPointer = theString;
260 while(*theBufferPointer != 0)
279 assert(theString != 0);
313 const XalanDOMChar* theString,
314 XalanDOMChar theChar)
316 assert(theString != 0);
318 const XalanDOMChar* thePointer = theString;
320 while(*thePointer != theChar && *thePointer != 0)
342 const XalanDOMChar* theString,
344 XalanDOMChar theChar)
346 assert(theString != 0);
348 const XalanDOMChar* thePointer = theString;
349 const XalanDOMChar*
const theEndPointer = theString + theStringLength;
351 while(*thePointer != theChar && thePointer != theEndPointer)
373 XalanDOMChar theChar)
393 const XalanDOMChar* theString,
395 const XalanDOMChar* theSubstring,
411 const XalanDOMChar* theString,
412 const XalanDOMChar* theSubstring)
414 assert(theString != 0 && theSubstring != 0);
449 const XalanDOMChar* theString,
450 XalanDOMChar theChar);
466 XalanDOMChar theChar)
484 const XalanDOMChar* theString,
486 const XalanDOMChar* theSubstring,
500 const XalanDOMChar* theString,
501 const XalanDOMChar* theSubstring)
503 assert(theString != 0 && theSubstring != 0);
519 const XalanDOMChar* theString,
522 assert(theString != 0);
527 theSubstring.
c_str(),
543 const XalanDOMChar* theSubstring)
545 assert(theSubstring != 0);
567 const XalanDOMChar* theSubstring,
570 assert(theSubstring != 0);
596 theSubstring.
c_str(),
611 const XalanDOMChar* theString,
613 const XalanDOMChar* theSubstring,
627 const XalanDOMChar* theString,
628 const XalanDOMChar* theSubstring)
630 assert(theString != 0 && theSubstring != 0);
656 theSubstring.
c_str(),
671 const void* theValue,
684 initialize(MemoryManager& theMemoryManager);
693 MemberFunctionPtr
function);
699 MemberFunctionPtr
function);
705 MemberFunctionPtr
function);
761 unsigned long theValue,
765 static_cast<XALAN_UINT64>(theValue),
784 static_cast<XALAN_INT64>(theValue),
799 unsigned int theValue,
803 static_cast<XALAN_UINT64>(theValue),
822 static_cast<XALAN_INT64>(theValue),
837 unsigned short theValue,
841 static_cast<XALAN_UINT64>(theValue),
860 static_cast<XALAN_INT64>(theValue),
903 unsigned long theValue,
907 static_cast<XALAN_UINT64>(theValue),
926 static_cast<XALAN_INT64>(theValue),
941 unsigned int theValue,
945 static_cast<XALAN_UINT64>(theValue),
964 static_cast<XALAN_INT64>(theValue),
979 unsigned short theValue,
983 static_cast<XALAN_UINT64>(theValue),
1002 static_cast<XALAN_INT64>(theValue),
1050 const XalanDOMChar* theString,
1051 MemoryManager& theMemoryManager);
1089 inline unsigned long 1107 MemoryManager& theMemoryManager)
1142 std::ostream& theStream,
1158 const XalanDOMChar* theString);
1174 std::ostream& theStream,
1176 const XalanDOMChar* theString,
1177 MemoryManager& theMemoryManager);
1193 if (theString.
empty() ==
false)
1216 std::ostream& theStream,
1219 MemoryManager& theMemoryManager)
1257 #if defined(XALAN_NO_STD_NAMESPACE) 1262 inline std::ostream&
1264 std::ostream& theStream,
1287 const XalanDOMChar* theString)
1305 #if defined(XALAN_NO_STD_NAMESPACE) 1310 inline std::ostream&
1312 std::ostream& theStream,
1314 const XalanDOMChar* theString)
1353 #if defined(XALAN_NO_STD_NAMESPACE) 1358 inline std::ostream&
1360 std::ostream& theStream,
1381 #if defined(XALAN_NO_STD_NAMESPACE) 1386 inline std::ostream&
1388 std::ostream& theStream,
1395 theString.getMemoryManager());
1416 return theString[theIndex];
1481 const XalanDOMChar* theString,
1611 const XalanDOMChar* theString,
1656 const XalanDOMChar* theString,
1724 const XalanDOMChar* theLHS,
1726 const XalanDOMChar* theRHS,
1744 const XalanDOMChar* theLHS,
1745 const XalanDOMChar* theRHS)
1792 const XalanDOMChar* theLHS,
1818 const XalanDOMChar* theRHS)
1846 const XalanDOMChar* theLHS,
1848 const XalanDOMChar* theRHS,
1868 const XalanDOMChar* theLHS,
1869 const XalanDOMChar* theRHS)
1921 const XalanDOMChar* theRHS)
1947 const XalanDOMChar* theLHS,
1971 const XalanDOMChar* theLHS,
1973 const XalanDOMChar* theRHS,
1990 const XalanDOMChar* theLHS,
1991 const XalanDOMChar* theRHS);
2025 const XalanDOMChar* theLHS,
2044 const XalanDOMChar* theRHS)
2065 const XalanDOMChar* theLHS,
2066 const XalanDOMChar* theRHS,
2082 const XalanDOMChar* theLHS,
2084 const XalanDOMChar* theRHS,
2087 return theLHSLength != theRHSLength ? false :
equals(theLHS, theRHS, theLHSLength);
2101 const XalanDOMChar* theLHS,
2102 const XalanDOMChar* theRHS)
2106 return theLHSLength !=
length(theRHS) ? false :
equals(theLHS, theRHS, theLHSLength);
2123 return theLHS == theRHS;
2137 const XalanDOMChar* theLHS,
2140 assert(theLHS != 0);
2143 return theRHS == theLHS;
2157 const XalanDOMChar* theRHS)
2159 return equals(theRHS, theLHS);
2175 const XalanDOMChar* theRHS,
2178 return theRHSLength != theLHS.
length() ? false :
equals(theLHS.
c_str(), theRHSLength, theRHS, theRHSLength);
2194 const XalanDOMChar* theLHS,
2195 const XalanDOMChar* theRHS,
2212 const XalanDOMChar* theLHS,
2214 const XalanDOMChar* theRHS,
2217 return theLHSLength != theRHSLength ? false :
2233 const XalanDOMChar* theLHS,
2234 const XalanDOMChar* theRHS)
2238 return theLength !=
length(theRHS) ? false :
2259 return theLength != theRHS.
length() ? false :
2278 const XalanDOMChar* theLHS,
2283 return theRHSLength !=
length(theLHS) ? false :
2303 const XalanDOMChar* theRHS)
2324 return compare(theLHS, theRHS) < 0 ? true :
false;
2343 return compare(theLHS, theRHS) < 0 ? true :
false;
2363 theString = theStringToAssign;
2383 const XalanDOMChar* theStringToAssign,
2388 theString.
assign(theStringToAssign);
2392 theString.
assign(theStringToAssign, theStringToAssignLength);
2414 theString.
append(theStringToAppend);
2434 const XalanDOMChar* theStringToAppend,
2437 assert(theStringToAppend != 0);
2441 theString.
append(theStringToAppend);
2445 theString.
append(theStringToAppend, theStringToAppendLength);
2466 const char* theStringToAppend,
2492 const XalanDOMChar theCharToAppend)
2494 theString.
append(1, theCharToAppend);
2513 char theCharToAppend)
2516 char theTempBuffer[] = { theCharToAppend,
'\0' };
2518 return append(theString, theTempBuffer);
2539 theString.
insert(thePosition, theStringToInsert);
2560 const XalanDOMChar* theStringToInsert)
2562 theString.
insert(thePosition, theStringToInsert);
2629 const XalanDOMChar* theString,
2636 const char* theString,
2653 bool fTranscode =
true);
2686 #if defined(XALAN_NO_STD_NAMESPACE) 2687 struct c_wstr_functor :
public unary_function<XalanDOMString, const XalanDOMChar*>
2689 struct
c_wstr_functor :
public std::unary_function<XalanDOMString, const XalanDOMChar*>
2693 operator() (
const argument_type& theString)
const 2695 return theString.c_str();
2708 #if defined(XALAN_NO_STD_NAMESPACE) 2715 operator() (first_argument_type theLHS,
2716 second_argument_type theRHS)
const 2731 #if defined(XALAN_NO_STD_NAMESPACE) 2738 operator() (first_argument_type theLHS,
2739 second_argument_type theRHS)
const 2741 return compare(theLHS, theRHS) <= 0 ? true :
false;
2754 #if defined(XALAN_NO_STD_NAMESPACE) 2761 operator() (first_argument_type theLHS,
2762 second_argument_type theRHS)
const 2764 return compare(theLHS, theRHS) > 0 ? true :
false;
2777 #if defined(XALAN_NO_STD_NAMESPACE) 2784 operator() (first_argument_type theLHS,
2785 second_argument_type theRHS)
const 2787 return compare(theLHS, theRHS) >= 0 ? true :
false;
2798 #if defined(XALAN_NO_STD_NAMESPACE) 2814 first_argument_type theLHS,
2815 second_argument_type theRHS)
const 2844 const XalanDOMChar ch[],
2859 assert(theString != 0);
2866 XALAN_CPP_NAMESPACE_END
2870 #endif // DOMSTRINGHELPER_HEADER_GUARD_1357924680 toLowerCaseASCII(const XalanDOMChar *theString, XalanDOMString &theResult)
Converts ASCII alphabetic characters from upper case to lower case.
const XalanDOMChar * c_wstr(const XalanDOMString &theString)
Get the underlying representation of the target XalanDOMString as a null-terminated string...
XalanDOMChar toLowerASCII(XalanDOMChar theChar)
Converts ASCII alphabetic characters from upper case to lower case.
startsWith(const XalanDOMChar *theString, XalanDOMString::size_type theStringLength, const XalanDOMChar *theSubstring, XalanDOMString::size_type theSubstringLength)
Simulates the java String method startsWith().
void reserve(XalanDOMString &theString, XalanDOMString::size_type theCount)
Reserve some space in the string for more efficient concatenation...
OutputString(XalanOutputStream &theStream, const CharVectorType &theString)
Outputs the target string to the specified stream.
void reserve(size_type theCount=0)
XalanDOMString & assign(XalanDOMString &theString, const XalanDOMString &theStringToAssign)
Assign one string to another.
Greater than functor for DOMStrings.
toUpperCaseASCII(const XalanDOMChar *theString, XalanDOMString &theResult)
Converts ASCII alphabetic characters from lower case to upper case.
void erase(XalanDOMString &theString)
Remove all elements from target string.
lastIndexOf(const XalanDOMChar *theString, XalanDOMChar theChar)
Simulates the java String method lastIndexOf().
equalsIgnoreCaseASCII(const XalanDOMChar *theLHS, const XalanDOMChar *theRHS, XalanDOMString::size_type theLength)
Compare the contents of two arrays for equality, without regard for case.
void swap(XalanDOMString &theOther)
unsigned long DOMStringToUnsignedLong(const XalanDOMString &theString)
Converts a XalanDOMString into a long value.
WideStringToLong(const XalanDOMChar *theString)
Converts a wide string into a long value.
static bool isLetter(XalanDOMChar c)
OutputIteratorType XalanTransform(InputIteratorType begin, InputIteratorType end, OutputIteratorType iterator, UnaryFunction function)
double DOMStringToDouble(const XalanDOMString &theString, MemoryManager &theMemoryManager)
Converts a XalanDOMString into a double value.
XalanDOMString & insert(size_type thePosition, const XalanDOMString &theString)
PointerToDOMString(const void *theValue, XalanDOMString &theResult)
Converts a pointer into a XalanDOMString.
iterator erase(iterator thePosition)
void clear(XalanDOMString &theString)
Remove all elements from target string.
compare(const CharVectorType &theLHS, const CharVectorType &theRHS)
Compare the contents of two strings.
Less than functor for DOMStrings which ignores case for the characters a-z and A-Z.
WideStringToInt(const XalanDOMChar *theString)
Converts a wide string into an integer value.
XalanDOMString::size_type indexOf(const XalanDOMChar *theString, XalanDOMChar theChar)
Simulates the java String method indexOf().
XalanDOMString & append(XalanDOMString &theString, const XalanDOMString &theStringToAppend)
Concatenate two strings.
void releaseMemory(XalanDOMString &theString, MemoryManager &theManager)
Remove all elements from target string and frees all allocated memory.
This functor is designed to compare 0-terminated wide strings in a case-insensitive manner...
XalanOutputStream & operator<<(XalanOutputStream &theStream, const CharVectorType &theString)
Outputs the string to the specified stream.
const XalanDOMChar * c_str() const
long DOMStringToLong(const XalanDOMString &theString)
Converts a XalanDOMString into a long value.
bool operator<(const CharVectorType &theLHS, const CharVectorType &theRHS)
Implements operator< for CharVectorType.
XalanDOMString & assign(const XalanDOMChar *theSource)
int DOMStringToInt(const XalanDOMString &theString)
Converts a XalanDOMString into an integer value.
WideStringToUnsignedLong(const XalanDOMChar *theString)
Converts a wide string into an unsigned long value.
#define XALAN_NO_STD_NAMESPACE
OutputIteratorType XalanCopy(InputIteratorType begin, InputIteratorType end, OutputIteratorType iterator)
collationCompare(const XalanDOMChar *theLHS, XalanDOMString::size_type theLHSLength, const XalanDOMChar *theRHS, XalanDOMString::size_type theRHSLength)
Compare the contents of two character arrays.
endsWith(const XalanDOMChar *theString, XalanDOMString::size_type theStringLength, const XalanDOMChar *theSubstring, XalanDOMString::size_type theSubstringLength)
Simulates the java String method endsWith().
const char * c_str(const CharVectorType &theString)
Get the underlying representation of the target CharVectorType as a null-terminated string...
substring(const XalanDOMChar *theString, XalanDOMString &theSubstring, XalanDOMString::size_type theStartIndex, XalanDOMString::size_type theEndIndex=XalanDOMString::npos)
Simulates the java String method substring().
MemoryManager & getMemoryManager()
result_type operator()(first_argument_type theLHS, second_argument_type theRHS) const
Compare the values of two objects.
NumberToDOMString(double theValue, XalanDOMString &theResult)
Converts a double value into a XalanDOMString.
static MemoryManager & getDefault()
bool isXMLLetterOrDigit(XalanDOMChar theChar)
Determines whether character represents a letter or digit.
compareIgnoreCaseASCII(const XalanDOMChar *theLHS, XalanDOMString::size_type theLHSLength, const XalanDOMChar *theRHS, XalanDOMString::size_type theRHSLength)
Compare the contents of two arrays in a case insensitive manner.
XalanDOMChar toUpperASCII(XalanDOMChar theChar)
Converts ASCII alphabetic characters from lower case to upper case.
static bool isWhitespace(XalanDOMChar c)
MakeXalanDOMCharVector(const char *data, XalanDOMCharVectorType &result, bool fTranscode=true)
Utility function to make a null-terminated vector of XMLChs, from a null-terminated array of chars...
WideStringToDouble(const XalanDOMChar *theString, MemoryManager &theMemoryManager)
Converts a wide string into a double value.
Less than or equal functor for DOMStrings.
XalanDOMChar charAt(const XalanDOMString &theString, XalanDOMString::size_type theIndex)
Retrieves a character at a specified index in the target string.
CopyStringToVector(const char *theString, CharVectorType &theVector)
Greater than or equal functor for DOMStrings.
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
XalanDOMString & append(const XalanDOMString &theSource)
const XalanDOMChar * toCharArray(const XalanDOMString &theString)
Get the underlying representation of the target XalanDOMString as an array of XalanDOMChar, not guaranteed to be null-terminated.
NumberToHexDOMString(XALAN_UINT64 theValue, XalanDOMString &theResult)
Converts an 64-bit unsigned value into a XalanDOMString.
bool isXMLDigit(XalanDOMChar theChar)
Determines whether character represents a digit.
bool isXMLWhitespace(XalanDOMChar theChar)
Determines whether character represents white space.
const XalanDOMString TranscodeFromLocalCodePage(const char *theSourceString, XalanDOMString::size_type theSourceStringLength=XalanDOMString::npos)
Convert a string to a XalanDOMString, transcoding from the default local code page.
XalanDOMChar flipCaseASCII(XalanDOMChar theChar)
Flips the case to of the supplied character.
bool isEmpty(const XalanDOMString &str)
Determines if the target string contains any elements.
XALAN_CPP_NAMESPACE_BEGIN XALAN_USING_XERCES(Locator)
equals(const XalanDOMChar *theLHS, const XalanDOMChar *theRHS, XalanDOMString::size_type theLength)
Compare the contents of two arrays for equality.
trim(const XalanDOMString &theString, XalanDOMString &theResult)
Remove leading and trailing whitespace.
XalanDOMString & insert(XalanDOMString &theString, XalanDOMString::size_type thePosition, const XalanDOMString &theStringToInsert)
Insert a string into another string.
static bool isDigit(XalanDOMChar c)
CopyWideStringToVector(const XalanDOMChar *theString, CharVectorType &theVector)