00001 /* 00002 * Copyright 1999-2004 The Apache Software Foundation. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 #if !defined(XALANDOMSTRING_HEADER_GUARD_1357924680) 00017 #define XALANDOMSTRING_HEADER_GUARD_1357924680 00018 00019 00020 00021 #include <xalanc/XalanDOM/XalanDOMDefinitions.hpp> 00022 00023 00024 00025 #include <cassert> 00026 00027 00028 00029 #include <xalanc/Include/XalanMemoryManagement.hpp> 00030 #include <xalanc/Include/XalanVector.hpp> 00031 00032 00033 00034 #include <xalanc/XalanDOM/XalanDOMException.hpp> 00035 00036 00037 00038 XALAN_CPP_NAMESPACE_BEGIN 00039 00040 00041 00042 class XALAN_DOM_EXPORT XalanDOMString 00043 { 00044 public: 00045 typedef XalanVector<XalanDOMChar> XalanDOMCharVectorType; 00046 typedef XalanVector<char> CharVectorType; 00047 typedef XalanVector<wchar_t> WideCharVectorType; 00048 00049 typedef XalanDOMChar value_type; 00050 typedef XalanDOMChar& reference; 00051 typedef const XalanDOMChar& const_reference; 00052 00053 typedef unsigned int size_type; 00054 00055 typedef XalanDOMCharVectorType::iterator iterator; 00056 typedef XalanDOMCharVectorType::const_iterator const_iterator; 00057 typedef XalanDOMCharVectorType::reverse_iterator reverse_iterator; 00058 typedef XalanDOMCharVectorType::const_reverse_iterator const_reverse_iterator; 00059 00060 #if defined(XALAN_INLINE_INITIALIZATION) 00061 static const size_type npos = ~0u; 00062 #else 00063 enum { npos = -1 }; 00064 #endif 00065 00066 XalanDOMString(MemoryManagerType& theManager XALAN_DEFAULT_CONSTRACTOR_MEMORY_MGR ); 00067 00068 explicit 00069 XalanDOMString( 00070 const char* theString, 00071 MemoryManagerType& theManager XALAN_DEFAULT_MEMMGR, 00072 size_type theCount = size_type(npos)); 00073 00074 XalanDOMString( 00075 const XalanDOMString& theSource, 00076 MemoryManagerType& theManager XALAN_DEFAULT_CONSTRACTOR_MEMORY_MGR, 00077 size_type theStartPosition = 0, 00078 size_type theCount = size_type(npos)); 00079 00080 explicit 00081 XalanDOMString( 00082 const XalanDOMChar* theString, 00083 MemoryManagerType& theManager XALAN_DEFAULT_MEMMGR, 00084 size_type theCount = size_type(npos)); 00085 00086 XalanDOMString( 00087 size_type theCount, 00088 XalanDOMChar theChar, 00089 MemoryManagerType& theManager XALAN_DEFAULT_MEMMGR); 00090 00091 XalanDOMString* 00092 clone(MemoryManagerType& theManager); 00093 00094 ~XalanDOMString() 00095 { 00096 } 00097 00098 XalanDOMString& 00099 operator=(const XalanDOMString& theRHS) 00100 { 00101 return assign(theRHS); 00102 } 00103 00104 XalanDOMString& 00105 operator=(const XalanDOMChar* theRHS) 00106 { 00107 return assign(theRHS); 00108 } 00109 00110 XalanDOMString& 00111 operator=(const char* theRHS) 00112 { 00113 return assign(theRHS); 00114 } 00115 00116 XalanDOMString& 00117 operator=(XalanDOMChar theRHS) 00118 { 00119 return assign(1, theRHS); 00120 } 00121 00122 iterator 00123 begin() 00124 { 00125 invariants(); 00126 00127 return m_data.begin(); 00128 } 00129 00130 const_iterator 00131 begin() const 00132 { 00133 invariants(); 00134 00135 return m_data.begin(); 00136 } 00137 00138 iterator 00139 end() 00140 { 00141 invariants(); 00142 00143 return m_data.empty() == true ? m_data.end() : m_data.end() - 1; 00144 } 00145 00146 const_iterator 00147 end() const 00148 { 00149 invariants(); 00150 00151 return m_data.empty() == true ? m_data.end() : m_data.end() - 1; 00152 } 00153 00154 reverse_iterator 00155 rbegin() 00156 { 00157 invariants(); 00158 00159 reverse_iterator i = m_data.rbegin(); 00160 00161 if (m_data.empty() == false) 00162 { 00163 ++i; 00164 } 00165 00166 return i; 00167 } 00168 00169 const_reverse_iterator 00170 rbegin() const 00171 { 00172 invariants(); 00173 00174 const_reverse_iterator i = m_data.rbegin(); 00175 00176 if (m_data.empty() == false) 00177 { 00178 ++i; 00179 } 00180 00181 return i; 00182 } 00183 00184 reverse_iterator 00185 rend() 00186 { 00187 invariants(); 00188 00189 return m_data.rend(); 00190 } 00191 00192 const_reverse_iterator 00193 rend() const 00194 { 00195 invariants(); 00196 00197 return m_data.rend(); 00198 } 00199 00200 size_type 00201 size() const 00202 { 00203 invariants(); 00204 00205 return m_size; 00206 } 00207 00208 size_type 00209 length() const 00210 { 00211 invariants(); 00212 00213 return size(); 00214 } 00215 00216 size_type 00217 max_size() const 00218 { 00219 invariants(); 00220 00221 return ~size_type(0); 00222 } 00223 00224 void 00225 resize( 00226 size_type theCount, 00227 XalanDOMChar theChar); 00228 00229 void 00230 resize(size_type theCount) 00231 { 00232 invariants(); 00233 00234 resize(theCount, XalanDOMChar(0)); 00235 } 00236 00237 size_type 00238 capacity() const 00239 { 00240 invariants(); 00241 00242 const XalanDOMCharVectorType::size_type theCapacity = 00243 m_data.capacity(); 00244 00245 return theCapacity == 0 ? 0 : size_type(theCapacity - 1); 00246 } 00247 00248 void 00249 reserve(size_type theCount = 0) 00250 { 00251 invariants(); 00252 00253 m_data.reserve(theCount + 1); 00254 } 00255 00256 void 00257 clear() 00258 { 00259 invariants(); 00260 00261 m_data.erase(m_data.begin(), m_data.end()); 00262 00263 m_size = 0; 00264 00265 invariants(); 00266 } 00267 00268 void 00269 erase( 00270 size_type theStartPosition = 0, 00271 size_type theCount = size_type(npos)); 00272 00273 bool 00274 empty() const 00275 { 00276 invariants(); 00277 00278 return m_size == 0 ? true : false; 00279 } 00280 00281 const_reference 00282 operator[](size_type theIndex) const 00283 { 00284 invariants(); 00285 00286 return m_data[theIndex]; 00287 } 00288 00289 reference 00290 operator[](size_type theIndex) 00291 { 00292 invariants(); 00293 00294 return m_data[theIndex]; 00295 } 00296 00297 const_reference 00298 at(size_type theIndex) const 00299 { 00300 invariants(); 00301 00302 return m_data.at(theIndex); 00303 } 00304 00305 reference 00306 at(size_type theIndex) 00307 { 00308 invariants(); 00309 00310 return m_data.at(theIndex); 00311 } 00312 00313 const XalanDOMChar* 00314 c_str() const 00315 { 00316 invariants(); 00317 00318 return m_data.empty() == true ? &s_empty : &m_data[0]; 00319 } 00320 00321 const XalanDOMChar* 00322 data() const 00323 { 00324 invariants(); 00325 00326 return c_str(); 00327 } 00328 00329 void 00330 swap(XalanDOMString& theOther) 00331 { 00332 invariants(); 00333 00334 m_data.swap(theOther.m_data); 00335 00336 #if defined(XALAN_NO_STD_NAMESPACE) 00337 ::swap(m_size, theOther.m_size); 00338 #else 00339 std::swap(m_size, theOther.m_size); 00340 #endif 00341 } 00342 00343 XalanDOMString& 00344 operator+=(const XalanDOMString& theSource) 00345 { 00346 return append(theSource); 00347 } 00348 00349 XalanDOMString& 00350 operator+=(const XalanDOMChar* theString) 00351 { 00352 return append(theString); 00353 } 00354 00355 XalanDOMString& 00356 operator+=(XalanDOMChar theChar) 00357 { 00358 append(1, theChar); 00359 00360 return *this; 00361 } 00362 00363 XalanDOMString& 00364 assign(const XalanDOMChar* theSource) 00365 { 00366 invariants(); 00367 00368 erase(); 00369 00370 invariants(); 00371 00372 return append(theSource); 00373 } 00374 00375 XalanDOMString& 00376 assign( 00377 const XalanDOMChar* theSource, 00378 size_type theCount) 00379 { 00380 invariants(); 00381 00382 erase(); 00383 00384 invariants(); 00385 00386 return append(theSource, theCount); 00387 } 00388 00389 XalanDOMString& 00390 assign(const char* theSource) 00391 { 00392 invariants(); 00393 00394 erase(); 00395 00396 invariants(); 00397 00398 return append(theSource); 00399 } 00400 00401 XalanDOMString& 00402 assign( 00403 const char* theSource, 00404 size_type theCount) 00405 { 00406 invariants(); 00407 00408 erase(); 00409 00410 invariants(); 00411 00412 return append(theSource, theCount); 00413 } 00414 00415 XalanDOMString& 00416 assign( 00417 const XalanDOMString& theSource, 00418 size_type thePosition, 00419 size_type theCount); 00420 00421 XalanDOMString& 00422 assign(const XalanDOMString& theSource) 00423 { 00424 invariants(); 00425 00426 if (&theSource != this) 00427 { 00428 m_data = theSource.m_data; 00429 00430 m_size = theSource.m_size; 00431 } 00432 00433 invariants(); 00434 00435 return *this; 00436 } 00437 00438 XalanDOMString& 00439 assign( 00440 size_type theCount, 00441 XalanDOMChar theChar) 00442 { 00443 invariants(); 00444 00445 erase(); 00446 00447 invariants(); 00448 00449 return append(theCount, theChar); 00450 } 00451 00452 XalanDOMString& 00453 assign( 00454 iterator theFirstPosition, 00455 iterator theLastPosition); 00456 00457 XalanDOMString& 00458 append(const XalanDOMString& theSource) 00459 { 00460 return append(theSource.c_str(), theSource.length()); 00461 } 00462 00463 XalanDOMString& 00464 append( 00465 const XalanDOMString& theSource, 00466 size_type thePosition, 00467 size_type theCount) 00468 { 00469 assert(thePosition < theSource.length() && 00470 (theCount == size_type(npos) || thePosition + theCount <= theSource.length())); 00471 00472 return append(theSource.c_str() + thePosition, theCount); 00473 } 00474 00475 XalanDOMString& 00476 append( 00477 const XalanDOMChar* theString, 00478 size_type theCount); 00479 00480 XalanDOMString& 00481 append(const XalanDOMChar* theString) 00482 { 00483 return append(theString, length(theString)); 00484 } 00485 00486 XalanDOMString& 00487 append( 00488 const char* theString, 00489 size_type theCount); 00490 00491 XalanDOMString& 00492 append(const char* theString) 00493 { 00494 return append(theString, length(theString)); 00495 } 00496 00497 XalanDOMString& 00498 append( 00499 size_type theCount, 00500 XalanDOMChar theChar); 00501 00502 void 00503 push_back(XalanDOMChar theChar) 00504 { 00505 invariants(); 00506 00507 append(1, theChar); 00508 00509 invariants(); 00510 } 00511 00512 XalanDOMString& 00513 insert( 00514 size_type thePosition, 00515 const XalanDOMString& theString) 00516 { 00517 return insert(thePosition, theString.c_str(), theString.length()); 00518 } 00519 00520 XalanDOMString& 00521 insert( 00522 size_type thePosition1, 00523 const XalanDOMString& theString, 00524 size_type thePosition2, 00525 size_type theCount) 00526 { 00527 return insert(thePosition1, theString.c_str() + thePosition2, theCount); 00528 } 00529 00530 XalanDOMString& 00531 insert( 00532 size_type thePosition, 00533 const XalanDOMChar* theString, 00534 size_type theCount); 00535 00536 XalanDOMString& 00537 insert( 00538 size_type thePosition, 00539 const XalanDOMChar* theString) 00540 { 00541 return insert(thePosition, theString, length(theString)); 00542 } 00543 00544 XalanDOMString& 00545 insert( 00546 size_type thePosition, 00547 size_type theCount, 00548 XalanDOMChar theChar); 00549 00550 iterator 00551 insert( 00552 iterator thePosition, 00553 XalanDOMChar theChar); 00554 00555 void 00556 insert( 00557 iterator thePosition, 00558 size_type theCount, 00559 XalanDOMChar theChar); 00560 00561 void 00562 insert( 00563 iterator theInsertPosition, 00564 iterator theFirstPosition, 00565 iterator theLastPosition); 00566 00567 00568 XalanDOMString& 00569 substr( 00570 XalanDOMString& theSubstring, 00571 size_type thePosition = 0, 00572 size_type theCount = size_type(npos)) const 00573 { 00574 assert(theCount == size_type(npos) && thePosition < length() || 00575 thePosition + theCount <= length()); 00576 00577 invariants(); 00578 00579 return theSubstring.assign(*this, thePosition, theCount); 00580 } 00581 00582 int 00583 compare(const XalanDOMString& theString) const 00584 { 00585 invariants(); 00586 00587 return compare(theString.c_str()); 00588 } 00589 00590 int 00591 compare( 00592 size_type thePosition1, 00593 size_type theCount1, 00594 const XalanDOMString& theString) const 00595 { 00596 invariants(); 00597 00598 return compare(thePosition1, theCount1, theString.c_str(), theString.length()); 00599 } 00600 00601 int 00602 compare( 00603 size_type thePosition1, 00604 size_type theCount1, 00605 const XalanDOMString& theString, 00606 size_type thePosition2, 00607 size_type theCount2) const 00608 { 00609 invariants(); 00610 00611 return compare(thePosition1, theCount1, theString.c_str() + thePosition2, theCount2); 00612 } 00613 00614 int 00615 compare(const XalanDOMChar* theString) const; 00616 00617 int 00618 compare( 00619 size_type thePosition1, 00620 size_type theCount1, 00621 const XalanDOMChar* theString, 00622 size_type theCount2 = size_type(npos)) const; 00623 00624 00625 void 00626 reset(MemoryManagerType& theManager, const char* theString); 00627 00628 void 00629 reset(MemoryManagerType& theManager, const XalanDOMChar* theString); 00630 00631 class TranscodingError : public XalanDOMException 00632 { 00633 public: 00634 00635 TranscodingError() : 00636 XalanDOMException(TRANSCODING_ERR) 00637 { 00638 } 00639 00640 virtual 00641 ~TranscodingError() 00642 { 00643 } 00644 }; 00645 00646 00647 00655 void 00656 transcode(CharVectorType& theResult) const; 00657 00658 MemoryManagerType& 00659 getMemoryManager() 00660 { 00661 return m_data.getMemoryManager(); 00662 } 00663 00664 size_type 00665 hash() const 00666 { 00667 return hash(c_str(), size()); 00668 } 00669 00670 static bool 00671 equals( 00672 const XalanDOMChar* theLHS, 00673 size_type theLHSLength, 00674 const XalanDOMChar* theRHS, 00675 size_type theRHSLength); 00676 00677 static bool 00678 equals( 00679 const XalanDOMChar* theLHS, 00680 const XalanDOMChar* theRHS) 00681 { 00682 return equals(theLHS, length(theLHS), theRHS, length(theRHS)); 00683 } 00684 00685 static bool 00686 equals( 00687 const XalanDOMString& theLHS, 00688 const XalanDOMString& theRHS); 00689 00690 static bool 00691 equals( 00692 const XalanDOMString& theLHS, 00693 const XalanDOMChar* theRHS) 00694 { 00695 return equals(theLHS.c_str(), theRHS); 00696 } 00697 00698 static bool 00699 equals( 00700 const XalanDOMChar* theLHS, 00701 const XalanDOMString& theRHS) 00702 { 00703 return equals(theLHS, theRHS.c_str()); 00704 } 00705 00706 /* 00707 * Helper function to determine the length of a null- 00708 * terminated string. 00709 * 00710 * @theString The string 00711 * @return the length 00712 */ 00713 static size_type 00714 length(const XalanDOMChar* theString); 00715 00716 /* 00717 * Helper function to determine the length of a null- 00718 * terminated string. 00719 * 00720 * @theString The string 00721 * @return the length 00722 */ 00723 static size_type 00724 length(const char* theString); 00725 00726 static size_type 00727 hash( 00728 const XalanDOMChar* theString, 00729 size_type theLength); 00730 00731 protected: 00732 00733 /* 00734 * Function to assert invariant conditions for the class. 00735 * 00736 * @return the iterator 00737 */ 00738 void 00739 invariants() const 00740 { 00741 #if !defined(NDEBUG) 00742 assert((m_data.empty() == true && m_size == 0) || m_size == m_data.size() - 1); 00743 assert(m_data.empty() == true || m_data.back() == 0); 00744 #endif 00745 } 00746 00747 /* 00748 * Get an iterator to the position of the terminating null. 00749 * 00750 * @return the iterator 00751 */ 00752 iterator 00753 getBackInsertIterator() 00754 { 00755 invariants(); 00756 00757 return m_data.empty() == true ? m_data.end() : m_data.end() - 1; 00758 } 00759 00760 const_iterator 00761 getBackInsertIterator() const 00762 { 00763 invariants(); 00764 00765 return m_data.empty() == true ? m_data.end() : m_data.end() - 1; 00766 } 00767 00768 iterator 00769 getIteratorForPosition(size_type thePosition) 00770 { 00771 invariants(); 00772 00773 return m_data.begin() + thePosition; 00774 } 00775 00776 const_iterator 00777 getIteratorForPosition(size_type thePosition) const 00778 { 00779 invariants(); 00780 00781 return m_data.begin() + thePosition; 00782 } 00783 00784 #if defined (XALAN_DEVELOPMENT) 00785 // not defined 00786 XalanDOMString(); 00787 XalanDOMString(const XalanDOMString&); 00788 #endif 00789 00790 private: 00791 00792 00793 XalanDOMCharVectorType m_data; 00794 00795 size_type m_size; 00796 00797 static const XalanDOMChar s_empty; 00798 }; 00799 00800 00801 00802 inline bool 00803 operator==( 00804 const XalanDOMString& theLHS, 00805 const XalanDOMString& theRHS) 00806 { 00807 return XalanDOMString::equals(theLHS, theRHS); 00808 } 00809 00810 00811 00812 inline bool 00813 operator==( 00814 const XalanDOMString& theLHS, 00815 const XalanDOMChar* theRHS) 00816 { 00817 return XalanDOMString::equals(theLHS, theRHS); 00818 } 00819 00820 00821 00822 inline bool 00823 operator==( 00824 const XalanDOMChar* theLHS, 00825 const XalanDOMString& theRHS) 00826 { 00827 // Note reversing of operands... 00828 return XalanDOMString::equals(theLHS, theRHS); 00829 } 00830 00831 00832 00833 inline bool 00834 operator!=( 00835 const XalanDOMString& theLHS, 00836 const XalanDOMString& theRHS) 00837 { 00838 return !(theLHS == theRHS); 00839 } 00840 00841 00842 00843 inline bool 00844 operator!=( 00845 const XalanDOMChar* theLHS, 00846 const XalanDOMString& theRHS) 00847 { 00848 return !(theLHS == theRHS); 00849 } 00850 00851 00852 00853 inline bool 00854 operator!=( 00855 const XalanDOMString& theLHS, 00856 const XalanDOMChar* theRHS) 00857 { 00858 return !(theRHS == theLHS); 00859 } 00860 00861 00862 00863 inline XalanDOMString& 00864 add( 00865 const XalanDOMString& theLHS, 00866 const XalanDOMString& theRHS, 00867 XalanDOMString& result) 00868 { 00869 result.assign(theLHS); 00870 00871 return result += theRHS; 00872 } 00873 00874 00875 00876 inline XalanDOMString& 00877 add( 00878 const XalanDOMString& theLHS, 00879 const XalanDOMChar* theRHS, 00880 XalanDOMString& result) 00881 { 00882 result.assign(theLHS); 00883 00884 return result += theRHS; 00885 } 00886 00887 00888 00889 inline XalanDOMString& 00890 add( 00891 const XalanDOMChar* theLHS, 00892 const XalanDOMString& theRHS, 00893 XalanDOMString& result) 00894 { 00895 result.assign(theLHS); 00896 00897 return result += theRHS; 00898 } 00899 00900 00901 00902 inline const XalanDOMString& 00903 add( 00904 const char* theLHS, 00905 const XalanDOMString& theRHS, 00906 XalanDOMString& result) 00907 { 00908 result.assign(theLHS); 00909 00910 result.append(theRHS); 00911 00912 return result; 00913 } 00914 00915 00916 00917 inline const XalanDOMString& 00918 add( 00919 const XalanDOMString& theLHS, 00920 const char* theRHS, 00921 XalanDOMString& result) 00922 { 00923 result.assign(theLHS); 00924 00925 result.append(theRHS); 00926 00927 return result; 00928 } 00929 00930 00931 00932 // Standard vector of XalanDOMChars and chars 00933 typedef XalanVector<XalanDOMChar> XalanDOMCharVectorType; 00934 00935 typedef XalanVector<char> CharVectorType; 00936 00937 00938 00939 00940 00952 XALAN_DOM_EXPORT_FUNCTION(bool) 00953 TranscodeToLocalCodePage( 00954 const XalanDOMChar* theSourceString, 00955 XalanDOMString::size_type theSourceStringLength, 00956 CharVectorType& targetVector, 00957 bool terminate = false); 00958 00972 XALAN_DOM_EXPORT_FUNCTION(void) 00973 TranscodeToLocalCodePage( 00974 const XalanDOMChar* theSourceString, 00975 XalanDOMString::size_type theSourceStringLength, 00976 CharVectorType& targetVector, 00977 bool terminate, 00978 char theSubstitutionChar); 00979 00988 #if !defined(XALAN_DEVELOPMENT) 00989 inline const XalanDOMString 00990 TranscodeFromLocalCodePage( 00991 const char* theSourceString, 00992 XalanDOMString::size_type theSourceStringLength = XalanDOMString::npos) 00993 { 00994 return XalanDOMString(theSourceString,XalanMemMgrs::getDefaultXercesMemMgr(), theSourceStringLength); 00995 } 00996 #endif 00997 00998 01009 XALAN_DOM_EXPORT_FUNCTION(bool) 01010 TranscodeToLocalCodePage( 01011 const XalanDOMChar* theSourceString, 01012 CharVectorType& targetVector, 01013 bool terminate = false); 01014 01024 XALAN_DOM_EXPORT_FUNCTION(void) 01025 TranscodeToLocalCodePage( 01026 const XalanDOMChar* theSourceString, 01027 CharVectorType& targetVector, 01028 bool terminate, 01029 char theSubstitutionChar); 01030 01039 #if !defined(XALAN_DEVELOPMENT) 01040 inline const CharVectorType 01041 TranscodeToLocalCodePage(const XalanDOMChar* theSourceString) 01042 { 01043 CharVectorType theResult; 01044 01045 TranscodeToLocalCodePage(theSourceString, theResult, true, '?'); 01046 01047 return theResult; 01048 } 01049 #endif 01050 01051 01061 inline bool 01062 TranscodeToLocalCodePage( 01063 const XalanDOMString& theSourceString, 01064 CharVectorType& targetVector, 01065 bool terminate = false) 01066 { 01067 return TranscodeToLocalCodePage(theSourceString.c_str(), targetVector, terminate); 01068 } 01069 01080 inline void 01081 TranscodeToLocalCodePage( 01082 const XalanDOMString& theSourceString, 01083 CharVectorType& targetVector, 01084 bool terminate , 01085 char theSubstitutionChar) 01086 { 01087 TranscodeToLocalCodePage(theSourceString.c_str(), targetVector, terminate, theSubstitutionChar); 01088 } 01089 01098 #if !defined(XALAN_DEVELOPMENT) 01099 inline const CharVectorType 01100 TranscodeToLocalCodePage(const XalanDOMString& theSourceString) 01101 { 01102 CharVectorType theResult; 01103 01104 TranscodeToLocalCodePage(theSourceString.c_str(), theResult, true, '?'); 01105 01106 return theResult; 01107 } 01108 #endif 01109 01110 01119 inline const XalanDOMString& 01120 TranscodeFromLocalCodePage( 01121 const char* theSourceString, 01122 XalanDOMString& result, 01123 XalanDOMString::size_type theSourceStringLength = XalanDOMString::npos) 01124 { 01125 result.assign(theSourceString, theSourceStringLength); 01126 01127 return result; 01128 } 01129 01130 01131 01143 XALAN_DOM_EXPORT_FUNCTION(bool) 01144 TranscodeFromLocalCodePage( 01145 const char* theSourceString, 01146 XalanDOMString::size_type theSourceStringLength, 01147 XalanDOMCharVectorType& theTargetVector, 01148 bool terminate = false); 01149 01160 XALAN_DOM_EXPORT_FUNCTION(bool) 01161 TranscodeFromLocalCodePage( 01162 const char* theSourceString, 01163 XalanDOMCharVectorType& theTargetVector, 01164 bool terminate = false); 01165 01173 XALAN_DOM_EXPORT_FUNCTION(const XalanDOMString&) 01174 TranscodeFromLocalCodePage(const CharVectorType& theSourceString, 01175 XalanDOMString& result); 01176 01177 01178 XALAN_USES_MEMORY_MANAGER(XalanDOMString) 01179 01180 01181 01182 XALAN_CPP_NAMESPACE_END 01183 01184 01185 01186 #endif // !defined(XALANDOMSTRING_HEADER_GUARD_1357924680)
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.10 |
|