|
Xalan-C++ API Reference
1.12.0
|
Go to the documentation of this file.
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,
391 const XalanDOMChar* theSubstring,
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,
482 const XalanDOMChar* theSubstring,
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,
609 const XalanDOMChar* theSubstring,
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,
1385 const XalanDOMString& theString,
1386 XalanDOMString& theSubstring,
1405 const XalanDOMString& theString,
1407 XalanDOMString& theResult,
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,
1628 const XalanDOMChar* theLHS,
1629 const XalanDOMChar* theRHS)
1676 const XalanDOMChar* theLHS,
1702 const XalanDOMChar* theRHS)
1730 const XalanDOMChar* theLHS,
1732 const XalanDOMChar* theRHS,
1752 const XalanDOMChar* theLHS,
1753 const XalanDOMChar* theRHS)
1805 const XalanDOMChar* theRHS)
1831 const XalanDOMChar* theLHS,
1855 const XalanDOMChar* theLHS,
1857 const XalanDOMChar* theRHS,
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
XalanDOMString & append(XalanDOMString &theString, char theCharToAppend)
Concatenate a string and a character.
OutputIteratorType XalanTransform(InputIteratorType begin, InputIteratorType end, OutputIteratorType iterator, UnaryFunction function)
bool equalsIgnoreCaseASCII(const XalanDOMString &theLHS, const XalanDOMChar *theRHS)
Compare the contents of two strings for equality, without regard for case.
MemoryManager & getMemoryManager()
XalanDOMString & insert(XalanDOMString &theString, XalanDOMString::size_type thePosition, const XalanDOMChar *theStringToInsert)
Insert a string into another string.
int compare(const XalanDOMString &theLHS, const XalanDOMChar *theRHS)
Compare the contents of two strings.
XalanDOMString & assign(const XalanDOMChar *theSource)
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
bool isEmpty(const XalanDOMString &str)
Determines if the target string contains any elements.
void clear(XalanDOMString &theString)
Remove all elements from target string.
XalanDOMString::size_type lastIndexOf(const XalanDOMString &theString, XalanDOMChar theChar)
Simulates the java String method lastIndexOf().
bool operator()(const XalanDOMChar *theLHS, const XalanDOMChar *theRHS) const
Compare the values of two objects.
int compareIgnoreCaseASCII(const XalanDOMChar *theLHS, const XalanDOMString &theRHS)
Compare the contents of two strings, in a case insensitive manner.
void releaseMemory(XalanDOMString &theString, MemoryManager &theManager)
Remove all elements from target string and frees all allocated memory.
trim(const XalanDOMString &theString, XalanDOMString &theResult)
Remove leading and trailing whitespace.
long DOMStringToLong(const XalanDOMString &theString)
Converts a XalanDOMString into a long value.
XalanDOMString & NumberToDOMString(XMLInt16 theValue, XalanDOMString &theResult)
Converts a 16-bit int value into a XalanDOMString.
bool startsWith(const XalanDOMString &theString, const XalanDOMString &theSubstring)
Simulates the java String method startsWith().
CopyWideStringToVector(const XalanDOMChar *theString, CharVectorType &theVector)
void reserve(XalanDOMString &theString, XalanDOMString::size_type theCount)
Reserve some space in the string for more efficient concatenation...
const char * toCharArray(const CharVectorType &theString)
Get the underlying representation of the target CharVectorType as a pointer to an array of characters...
XalanDOMString & append(const XalanDOMString &theSource)
WideStringToDouble(const XalanDOMChar *theString, MemoryManager &theMemoryManager)
Converts a wide string into a double value.
Greater than or equal functor for DOMStrings.
double DOMStringToDouble(const XalanDOMString &theString, MemoryManager &theMemoryManager)
Converts a XalanDOMString into a double value.
toLowerCaseASCII(XalanDOMString &theString)
Converts ASCII alphabetic characters from upper case to lower case.
XalanVector< XalanDOMChar > XalanDOMCharVectorType
substring(const XalanDOMString &theString, XalanDOMString::size_type theStartIndex, XalanDOMString &theResult, XalanDOMString::size_type theEndIndex=XalanDOMString::npos)
Simulates the java String method substring().
OutputIteratorType XalanCopy(InputIteratorType begin, InputIteratorType end, OutputIteratorType iterator)
const char * c_str(const CharVectorType &theString)
Get the underlying representation of the target CharVectorType as a null-terminated string.
XalanDOMCharVectorType & MakeXalanDOMCharVector(const XalanDOMString &data, XalanDOMCharVectorType &result)
Utility function to make a null-terminated vector of XMLChs, from a XalanDOMString.
XalanDOMChar toUpperASCII(XalanDOMChar theChar)
Converts ASCII alphabetic characters from lower case to upper case.
int collationCompare(const XalanDOMString &theLHS, const XalanDOMChar *theRHS)
Compare the contents of two strings.
std::ostream & operator<<(std::ostream &target, const StrX &toDump)
void swap(XalanDOMString &theOther)
void erase(XalanDOMString &theString)
Remove all elements from target string.
bool endsWith(const XalanDOMString &theString, const XalanDOMString &theSubstring)
Simulates the java String method endsWith().
void OutputString(std::ostream &theStream, const XalanDOMString &theString, MemoryManager &theMemoryManager)
Outputs the target string to the specified stream.
This functor is designed to compare 0-terminated wide strings in a case-insensitive manner.
PointerToDOMString(const void *theValue, XalanDOMString &theResult)
Converts a pointer into a XalanDOMString.
XalanDOMString & assign(XalanDOMString &theString, const XalanDOMChar *theStringToAssign, XalanDOMString::size_type theStringToAssignLength=XalanDOMString::npos)
Assign one string to another.
int DOMStringToInt(const XalanDOMString &theString)
Converts a XalanDOMString into an integer value.
Less than functor for DOMStrings which ignores case for the characters a-z and A-Z.
Greater than functor for DOMStrings.
WideStringToUnsignedLong(const XalanDOMChar *theString)
Converts a wide string into an unsigned long value.
WideStringToInt(const XalanDOMChar *theString)
Converts a wide string into an integer value.
const XalanDOMChar * c_wstr(const XalanDOMChar *theString)
Get the underlying representation of the wide string as a UNICODE null-terminated string.
const XalanDOMChar * c_str() const
XalanDOMString::size_type length(const char *theString)
Get the length of a null-terminated string.
unsigned long DOMStringToUnsignedLong(const XalanDOMString &theString)
Converts a XalanDOMString into a long value.
iterator erase(iterator thePosition)
bool isXMLLetterOrDigit(XalanDOMChar theChar)
Determines whether character represents a letter or digit.
bool operator<(const XalanDOMString &theLHS, const XalanDOMString &theRHS)
Implements operator< for DOMStrings.
bool equals(const XalanDOMString &theLHS, const XalanDOMChar *theRHS, XalanDOMString::size_type theRHSLength)
Compare the contents of two strings for equality.
bool isXMLDigit(XalanDOMChar theChar)
Determines whether character represents a digit.
XalanDOMChar flipCaseASCII(XalanDOMChar theChar)
Flips the case to of the supplied character.
XalanDOMChar toLowerASCII(XalanDOMChar theChar)
Converts ASCII alphabetic characters from upper case to lower case.
Less than or equal functor for DOMStrings.
bool isXMLWhitespace(const XalanDOMChar *theString)
Determines if a null-terminated string contains only whitespace.
XalanDOMString & NumberToHexDOMString(XMLInt16 theValue, XalanDOMString &theResult)
Converts a 16-bit signed int value into a XalanDOMString.
indexOf(const XalanDOMString &theString, const XalanDOMString &theSubstring)
Simulates the java String method indexOf().
XalanVector< char > CharVectorType
XalanDOMChar charAt(const XalanDOMString &theString, XalanDOMString::size_type theIndex)
Retrieves a character at a specified index in the target string.
toUpperCaseASCII(XalanDOMString &theString)
Converts ASCII alphabetic characters from lower case to upper case.
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.
void reserve(size_type theCount=0)
WideStringToLong(const XalanDOMChar *theString)
Converts a wide string into a long value.
CopyStringToVector(const char *theString, CharVectorType &theVector)
XalanDOMString & insert(size_type thePosition, const XalanDOMString &theString)