18 #if !defined(DOMSTRINGHELPER_HEADER_GUARD_1357924680)
19 #define DOMSTRINGHELPER_HEADER_GUARD_1357924680
56 using xercesc::MemoryManager;
60 class XalanOutputStream;
64 template<
class InputIteratorType,
class OutputIteratorType>
65 inline OutputIteratorType
67 InputIteratorType begin,
68 InputIteratorType end,
69 OutputIteratorType iterator)
71 return std::copy(begin, end, iterator);
76 template<
class InputIteratorType,
class OutputIteratorType,
class UnaryFunction>
77 inline OutputIteratorType
79 InputIteratorType begin,
80 InputIteratorType end,
81 OutputIteratorType iterator,
82 UnaryFunction
function)
84 return std::transform(begin, end, iterator,
function);
98 inline const XalanDOMChar*
101 return theString.
c_str();
116 if (theString.
empty() ==
true)
122 const char*
const ptr = &theString[0];
124 assert(ptr[theString.
size() - 1] ==
'\0');
149 inline const XalanDOMChar*
166 inline const XalanDOMChar*
169 return theString.
c_str();
182 inline const XalanDOMChar*
202 return theString.
empty() ==
true ? 0 : &theString[0];
237 return theString.
length();
252 assert(theString != 0);
254 const XalanDOMChar* theBufferPointer = theString;
256 while(*theBufferPointer != 0)
275 assert(theString != 0);
309 const XalanDOMChar* theString,
310 XalanDOMChar theChar)
312 assert(theString != 0);
314 const XalanDOMChar* thePointer = theString;
316 while(*thePointer != theChar && *thePointer != 0)
338 const XalanDOMChar* theString,
340 XalanDOMChar theChar)
342 assert(theString != 0);
344 const XalanDOMChar* thePointer = theString;
345 const XalanDOMChar*
const theEndPointer = theString + theStringLength;
347 while(*thePointer != theChar && thePointer != theEndPointer)
369 XalanDOMChar theChar)
389 const XalanDOMChar* theString,
390 XalanDOMString::
size_type theStringLength,
391 const XalanDOMChar* theSubstring,
392 XalanDOMString::
size_type theSubstringLength);
407 const XalanDOMChar* theString,
408 const XalanDOMChar* theSubstring)
410 assert(theString != 0 && theSubstring != 0);
428 const XalanDOMString& theString,
429 const XalanDOMString& theSubstring);
445 const XalanDOMChar* theString,
446 XalanDOMChar theChar);
462 XalanDOMChar theChar)
480 const XalanDOMChar* theString,
481 XalanDOMString::
size_type theStringLength,
482 const XalanDOMChar* theSubstring,
483 XalanDOMString::
size_type theSubstringLength);
496 const XalanDOMChar* theString,
497 const XalanDOMChar* theSubstring)
499 assert(theString != 0 && theSubstring != 0);
515 const XalanDOMChar* theString,
518 assert(theString != 0);
523 theSubstring.
c_str(),
539 const XalanDOMChar* theSubstring)
541 assert(theSubstring != 0);
563 const XalanDOMChar* theSubstring,
566 assert(theSubstring != 0);
592 theSubstring.
c_str(),
607 const XalanDOMChar* theString,
608 XalanDOMString::
size_type theStringLength,
609 const XalanDOMChar* theSubstring,
610 XalanDOMString::
size_type theSubstringLength);
623 const XalanDOMChar* theString,
624 const XalanDOMChar* theSubstring)
626 assert(theString != 0 && theSubstring != 0);
652 theSubstring.
c_str(),
667 const
void* theValue,
668 XalanDOMString& theResult);
680 initialize(MemoryManager& theMemoryManager);
689 MemberFunctionPtr
function);
695 MemberFunctionPtr
function);
701 MemberFunctionPtr
function);
761 static_cast<XMLUInt64>(theValue),
774 inline XalanDOMString&
780 static_cast<XMLInt64>(theValue),
793 inline XalanDOMString&
799 static_cast<XMLUInt64>(theValue),
812 inline XalanDOMString&
818 static_cast<XMLInt64>(theValue),
834 XalanDOMString& theResult);
848 XalanDOMString& theResult);
859 inline XalanDOMString&
865 static_cast<XMLUInt64>(theValue),
878 inline XalanDOMString&
884 static_cast<XMLInt64>(theValue),
897 inline XalanDOMString&
903 static_cast<XMLUInt64>(theValue),
916 inline XalanDOMString&
922 static_cast<XMLInt64>(theValue),
970 const XalanDOMChar* theString,
971 MemoryManager& theMemoryManager);
1009 inline unsigned long
1027 MemoryManager& theMemoryManager)
1045 XalanOutputStream& theStream,
1059 std::ostream& theStream,
1073 XalanOutputStream& theStream,
1074 const XalanDOMChar* theString);
1087 std::ostream& theStream,
1088 const XalanDOMChar* theString,
1089 MemoryManager& theMemoryManager);
1105 if (theString.empty() ==
false)
1125 std::ostream& theStream,
1127 MemoryManager& theMemoryManager)
1144 inline XalanOutputStream&
1165 inline std::ostream&
1167 std::ostream& theStream,
1186 inline XalanOutputStream&
1189 const XalanDOMChar* theString)
1207 inline std::ostream&
1209 std::ostream& theStream,
1210 const XalanDOMChar* theString)
1215 XalanMemMgrs::getDefault());
1229 inline XalanOutputStream&
1249 inline std::ostream&
1251 std::ostream& theStream,
1257 XalanMemMgrs::getDefault());
1271 inline std::ostream&
1273 std::ostream& theStream,
1300 return theString[theIndex];
1314 return XalanXMLChar::isWhitespace(theChar);
1328 return XalanXMLChar::isDigit(theChar);
1342 return XalanXMLChar::isDigit(theChar) ||
1343 XalanXMLChar::isLetter(theChar);
1365 const XalanDOMChar* theString,
1366 XalanDOMString& theSubstring,
1367 XalanDOMString::
size_type theStartIndex,
1368 XalanDOMString::
size_type theEndIndex = XalanDOMString::npos);
1385 const XalanDOMString& theString,
1386 XalanDOMString& theSubstring,
1387 XalanDOMString::
size_type theStartIndex,
1388 XalanDOMString::
size_type theEndIndex = XalanDOMString::npos);
1405 const XalanDOMString& theString,
1406 XalanDOMString::
size_type theStartIndex,
1407 XalanDOMString& theResult,
1408 XalanDOMString::
size_type theEndIndex = XalanDOMString::npos);
1423 if (theChar >= XalanUnicode::charLetter_A && theChar <= XalanUnicode::charLetter_Z)
1425 return XalanDOMChar(theChar - (XalanUnicode::charLetter_A - XalanUnicode::charLetter_a));
1446 if (theChar >= XalanUnicode::charLetter_a && theChar <= XalanUnicode::charLetter_z)
1448 return XalanDOMChar(theChar + (XalanUnicode::charLetter_A - XalanUnicode::charLetter_a));
1468 if (theChar >= XalanUnicode::charLetter_A && theChar <= XalanUnicode::charLetter_Z)
1470 return XalanDOMChar(theChar - (XalanUnicode::charLetter_A - XalanUnicode::charLetter_a));
1472 else if (theChar >= XalanUnicode::charLetter_a && theChar <= XalanUnicode::charLetter_z)
1474 return XalanDOMChar(theChar + (XalanUnicode::charLetter_A - XalanUnicode::charLetter_a));
1495 const XalanDOMChar* theString,
1496 XalanDOMString& theResult);
1511 const XalanDOMString& theString,
1512 XalanDOMString& theResult);
1540 const XalanDOMChar* theString,
1541 XalanDOMString& theResult);
1556 const XalanDOMString& theString,
1557 XalanDOMString& theResult);
1608 const XalanDOMChar* theLHS,
1610 const XalanDOMChar* theRHS,
1611 XalanDOMString::
size_type theRHSLength);
1628 const XalanDOMChar* theLHS,
1629 const XalanDOMChar* theRHS)
1676 const XalanDOMChar* theLHS,
1702 const XalanDOMChar* theRHS)
1730 const XalanDOMChar* theLHS,
1732 const XalanDOMChar* theRHS,
1733 XalanDOMString::
size_type theRHSLength);
1752 const XalanDOMChar* theLHS,
1753 const XalanDOMChar* theRHS)
1805 const XalanDOMChar* theRHS)
1831 const XalanDOMChar* theLHS,
1855 const XalanDOMChar* theLHS,
1857 const XalanDOMChar* theRHS,
1858 XalanDOMString::
size_type theRHSLength);
1874 const XalanDOMChar* theLHS,
1875 const XalanDOMChar* theRHS);
1909 const XalanDOMChar* theLHS,
1928 const XalanDOMChar* theRHS)
1949 const XalanDOMChar* theLHS,
1950 const XalanDOMChar* theRHS,
1966 const XalanDOMChar* theLHS,
1968 const XalanDOMChar* theRHS,
1971 return theLHSLength != theRHSLength ?
false :
equals(theLHS, theRHS, theLHSLength);
1985 const XalanDOMChar* theLHS,
1986 const XalanDOMChar* theRHS)
1990 return theLHSLength !=
length(theRHS) ?
false :
equals(theLHS, theRHS, theLHSLength);
2007 return theLHS == theRHS;
2021 const XalanDOMChar* theLHS,
2024 assert(theLHS != 0);
2027 return theRHS == theLHS;
2041 const XalanDOMChar* theRHS)
2043 return equals(theRHS, theLHS);
2059 const XalanDOMChar* theRHS,
2062 return theRHSLength != theLHS.
length() ?
false :
equals(theLHS.
c_str(), theRHSLength, theRHS, theRHSLength);
2078 const XalanDOMChar* theLHS,
2079 const XalanDOMChar* theRHS,
2096 const XalanDOMChar* theLHS,
2098 const XalanDOMChar* theRHS,
2101 return theLHSLength != theRHSLength ?
false :
2117 const XalanDOMChar* theLHS,
2118 const XalanDOMChar* theRHS)
2122 return theLength !=
length(theRHS) ?
false :
2143 return theLength != theRHS.
length() ?
false :
2162 const XalanDOMChar* theLHS,
2167 return theRHSLength !=
length(theLHS) ?
false :
2187 const XalanDOMChar* theRHS)
2208 return compare(theLHS, theRHS) < 0 ?
true :
false;
2227 return compare(theLHS, theRHS) < 0 ?
true :
false;
2242 inline XalanDOMString&
2247 theString = theStringToAssign;
2264 inline XalanDOMString&
2267 const XalanDOMChar* theStringToAssign,
2270 if (theStringToAssignLength == XalanDOMString::npos)
2272 theString.
assign(theStringToAssign);
2276 theString.
assign(theStringToAssign, theStringToAssignLength);
2293 inline XalanDOMString&
2298 theString.
append(theStringToAppend);
2315 inline XalanDOMString&
2318 const XalanDOMChar* theStringToAppend,
2321 assert(theStringToAppend != 0);
2323 if (theStringToAppendLength == XalanDOMString::npos)
2325 theString.
append(theStringToAppend);
2329 theString.
append(theStringToAppend, theStringToAppendLength);
2347 inline XalanDOMString&
2350 const char* theStringToAppend,
2373 inline XalanDOMString&
2376 const XalanDOMChar theCharToAppend)
2378 theString.
append(1, theCharToAppend);
2394 inline XalanDOMString&
2397 char theCharToAppend)
2400 char theTempBuffer[] = { theCharToAppend,
'\0' };
2402 return append(theString, theTempBuffer);
2417 inline XalanDOMString&
2423 theString.
insert(thePosition, theStringToInsert);
2440 inline XalanDOMString&
2444 const XalanDOMChar* theStringToInsert)
2446 theString.
insert(thePosition, theStringToInsert);
2462 const XalanDOMString& theString,
2463 XalanDOMString& theResult);
2513 const XalanDOMChar* theString,
2520 const
char* theString,
2537 bool fTranscode = true);
2575 return theString.
c_str();
2613 return compare(theLHS, theRHS) <= 0 ?
true :
false;
2632 return compare(theLHS, theRHS) > 0 ?
true :
false;
2651 return compare(theLHS, theRHS) >= 0 ?
true :
false;
2674 const XalanDOMChar* theLHS,
2675 const XalanDOMChar* theRHS)
const
2704 const XalanDOMChar ch[],
2719 assert(theString != 0);
2730 #endif // DOMSTRINGHELPER_HEADER_GUARD_1357924680
std::ostream & operator<<(std::ostream &target, const StrX &toDump)
XalanDOMString::size_type length(const char *theString)
Get the length of a null-terminated string.
XalanDOMString & append(XalanDOMString &theString, char theCharToAppend)
Concatenate a string and a character.
bool isXMLLetterOrDigit(XalanDOMChar theChar)
Determines whether character represents a letter or digit.
int compareIgnoreCaseASCII(const XalanDOMChar *theLHS, const XalanDOMString &theRHS)
Compare the contents of two strings, in a case insensitive manner.
XalanDOMString & insert(XalanDOMString &theString, XalanDOMString::size_type thePosition, const XalanDOMChar *theStringToInsert)
Insert a string into another string.
bool equals(const XalanDOMString &theLHS, const XalanDOMChar *theRHS, XalanDOMString::size_type theRHSLength)
Compare the contents of two strings for equality.
XalanDOMChar toLowerASCII(XalanDOMChar theChar)
Converts ASCII alphabetic characters from upper case to lower case.
trim(const XalanDOMString &theString, XalanDOMString &theResult)
Remove leading and trailing whitespace.
Less than or equal functor for DOMStrings.
Greater than or equal functor for DOMStrings.
OutputIteratorType XalanTransform(InputIteratorType begin, InputIteratorType end, OutputIteratorType iterator, UnaryFunction function)
void releaseMemory(XalanDOMString &theString, MemoryManager &theManager)
Remove all elements from target string and frees all allocated memory.
void reserve(XalanDOMString &theString, XalanDOMString::size_type theCount)
Reserve some space in the string for more efficient concatenation...
bool isXMLDigit(XalanDOMChar theChar)
Determines whether character represents a digit.
XalanVector< char > CharVectorType
XalanDOMString & insert(size_type thePosition, const XalanDOMString &theString)
void erase(XalanDOMString &theString)
Remove all elements from target string.
MemoryManager & getMemoryManager()
This functor is designed to compare 0-terminated wide strings in a case-insensitive manner...
XalanDOMString & NumberToDOMString(XMLInt16 theValue, XalanDOMString &theResult)
Converts a 16-bit int value into a XalanDOMString.
WideStringToDouble(const XalanDOMChar *theString, MemoryManager &theMemoryManager)
Converts a wide string into a double value.
XalanDOMString & assign(const XalanDOMChar *theSource)
substring(const XalanDOMString &theString, XalanDOMString::size_type theStartIndex, XalanDOMString &theResult, XalanDOMString::size_type theEndIndex=XalanDOMString::npos)
Simulates the java String method substring().
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
WideStringToLong(const XalanDOMChar *theString)
Converts a wide string into a long value.
const char * toCharArray(const CharVectorType &theString)
Get the underlying representation of the target CharVectorType as a pointer to an array of characters...
bool isEmpty(const XalanDOMString &str)
Determines if the target string contains any elements.
const char * c_str(const CharVectorType &theString)
Get the underlying representation of the target CharVectorType as a null-terminated string...
toLowerCaseASCII(XalanDOMString &theString)
Converts ASCII alphabetic characters from upper case to lower case.
bool startsWith(const XalanDOMString &theString, const XalanDOMString &theSubstring)
Simulates the java String method startsWith().
bool equalsIgnoreCaseASCII(const XalanDOMString &theLHS, const XalanDOMChar *theRHS)
Compare the contents of two strings for equality, without regard for case.
XalanDOMString::size_type lastIndexOf(const XalanDOMString &theString, XalanDOMChar theChar)
Simulates the java String method lastIndexOf().
const XalanDOMChar * c_str() const
XalanDOMString & append(const XalanDOMString &theSource)
XalanDOMString & NumberToHexDOMString(XMLInt16 theValue, XalanDOMString &theResult)
Converts a 16-bit signed int value into a XalanDOMString.
OutputIteratorType XalanCopy(InputIteratorType begin, InputIteratorType end, OutputIteratorType iterator)
toUpperCaseASCII(XalanDOMString &theString)
Converts ASCII alphabetic characters from lower case to upper case.
void OutputString(std::ostream &theStream, const XalanDOMString &theString, MemoryManager &theMemoryManager)
Outputs the target string to the specified stream.
const XalanDOMChar * c_wstr(const XalanDOMChar *theString)
Get the underlying representation of the wide string as a UNICODE null-terminated string...
double DOMStringToDouble(const XalanDOMString &theString, MemoryManager &theMemoryManager)
Converts a XalanDOMString into a double value.
int collationCompare(const XalanDOMString &theLHS, const XalanDOMChar *theRHS)
Compare the contents of two strings.
XalanDOMString & assign(XalanDOMString &theString, const XalanDOMChar *theStringToAssign, XalanDOMString::size_type theStringToAssignLength=XalanDOMString::npos)
Assign one string to another.
indexOf(const XalanDOMString &theString, const XalanDOMString &theSubstring)
Simulates the java String method indexOf().
iterator erase(iterator thePosition)
WideStringToUnsignedLong(const XalanDOMChar *theString)
Converts a wide string into an unsigned long value.
CopyWideStringToVector(const XalanDOMChar *theString, CharVectorType &theVector)
Less than functor for DOMStrings which ignores case for the characters a-z and A-Z.
bool operator<(const XalanDOMString &theLHS, const XalanDOMString &theRHS)
Implements operator< for DOMStrings.
XalanVector< XalanDOMChar > XalanDOMCharVectorType
void reserve(size_type theCount=0)
bool endsWith(const XalanDOMString &theString, const XalanDOMString &theSubstring)
Simulates the java String method endsWith().
CopyStringToVector(const char *theString, CharVectorType &theVector)
int DOMStringToInt(const XalanDOMString &theString)
Converts a XalanDOMString into an integer value.
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.
XalanDOMCharVectorType & MakeXalanDOMCharVector(const XalanDOMString &data, XalanDOMCharVectorType &result)
Utility function to make a null-terminated vector of XMLChs, from a XalanDOMString.
XalanDOMChar flipCaseASCII(XalanDOMChar theChar)
Flips the case to of the supplied character.
WideStringToInt(const XalanDOMChar *theString)
Converts a wide string into an integer value.
void swap(XalanDOMString &theOther)
bool isXMLWhitespace(const XalanDOMChar *theString)
Determines if a null-terminated string contains only whitespace.
XalanDOMChar toUpperASCII(XalanDOMChar theChar)
Converts ASCII alphabetic characters from lower case to upper case.
int compare(const XalanDOMString &theLHS, const XalanDOMChar *theRHS)
Compare the contents of two strings.
Greater than functor for DOMStrings.
void clear(XalanDOMString &theString)
Remove all elements from target string.
long DOMStringToLong(const XalanDOMString &theString)
Converts a XalanDOMString into a long value.
unsigned long DOMStringToUnsignedLong(const XalanDOMString &theString)
Converts a XalanDOMString into a long value.
PointerToDOMString(const void *theValue, XalanDOMString &theResult)
Converts a pointer into a XalanDOMString.
XalanDOMChar charAt(const XalanDOMString &theString, XalanDOMString::size_type theIndex)
Retrieves a character at a specified index in the target string.
bool operator()(const XalanDOMChar *theLHS, const XalanDOMChar *theRHS) const
Compare the values of two objects.