18 #if !defined(XALANDOMSTRING_HEADER_GUARD_1357924680) 19 #define XALANDOMSTRING_HEADER_GUARD_1357924680 41 XALAN_CPP_NAMESPACE_BEGIN
64 #if defined(XALAN_INLINE_INITIALIZATION) 65 static const size_type npos = ~0u;
74 const char* theString,
80 MemoryManager& theManager XALAN_DEFAULT_CONSTRUCTOR_MEMMGR,
81 size_type theStartPosition = 0,
86 const XalanDOMChar* theString,
87 MemoryManager& theManager XALAN_DEFAULT_MEMMGR,
93 MemoryManager& theManager XALAN_DEFAULT_MEMMGR);
96 clone(MemoryManager& theManager);
131 return m_data.begin();
139 return m_data.begin();
147 return m_data.empty() ==
true ? m_data.end() : m_data.end() - 1;
155 return m_data.empty() ==
true ? m_data.end() : m_data.end() - 1;
163 reverse_iterator i = m_data.rbegin();
165 if (m_data.empty() ==
false)
173 const_reverse_iterator
178 const_reverse_iterator i = m_data.rbegin();
180 if (m_data.empty() ==
false)
193 return m_data.rend();
196 const_reverse_iterator
201 return m_data.rend();
225 return ~size_type(0);
231 XalanDOMChar theChar);
238 resize(theCount, XalanDOMChar(0));
249 return theCapacity == 0 ? 0 :
size_type(theCapacity - 1);
257 m_data.reserve(theCount + 1);
265 m_data.erase(m_data.begin(), m_data.end());
277 m_data.erase(thePosition);
293 m_data.erase(theFirst, theLast);
295 m_size = m_data.size() - 1;
304 size_type theStartPosition = 0,
312 return m_size == 0 ? true :
false;
320 return m_data[theIndex];
328 return m_data[theIndex];
332 at(size_type theIndex)
const 336 return m_data.at(theIndex);
340 at(size_type theIndex)
344 return m_data.at(theIndex);
352 return m_data.empty() ==
true ? &s_empty : &m_data[0];
368 m_data.swap(theOther.m_data);
370 #if defined(XALAN_NO_STD_NAMESPACE) 371 ::swap(m_size, theOther.m_size);
411 const XalanDOMChar* theSource,
420 return append(theSource, theCount);
437 const char* theSource,
446 return append(theSource, theCount);
452 size_type thePosition,
460 if (&theSource !=
this)
462 m_data = theSource.m_data;
464 m_size = theSource.m_size;
475 XalanDOMChar theChar)
483 return append(theCount, theChar);
488 iterator theFirstPosition,
489 iterator theLastPosition);
500 size_type thePosition,
503 assert(thePosition < theSource.
length() &&
504 (theCount ==
size_type(npos) || thePosition + theCount <= theSource.
length()));
506 return append(theSource.
c_str() + thePosition, theCount);
511 const XalanDOMChar* theString,
522 const char* theString,
534 XalanDOMChar theChar);
548 size_type thePosition,
556 size_type thePosition1,
558 size_type thePosition2,
561 return insert(thePosition1, theString.
c_str() + thePosition2, theCount);
566 size_type thePosition,
567 const XalanDOMChar* theString,
572 size_type thePosition,
573 const XalanDOMChar* theString)
575 return insert(thePosition, theString,
length(theString));
580 size_type thePosition,
582 XalanDOMChar theChar);
586 iterator thePosition,
587 XalanDOMChar theChar);
591 iterator thePosition,
593 XalanDOMChar theChar);
597 iterator theInsertPosition,
598 iterator theFirstPosition,
599 iterator theLastPosition);
605 size_type thePosition = 0,
606 size_type theCount =
size_type(npos))
const 609 (thePosition + theCount <=
length()));
613 return theSubstring.
assign(
616 theCount == npos ?
length() : theCount);
629 size_type thePosition1,
640 size_type thePosition1,
643 size_type thePosition2,
644 size_type theCount2)
const 648 return compare(thePosition1, theCount1, theString.
c_str() + thePosition2, theCount2);
652 compare(
const XalanDOMChar* theString)
const;
656 size_type thePosition1,
658 const XalanDOMChar* theString,
659 size_type theCount2 =
size_type(npos))
const;
663 reset(MemoryManager& theManager,
const char* theString);
666 reset(MemoryManager& theManager,
const XalanDOMChar* theString);
693 transcode(CharVectorType& theResult)
const;
698 return m_data.getMemoryManager();
709 const XalanDOMChar* theString,
712 assert(theString != 0);
719 const XalanDOMChar* theLHS,
720 size_type theLHSLength,
721 const XalanDOMChar* theRHS,
722 size_type theRHSLength);
726 const XalanDOMChar* theLHS,
727 const XalanDOMChar* theRHS)
740 const XalanDOMChar* theRHS)
747 const XalanDOMChar* theLHS,
761 length(
const XalanDOMChar* theString);
771 length(
const char* theString);
784 assert((m_data.empty() ==
true && m_size == 0) || m_size == m_data.size() - 1);
785 assert(m_data.empty() ==
true || m_data.back() == 0);
799 return m_data.empty() ==
true ? m_data.end() : m_data.end() - 1;
807 return m_data.empty() ==
true ? m_data.end() : m_data.end() - 1;
815 return m_data.begin() + thePosition;
823 return m_data.begin() + thePosition;
826 #if defined (XALAN_DEVELOPMENT) 835 XalanDOMCharVectorType m_data;
839 static const XalanDOMChar s_empty;
853 operator() (argument_type theKey)
const 855 return theKey.hash();
870 operator() (argument_type theKey)
const 872 assert (theKey != 0);
874 return theKey->hash();
902 #if defined(XALAN_NO_STD_NAMESPACE) 909 operator() (first_argument_type theLHS,
910 second_argument_type theRHS)
const 925 #if defined(XALAN_NO_STD_NAMESPACE) 932 operator() (first_argument_type theLHS,
933 second_argument_type theRHS)
const 948 #if defined(XALAN_NO_STD_NAMESPACE) 955 operator() (first_argument_type theLHS,
956 second_argument_type theRHS)
const 958 return theLHS.compare(theRHS) < 0 ? true :
false;
973 operator() (first_argument_type theLHS,
974 second_argument_type theRHS)
const 976 assert(theLHS != 0 && theRHS != 0);
990 #if defined(XALAN_NO_STD_NAMESPACE) 997 operator() (first_argument_type theLHS,
998 second_argument_type theRHS)
const 1000 assert(theLHS != 0 && theRHS != 0);
1002 return theLHS->compare(*theRHS) < 0 ? true :
false;
1030 const XalanDOMChar* theRHS)
1039 const XalanDOMChar* theLHS,
1053 return !(theLHS == theRHS);
1060 const XalanDOMChar* theLHS,
1063 return !(theLHS == theRHS);
1071 const XalanDOMChar* theRHS)
1073 return !(theRHS == theLHS);
1086 return result += theRHS;
1094 const XalanDOMChar* theRHS,
1099 return result += theRHS;
1106 const XalanDOMChar* theLHS,
1112 return result += theRHS;
1169 const XalanDOMChar* theSourceString,
1171 CharVectorType& targetVector,
1172 bool terminate =
false);
1189 const XalanDOMChar* theSourceString,
1191 CharVectorType& targetVector,
1193 char theSubstitutionChar);
1203 #if !defined(XALAN_DEVELOPMENT) 1206 const char* theSourceString,
1226 const XalanDOMChar* theSourceString,
1227 CharVectorType& targetVector,
1228 bool terminate =
false);
1241 const XalanDOMChar* theSourceString,
1242 CharVectorType& targetVector,
1244 char theSubstitutionChar);
1254 #if !defined(XALAN_DEVELOPMENT) 1255 inline const CharVectorType
1258 CharVectorType theResult;
1279 CharVectorType& theTargetVector,
1280 bool terminate =
false)
1283 theSourceString.
c_str(),
1302 CharVectorType& theTargetVector,
1304 char theSubstitutionChar);
1316 #if !defined(XALAN_DEVELOPMENT) 1317 inline const CharVectorType
1320 CharVectorType theResult;
1340 const char* theSourceString,
1344 theResult.
assign(theSourceString, theSourceStringLength);
1364 const char* theSourceString,
1366 XalanDOMCharVectorType& theTargetVector,
1367 bool terminate =
false);
1381 const char* theSourceString,
1382 XalanDOMCharVectorType& theTargetVector,
1383 bool terminate =
false);
1399 const char* theSourceString,
1401 bool theSourceStringIsNullTerminated,
1402 XalanDOMCharVectorType& theTargetVector,
1403 bool terminate =
false);
1415 const CharVectorType& theSourceString,
1423 XALAN_CPP_NAMESPACE_END
1427 #endif // !defined(XALANDOMSTRING_HEADER_GUARD_1357924680) const_reference operator[](size_type theIndex) const
XalanDOMString & operator=(const char *theRHS)
static size_t hash(const XalanDOMChar *theString, size_type theLength)
Less than functor for DOMStrings.
XalanDOMString & operator+=(const XalanDOMString &theSource)
static MemoryManager & getDefaultXercesMemMgr()
void reserve(size_type theCount=0)
XalanDOMString & assign(XalanDOMString &theString, const XalanDOMString &theStringToAssign)
Assign one string to another.
const value_type * const_iterator
XalanDOMCharVectorType::iterator iterator
void erase(XalanDOMString &theString)
Remove all elements from target string.
XalanVector< XalanDOMChar > XalanDOMCharVectorType
XalanDOMString & operator+=(const XalanDOMChar *theString)
void swap(XalanDOMString &theOther)
XalanDOMString & insert(size_type thePosition, const XalanDOMChar *theString)
virtual ~TranscodingError()
XALAN_STD_QUALIFIER equal_to< XalanDOMString > Comparator
int compare(const XalanDOMString &theString) const
#define XALAN_DEFAULT_CONSTRUCTOR_MEMMGR
XalanDOMString & operator=(const XalanDOMChar *theRHS)
static bool equals(const XalanDOMChar *theLHS, const XalanDOMString &theRHS)
Less than functor for DOMStrings.
XalanDOMString & append(const XalanDOMChar *theString)
pointer_equal< XalanDOMString > Comparator
XalanDOMString & insert(size_type thePosition, const XalanDOMString &theString)
void resize(size_type theCount)
XalanDOMCharVectorType::const_reverse_iterator const_reverse_iterator
bool operator!=(const XalanDOMString &theLHS, const XalanDOMString &theRHS)
XalanVector< char > CharVectorType
iterator erase(iterator thePosition)
XalanVector< char > CharVectorType
compare(const CharVectorType &theLHS, const CharVectorType &theRHS)
Compare the contents of two strings.
size_type capacity() const
Equals functor for DOMStrings.
reverse_iterator rbegin()
XalanDOMString & append(XalanDOMString &theString, const XalanDOMString &theStringToAppend)
Concatenate two strings.
#define XALAN_DEFAULT_MEMMGR
XalanDOMString & operator=(const XalanDOMString &theRHS)
const XalanDOMChar * c_str() const
const XalanDOMChar & const_reference
Equal to functor for DOMStrings.
int compare(size_type thePosition1, size_type theCount1, const XalanDOMString &theString, size_type thePosition2, size_type theCount2) const
const_reference at(size_type theIndex) const
XalanDOMString & assign(const XalanDOMChar *theSource)
XalanDOMString & insert(size_type thePosition1, const XalanDOMString &theString, size_type thePosition2, size_type theCount)
const_iterator getIteratorForPosition(size_type thePosition) const
iterator getIteratorForPosition(size_type thePosition)
XalanDOMString & assign(size_type theCount, XalanDOMChar theChar)
iterator erase(iterator theFirst, iterator theLast)
void swap(XalanVector< Type > &theLHS, XalanVector< Type > &theRHS)
XalanVector< wchar_t > WideCharVectorType
const char * c_str(const CharVectorType &theString)
Get the underlying representation of the target CharVectorType as a null-terminated string...
XALAN_CPP_NAMESPACE_BEGIN typedef size_t size_type
const_iterator getBackInsertIterator() const
MemoryManager & getMemoryManager()
const_reverse_iterator rbegin() const
void push_back(XalanDOMChar theChar)
static bool equals(const XalanDOMChar *theLHS, size_type theLHSLength, const XalanDOMChar *theRHS, size_type theRHSLength)
static bool equals(const XalanDOMChar *theLHS, const XalanDOMChar *theRHS)
XalanDOMString & operator=(XalanDOMChar theRHS)
const_reverse_iterator_ const_reverse_iterator
const XalanDOMChar * data() const
Hash functor for DOMStrings.
reverse_iterator_ reverse_iterator
reference operator[](size_type theIndex)
iterator getBackInsertIterator()
size_type max_size() const
static bool equals(const XalanDOMString &theLHS, const XalanDOMChar *theRHS)
DOMStringHashFunction Hasher
#define XALAN_USES_MEMORY_MANAGER(Type)
XalanDOMString & assign(const XalanDOMString &theSource)
const_iterator end() const
Not equals functor for DOMStrings.
DOMStringPointerHashFunction Hasher
reference at(size_type theIndex)
const_iterator begin() const
TranscodeToLocalCodePage(const XalanDOMChar *theSourceString, XalanDOMString::size_type theSourceStringLength, CharVectorType &targetVector, bool terminate=false)
Convert a XalanDOMChar string to C++ standard library vector, transcoding to the default local code p...
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
XalanDOMString & append(const XalanDOMString &theSource)
bool operator==(const XalanDOMString &theLHS, const XalanDOMString &theRHS)
XalanDOMCharVectorType::reverse_iterator reverse_iterator
Hash functor for DOMStrings.
#define XALAN_DOM_EXPORT_FUNCTION(T)
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::const_iterator const_iterator
XalanDOMString & assign(const XalanDOMChar *theSource, size_type theCount)
XalanDOMString & substr(XalanDOMString &theSubstring, size_type thePosition=0, size_type theCount=size_type(npos)) const
int compare(size_type thePosition1, size_type theCount1, const XalanDOMString &theString) const
pointer_equal< XalanDOMString > Comparator
XalanDOMString & operator+=(XalanDOMChar theChar)
DOMStringPointerHashFunction Hasher
XalanDOMString & append(const XalanDOMString &theSource, size_type thePosition, size_type theCount)
equals(const XalanDOMChar *theLHS, const XalanDOMChar *theRHS, XalanDOMString::size_type theLength)
Compare the contents of two arrays for equality.
XalanVector< XalanDOMChar > XalanDOMCharVectorType
XalanDOMString & append(const char *theString)
const_reverse_iterator rend() const
XalanDOMString & assign(const char *theSource, size_type theCount)
XalanDOMString & insert(XalanDOMString &theString, XalanDOMString::size_type thePosition, const XalanDOMString &theStringToInsert)
Insert a string into another string.
XalanDOMString & assign(const char *theSource)