22 #if !defined(XERCESC_INCLUDE_GUARD_XMLSTRING_HPP)
23 #define XERCESC_INCLUDE_GUARD_XMLSTRING_HPP
25 #include <xercesc/util/BaseRefVectorOf.hpp>
26 #include <xercesc/framework/XMLBuffer.hpp>
70 ,
const char*
const src
88 ,
const XMLCh*
const src
105 static int compareIString
107 const char*
const str1
108 ,
const char*
const str2
121 static int compareIString
123 const XMLCh*
const str1
124 ,
const XMLCh*
const str2
138 static int compareIStringASCII
140 const XMLCh*
const str1
141 ,
const XMLCh*
const str2
159 static int compareNString
161 const char*
const str1
162 ,
const char*
const str2
179 static int compareNString
181 const XMLCh*
const str1
182 ,
const XMLCh*
const str2
200 static int compareNIString
202 const char*
const str1
203 ,
const char*
const str2
221 static int compareNIString
223 const XMLCh*
const str1
224 ,
const XMLCh*
const str2
240 static int compareString
242 const char*
const str1
243 ,
const char*
const str2
257 static int compareString
259 const XMLCh*
const str1
260 ,
const XMLCh*
const str2
341 static bool regionMatches
343 const XMLCh*
const str1
345 ,
const XMLCh*
const str2
377 static bool regionIMatches
379 const XMLCh*
const str1
381 ,
const XMLCh*
const str2
399 static void copyString
402 ,
const char*
const src
415 static void copyString
418 ,
const XMLCh*
const src
433 static bool copyNString
436 ,
const XMLCh*
const src
451 const char*
const toHash
463 const XMLCh*
const toHash
477 const XMLCh*
const toHash
494 static int indexOf(
const char*
const toSearch,
const char ch);
504 static int indexOf(
const XMLCh*
const toSearch,
const XMLCh ch);
519 const char*
const toSearch
520 ,
const char chToFind
538 const XMLCh*
const toSearch
539 ,
const XMLCh chToFind
552 static int lastIndexOf(
const char*
const toSearch,
const char ch);
562 static int lastIndexOf(
const XMLCh*
const toSearch,
const XMLCh ch);
573 static int lastIndexOf
576 ,
const XMLCh*
const toSearch
591 static int lastIndexOf
593 const char*
const toSearch
594 ,
const char chToFind
610 static int lastIndexOf
612 const XMLCh*
const toSearch
626 static void moveChars
628 XMLCh*
const targetStr
629 ,
const XMLCh*
const srcStr
646 static void subString
648 char*
const targetStr
649 ,
const char*
const srcStr
664 static void subString
666 XMLCh*
const targetStr
667 ,
const XMLCh*
const srcStr
683 static void subString
685 XMLCh*
const targetStr
686 ,
const XMLCh*
const srcStr
707 static char* replicate(
const char*
const toRep,
720 static XMLCh* replicate(
const XMLCh*
const toRep,
733 static bool startsWith
735 const char*
const toTest
736 ,
const char*
const prefix
745 static bool startsWith
747 const XMLCh*
const toTest
748 ,
const XMLCh*
const prefix
759 static bool startsWithI
761 const char*
const toTest
762 ,
const char*
const prefix
774 static bool startsWithI
776 const XMLCh*
const toTest
777 ,
const XMLCh*
const prefix
788 const XMLCh*
const toTest
789 ,
const XMLCh*
const suffix
801 static const XMLCh* findAny
803 const XMLCh*
const toSearch
804 ,
const XMLCh*
const searchList
815 static XMLCh* findAny
817 XMLCh*
const toSearch
818 ,
const XMLCh*
const searchList
827 static int patternMatch
829 const XMLCh*
const toSearch
830 ,
const XMLCh*
const pattern
837 static XMLSize_t stringLen(
const char*
const src);
852 static bool isValidNOTATION(
const XMLCh*
const name
860 static bool isValidEncName(
const XMLCh*
const name);
868 static bool isAlpha(
XMLCh const theChar);
875 static bool isDigit(
XMLCh const theChar);
882 static bool isAlphaNum(
XMLCh const theChar);
889 static bool isHex(
XMLCh const theChar);
896 static bool isInList(
const XMLCh*
const toFind,
const XMLCh*
const enumList);
914 static void sizeToText
919 ,
const unsigned int radix
934 static void sizeToText
937 ,
XMLCh*
const toFill
939 ,
const unsigned int radix
954 static void binToText
956 const unsigned int toFormat
959 ,
const unsigned int radix
974 static void binToText
976 const unsigned int toFormat
977 ,
XMLCh*
const toFill
979 ,
const unsigned int radix
994 static void binToText
996 const unsigned long toFormat
999 ,
const unsigned int radix
1014 static void binToText
1016 const unsigned long toFormat
1017 ,
XMLCh*
const toFill
1019 ,
const unsigned int radix
1034 static void binToText
1037 ,
char*
const toFill
1039 ,
const unsigned int radix
1054 static void binToText
1057 ,
XMLCh*
const toFill
1059 ,
const unsigned int radix
1074 static void binToText
1077 ,
char*
const toFill
1079 ,
const unsigned int radix
1094 static void binToText
1097 ,
XMLCh*
const toFill
1099 ,
const unsigned int radix
1114 static bool textToBin
1116 const XMLCh*
const toConvert
1117 ,
unsigned int& toFill
1136 const XMLCh*
const toConvert
1147 XMLCh*
const toCutFrom
1162 static char* transcode
1164 const XMLCh*
const toTranscode
1183 static bool transcode
1185 const XMLCh*
const toTranscode
1186 ,
char*
const toFill
1202 static XMLCh* transcode
1204 const char*
const toTranscode
1218 static bool transcode
1220 const char*
const toTranscode
1221 ,
XMLCh*
const toFill
1231 static void trim(
char*
const toTrim);
1238 static void trim(
XMLCh*
const toTrim);
1247 static BaseRefVectorOf<XMLCh>* tokenizeString(
const XMLCh*
const tokenizeSrc
1262 static XMLCh* makeUName
1264 const XMLCh*
const pszURI
1265 ,
const XMLCh*
const pszName
1286 XMLCh*
const errText
1288 ,
const XMLCh*
const text1
1289 ,
const XMLCh*
const text2
1290 ,
const XMLCh*
const text3
1291 ,
const XMLCh*
const text4
1299 static void upperCase(
XMLCh*
const toUpperCase);
1306 static void upperCaseASCII(
XMLCh*
const toUpperCase);
1312 static void lowerCase(
XMLCh*
const toLowerCase);
1319 static void lowerCaseASCII(
XMLCh*
const toLowerCase);
1324 static bool isWSReplaced(
const XMLCh*
const toCheck);
1329 static bool isWSCollapsed(
const XMLCh*
const toCheck);
1336 static void replaceWS(
XMLCh* toConvert
1344 static void collapseWS(
XMLCh* toConvert
1352 static void removeWS(
XMLCh* toConvert
1361 static void removeChar(
const XMLCh*
const srcString
1362 ,
const XMLCh& toRemove
1363 , XMLBuffer& dstBuffer);
1372 static void fixURI(
const XMLCh*
const str,
XMLCh*
const target);
1421 static void termString();
1428 static bool validateRegion(
const XMLCh*
const str1,
const int offset1,
1429 const XMLCh*
const str2,
const int offset2,
1443 ,
const XMLCh*
const srcStr
1446 memcpy(targetStr, srcStr, count *
sizeof(
XMLCh));
1454 const XMLCh* pszTmp = src;
1458 return (pszTmp - src - 1);
1470 memcpy(ret, toRep, (len + 1) *
sizeof(
XMLCh));
1476 ,
const XMLCh*
const prefix)
1482 ,
const XMLCh*
const prefix)
1488 const XMLCh*
const suffix)
1494 suffix, 0, suffixLen);
1497 inline bool XMLString::validateRegion(
const XMLCh*
const str1,
1499 const XMLCh*
const str2,
1504 if (offset1 < 0 || offset2 < 0 ||
1513 ,
const XMLCh* str2)
1518 if (str1 == 0 || str2 == 0)
1519 return ((!str1 || !*str1) && (!str2 || !*str2));
1522 if(*str1++ != *str2++)
1533 if (str1 == str2 || n == 0)
1536 if (str1 == 0 || str2 == 0)
1537 return ((!str1 || !*str1) && (!str2 || !*str2));
1539 for (; n != 0 && *str1 && *str2; --n, ++str1, ++str2)
1543 return n == 0 || *str1 == *str2;
1552 if (str1 == 0 || str2 == 0)
1553 return ((!str1 || !*str1) && (!str2 || !*str2));
1556 if(*str1++ != *str2++)
1567 if (str1 == str2 || n == 0)
1570 if (str1 == 0 || str2 == 0)
1571 return ((!str1 || !*str1) && (!str2 || !*str2));
1573 for (; n != 0 && *str1 && *str2; --n, ++str1, ++str2)
1577 return n == 0 || *str1 == *str2;
1588 if (tohash == 0 || *tohash == 0)
1591 const XMLCh* curCh = tohash;
1595 hashVal = (hashVal * 38) + (hashVal >> 24) + (
XMLSize_t)(*curCh++);
1598 return hashVal % hashModulus;
1605 if (tohash == 0 || n == 0)
1608 const XMLCh* curCh = tohash;
1612 hashVal = (hashVal * 38) + (hashVal >> 24) + (
XMLSize_t)(*curCh++);
1615 return hashVal % hashModulus;
static char * replicate(const char *const toRep, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
Replicates a string NOTE: The returned buffer is allocated with the MemoryManager.
static XMLSize_t hashN(const XMLCh *const toHash, const XMLSize_t numChars, const XMLSize_t hashModulus)
Hashes a string given a modulus taking a maximum number of characters as the limit.
Definition: XMLString.hpp:1601
static void moveChars(XMLCh *const targetStr, const XMLCh *const srcStr, const XMLSize_t count)
Moves X number of chars.
Definition: XMLString.hpp:1442
static bool regionMatches(const XMLCh *const str1, const int offset1, const XMLCh *const str2, const int offset2, const XMLSize_t charCount)
Lexicographically compares str1 and str2 regions and returns true if they are equal, otherwise false.
Configurable memory manager.
Definition: MemoryManager.hpp:39
static XMLSize_t stringLen(const char *const src)
Get the length of the string.
SIZE_T XMLSize_t
Definition: Xerces_autoconf_config.borland.hpp:86
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
wchar_t XMLCh
Definition: Xerces_autoconf_config.borland.hpp:92
static int lastIndexOf(const char *const toSearch, const char ch)
Provides the index of the last occurrence of a character within a string.
static bool startsWithI(const char *const toTest, const char *const prefix)
Tells if the sub-string appears within a string at the beginning without regard to case...
#define XMLUTIL_EXPORT
Definition: XercesDefs.hpp:162
static bool equalsN(const XMLCh *str1, const XMLCh *str2, XMLSize_t n)
compares str1 and str2
Definition: XMLString.hpp:1529
static bool startsWith(const char *const toTest, const char *const prefix)
Tells if the sub-string appears within a string at the beginning.
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
virtual void * allocate(XMLSize_t size)=0
This method allocates requested memory.
Definition: TransService.hpp:387
Class for representing native character strings and handling common string operations.
Definition: XMLString.hpp:45
static XMLSize_t hash(const char *const toHash, const XMLSize_t hashModulus)
Hashes a string given a modulus.
static bool endsWith(const XMLCh *const toTest, const XMLCh *const suffix)
Tells if the sub-string appears within a string at the end.
Definition: XMLString.hpp:1487
static int compareNIString(const char *const str1, const char *const str2, const XMLSize_t count)
Lexicographically compares, at most, the first count characters in str1 and str2 without regard to ca...
static bool equals(const XMLCh *str1, const XMLCh *str2)
compares str1 and str2
Definition: XMLString.hpp:1512
static int compareNString(const char *const str1, const char *const str2, const XMLSize_t count)
Lexicographically compares, at most, the first count characters in str1 and str2 and returns a value ...