Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


DOMStringHelper.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #if !defined(DOMSTRINGHELPER_HEADER_GUARD_1357924680)
19 #define DOMSTRINGHELPER_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base include file. Must be first.
25 
26 
27 
28 #include <algorithm>
29 #include <cassert>
30 #include <functional>
31 #if defined(XALAN_CLASSIC_IOSTREAMS)
32 class ostream;
33 #else
34 #include <iosfwd>
35 #endif
36 
37 
38 
43 
44 
45 
47 
48 
49 
53 
54 
55 
56 XALAN_CPP_NAMESPACE_BEGIN
57 
58 
59 
60 XALAN_USING_XERCES(MemoryManager)
61 
62 
63 
64 class XalanOutputStream;
65 
66 
67 
68 template<class InputIteratorType, class OutputIteratorType>
69 inline OutputIteratorType
71  InputIteratorType begin,
72  InputIteratorType end,
73  OutputIteratorType iterator)
74 {
75  return XALAN_STD_QUALIFIER copy(begin, end, iterator);
76 }
77 
78 
79 
80 template<class InputIteratorType, class OutputIteratorType, class UnaryFunction>
81 inline OutputIteratorType
83  InputIteratorType begin,
84  InputIteratorType end,
85  OutputIteratorType iterator,
86  UnaryFunction function)
87 {
88  return XALAN_STD_QUALIFIER transform(begin, end, iterator);
89 }
90 
91 
92 
93 /**
94  * Get the underlying representation of the target XalanDOMString as a
95  * null-terminated string
96  *
97  * @deprecated This function is deprecated.
98  *
99  * @param theString target string
100  * @return null-terminated string of XalanDOMChar
101  */
102 inline const XalanDOMChar*
103 c_wstr(const XalanDOMString& theString)
104 {
105  return theString.c_str();
106 }
107 
108 
109 
110 /**
111  * Get the underlying representation of the target CharVectorType as a
112  * null-terminated string
113  *
114  * @param theString target string
115  * @return null-terminated string of chars
116  */
117 inline const char*
118 c_str(const CharVectorType& theString)
119 {
120  if (theString.empty() == true)
121  {
122  return 0;
123  }
124  else
125  {
126  const char* const ptr = &theString[0];
127 
128  assert(ptr[theString.size() - 1] == '\0');
129 
130  return ptr;
131  }
132 }
133 
134 
135 
136 /**
137  * Get the underlying representation of the wide string as a
138  * UNICODE null-terminated string. This is here simply for
139  * consistency in the code. On certain platforms, compiler-
140  * generated wide strings will not contain Unicode code
141  * points. Another macro converts those into XalanDOMStrings,
142  * which are then transcoded. In these cases, the previous
143  * defined c_sstr() function gets called.
144  *
145  * On platforms where the compiler does generate Unicode wide
146  * strings, this function will be called instead.
147  *
148  * @deprecated This function is deprecated.
149  *
150  * @param theString target string
151  * @return null-terminated string of XalanDOMChar
152  */
153 inline const XalanDOMChar*
154 c_wstr(const XalanDOMChar* theString)
155 {
156  return theString;
157 }
158 
159 
160 
161 /**
162  * Get the underlying representation of the target XalanDOMString as an array of
163  * XalanDOMChar, not guaranteed to be null-terminated.
164  *
165  * @deprecated This function is deprecated.
166  *
167  * @param theString target string
168  * @return array of XalanDOMChar
169  */
170 inline const XalanDOMChar*
171 toCharArray(const XalanDOMString& theString)
172 {
173  return theString.c_str();
174 }
175 
176 
177 
178 /**
179  * Get the underlying representation of a XalanDOMChar.
180  *
181  * @deprecated This function is deprecated.
182  *
183  * @param theString target string
184  * @return array of XalanDOMChar
185  */
186 inline const XalanDOMChar*
187 toCharArray(const XalanDOMChar* theString)
188 {
189  return theString;
190 }
191 
192 
193 
194 /**
195  * Get the underlying representation of the target CharVectorType as a
196  * pointer to an array of characters
197  *
198  * @deprecated This function is deprecated.
199  *
200  * @param theString target string
201  * @return the pointer
202  */
203 inline const char*
204 toCharArray(const CharVectorType& theString)
205 {
206  return theString.empty() == true ? 0 : &theString[0];
207 }
208 
209 
210 
211 /**
212  * Reserve some space in the string for more efficient
213  * concatenation...
214  *
215  * @deprecated This function is deprecated.
216  *
217  * @param theString target string
218  * @param theCount The amount of space to reserve
219  */
220 inline void
222  XalanDOMString& theString,
223  XalanDOMString::size_type theCount)
224 {
225  theString.reserve(theCount);
226 }
227 
228 
229 
230 /**
231  * Get the length of a XalanDOMString
232  *
233  * @deprecated This function is deprecated.
234  *
235  * @param theString target string
236  * @return the length of the target string
237  */
239 length(const XalanDOMString& theString)
240 {
241  return theString.length();
242 }
243 
244 
245 
246 /**
247  * Get the length of a null-terminated string of
248  * XalanDOMChar characters
249  *
250  * @param theString target string
251  * @return the length of the target string
252  */
254 length(const XalanDOMChar* theString)
255 {
256  assert(theString != 0);
257 
258  const XalanDOMChar* theBufferPointer = theString;
259 
260  while(*theBufferPointer != 0)
261  {
262  theBufferPointer++;
263  }
264 
265  return XalanDOMString::size_type(theBufferPointer - theString);
266 }
267 
268 
269 
270 /**
271  * Get the length of a null-terminated string.
272  *
273  * @param theString target string
274  * @return the length of the target string
275  */
277 length(const char* theString)
278 {
279  assert(theString != 0);
280 
281  return XalanDOMString::length(theString);
282 }
283 
284 
285 
286 /**
287  * Determines if the target string contains any elements
288  *
289  * @deprecated This function is deprecated.
290  *
291  * @param str target string
292  * @return true if the target string has a non-zero length
293  */
294 inline bool
296 {
297  return str.empty();
298 }
299 
300 
301 
302 /**
303  * Simulates the java String method indexOf().
304  *
305  * @param theString string to search
306  * @param theChar character searched for
307  * @return the index of theChar in theString,
308  * or length(theString) if the character is not
309  * found.
310  */
313  const XalanDOMChar* theString,
314  XalanDOMChar theChar)
315 {
316  assert(theString != 0);
317 
318  const XalanDOMChar* thePointer = theString;
319 
320  while(*thePointer != theChar && *thePointer != 0)
321  {
322  ++thePointer;
323  }
324 
325  return XalanDOMString::size_type(thePointer - theString);
326 }
327 
328 
329 
330 /**
331  * Simulates the java String method indexOf().
332  *
333  * @param theString string to search
334  * @param theStringLength the length of theString
335  * @param theChar character searched for
336  * @return the index of theChar in theString,
337  * or length(theString) if the character is not
338  * found.
339  */
342  const XalanDOMChar* theString,
343  XalanDOMString::size_type theStringLength,
344  XalanDOMChar theChar)
345 {
346  assert(theString != 0);
347 
348  const XalanDOMChar* thePointer = theString;
349  const XalanDOMChar* const theEndPointer = theString + theStringLength;
350 
351  while(*thePointer != theChar && thePointer != theEndPointer)
352  {
353  ++thePointer;
354  }
355 
356  return XalanDOMString::size_type(thePointer - theString);
357 }
358 
359 
360 
361 /**
362  * Simulates the java String method indexOf().
363  *
364  * @param theString string to search
365  * @param theChar character searched for
366  * @return the index of theChar in theString,
367  * or length(theString) if the character is not
368  * found.
369  */
372  const XalanDOMString& theString,
373  XalanDOMChar theChar)
374 {
375  return theString.length() == 0 ? 0 : indexOf(theString.c_str(), theChar);
376 }
377 
378 
379 
380 /**
381  * Simulates the java String method indexOf().
382  *
383  * @param theString string to search
384  * @param theStringLength length of the string to search
385  * @param theSubstring substring searched for
386  * @param theSubstringLength length of the substring searched for
387  * @return the index of theSubstring in theString,
388  * or length(theString) if the string is not
389  * found.
390  */
392 indexOf(
393  const XalanDOMChar* theString,
394  XalanDOMString::size_type theStringLength,
395  const XalanDOMChar* theSubstring,
396  XalanDOMString::size_type theSubstringLength);
397 
398 
399 
400 /**
401  * Simulates the java String method indexOf().
402  *
403  * @param theString string to search
404  * @param theSubstring substring searched for
405  * @return the index of theSubstring in theString,
406  * or length(theString) if the string is not
407  * found.
408  */
411  const XalanDOMChar* theString,
412  const XalanDOMChar* theSubstring)
413 {
414  assert(theString != 0 && theSubstring != 0);
415 
416  return indexOf(theString, length(theString), theSubstring, length(theSubstring));
417 }
418 
419 
420 
421 /**
422  * Simulates the java String method indexOf().
423  *
424  * @param theString string to search
425  * @param theSubstring substring searched for
426  * @return the index of theSubstring in theString,
427  * or length(theString) if the string is not
428  * found.
429  */
431 indexOf(
432  const XalanDOMString& theString,
433  const XalanDOMString& theSubstring);
434 
435 
436 
437 /**
438  * Simulates the java String method lastIndexOf().
439  *
440  * @param theString string to search
441  * @param theChar character searched for
442  * @return the index of theChar in theString,
443  * or length(theString) if the character is not
444  * found.
445  */
446 
449  const XalanDOMChar* theString,
450  XalanDOMChar theChar);
451 
452 
453 
454 /**
455  * Simulates the java String method lastIndexOf().
456  *
457  * @param theString string to search
458  * @param theChar character searched for
459  * @return the index of theChar in theString,
460  * or length(theString) if the character is not
461  * found.
462  */
465  const XalanDOMString& theString,
466  XalanDOMChar theChar)
467 {
468  return lastIndexOf(theString.c_str(), theChar);
469 }
470 
471 
472 
473 /**
474  * Simulates the java String method startsWith().
475  *
476  * @param theString target string to search
477  * @param theStringLength the length of theString
478  * @param theSubstring substring searched for
479  * @param theSubstringLength the length of theSubstring
480  * @return true if the target string begins with the substring
481  */
483 startsWith(
484  const XalanDOMChar* theString,
485  XalanDOMString::size_type theStringLength,
486  const XalanDOMChar* theSubstring,
487  XalanDOMString::size_type theSubstringLength);
488 
489 
490 
491 /**
492  * Simulates the java String method startsWith().
493  *
494  * @param theDOMString target string to search
495  * @param theSubstring substring searched for
496  * @return true if the target string begins with the substring
497  */
498 inline bool
500  const XalanDOMChar* theString,
501  const XalanDOMChar* theSubstring)
502 {
503  assert(theString != 0 && theSubstring != 0);
504 
505  return startsWith(theString, length(theString), theSubstring, length(theSubstring));
506 }
507 
508 
509 
510 /**
511  * Simulates the java String method startsWith().
512  *
513  * @param theDOMString target string to search
514  * @param theSubstring substring searched for
515  * @return true if the target string begins with the substring
516  */
517 inline bool
519  const XalanDOMChar* theString,
520  const XalanDOMString& theSubstring)
521 {
522  assert(theString != 0);
523 
524  return startsWith(
525  theString,
526  length(theString),
527  theSubstring.c_str(),
528  theSubstring.length());
529 }
530 
531 
532 
533 /**
534  * Simulates the java String method startsWith().
535  *
536  * @param theDOMString target string to search
537  * @param theSubstring substring searched for
538  * @return true if the target string begins with the substring
539  */
540 inline bool
542  const XalanDOMString& theString,
543  const XalanDOMChar* theSubstring)
544 {
545  assert(theSubstring != 0);
546 
547  return startsWith(
548  theString.c_str(),
549  theString.length(),
550  theSubstring,
551  length(theSubstring));
552 }
553 
554 
555 
556 /**
557  * Simulates the java String method startsWith().
558  *
559  * @param theDOMString target string to search
560  * @param theSubstring substring searched for
561  * @param theSubstringLength the length of theSubstring
562  * @return true if the target string begins with the substring
563  */
564 inline bool
566  const XalanDOMString& theString,
567  const XalanDOMChar* theSubstring,
568  XalanDOMString::size_type theSubstringLength)
569 {
570  assert(theSubstring != 0);
571 
572  return startsWith(
573  theString.c_str(),
574  theString.length(),
575  theSubstring,
576  theSubstringLength);
577 }
578 
579 
580 
581 /**
582  * Simulates the java String method startsWith().
583  *
584  * @param theDOMString target string to search
585  * @param theSubstring substring searched for
586  * @return true if the target string begins with the substring
587  */
588 inline bool
590  const XalanDOMString& theString,
591  const XalanDOMString& theSubstring)
592 {
593  return startsWith(
594  theString.c_str(),
595  theString.length(),
596  theSubstring.c_str(),
597  theSubstring.length());
598 }
599 
600 
601 
602 /**
603  * Simulates the java String method endsWith().
604  *
605  * @param theString target string to search
606  * @param theSubstring substring searched for
607  * @return true if the target string ends with the substring
608  */
610 endsWith(
611  const XalanDOMChar* theString,
612  XalanDOMString::size_type theStringLength,
613  const XalanDOMChar* theSubstring,
614  XalanDOMString::size_type theSubstringLength);
615 
616 
617 
618 /**
619  * Simulates the java String method endsWith().
620  *
621  * @param theString target string to search
622  * @param theSubstring substring searched for
623  * @return true if the target string ends with the substring
624  */
625 inline bool
627  const XalanDOMChar* theString,
628  const XalanDOMChar* theSubstring)
629 {
630  assert(theString != 0 && theSubstring != 0);
631 
632  return endsWith(
633  theString,
634  length(theString),
635  theSubstring,
636  length(theSubstring));
637 }
638 
639 
640 
641 /**
642  * Simulates the java String method endsWith().
643  *
644  * @param theString target string to search
645  * @param theSubstring substring searched for
646  * @return true if the target string ends with the substring
647  */
648 inline bool
650  const XalanDOMString& theString,
651  const XalanDOMString& theSubstring)
652 {
653  return endsWith(
654  theString.c_str(),
655  theString.length(),
656  theSubstring.c_str(),
657  theSubstring.length());
658 }
659 
660 
661 
662 /**
663  * Converts a pointer into a XalanDOMString
664  *
665  * @param theValue pointer to be converted
666  * @param theResult the string to append with the result
667  * @return a reference to the passed string result.
668  */
671  const void* theValue,
672  XalanDOMString& theResult);
673 
674 
675 
677 {
678 public:
679 
680  typedef void (FormatterListener::*MemberFunctionPtr)(const XMLCh* const, const FormatterListener::size_type);
681 
682 
683  static void
684  initialize(MemoryManager& theMemoryManager);
685 
686  static void
687  terminate();
688 
689  static void
690  NumberToCharacters(
691  double theValue,
692  FormatterListener& formatterListener,
693  MemberFunctionPtr function);
694 
695  static void
696  NumberToCharacters(
697  long theValue,
698  FormatterListener& formatterListener,
699  MemberFunctionPtr function);
700 
701  static void
702  NumberToCharacters(
703  XALAN_INT64 theValue,
704  FormatterListener& formatterListener,
705  MemberFunctionPtr function);
706 };
707 
708 
709 
710 /**
711  * Converts a double value into a XalanDOMString
712  *
713  * @param theValue number to be converted
714  * @param theResult the string to append with the result
715  * @return a reference to the passed string result.
716  */
719  double theValue,
720  XalanDOMString& theResult);
721 
722 
723 
724 /**
725  * Converts an 64-bit unsigned value into a XalanDOMString
726  *
727  * @param theValue number to be converted
728  * @param theResult the string to append with the result
729  * @return a reference to the passed string result.
730  */
733  XALAN_UINT64 theValue,
734  XalanDOMString& theResult);
735 
736 
737 
738 /**
739  * Converts an 64-bit signed value into a XalanDOMString
740  *
741  * @param theValue number to be converted
742  * @param theResult the string to append with the result
743  * @return a reference to the passed string result.
744  */
747  XALAN_INT64 theValue,
748  XalanDOMString& theResult);
749 
750 
751 
752 /**
753  * Converts an unsigned long value into a XalanDOMString
754  *
755  * @param theValue number to be converted
756  * @param theResult the string to append with the result
757  * @return a reference to the passed string result.
758  */
759 inline XalanDOMString&
761  unsigned long theValue,
762  XalanDOMString& theResult)
763 {
764  return NumberToDOMString(
765  static_cast<XALAN_UINT64>(theValue),
766  theResult);
767 }
768 
769 
770 
771 /**
772  * Converts a XalanSSize_t value into a XalanDOMString
773  *
774  * @param theValue number to be converted
775  * @param theResult the string to append with the result
776  * @return a reference to the passed string result.
777  */
778 inline XalanDOMString&
780  long theValue,
781  XalanDOMString& theResult)
782 {
783  return NumberToDOMString(
784  static_cast<XALAN_INT64>(theValue),
785  theResult);
786 }
787 
788 
789 
790 /**
791  * Converts an unsigned int value into a XalanDOMString
792  *
793  * @param theValue number to be converted
794  * @param theResult the string to append with the result
795  * @return a reference to the passed string result.
796  */
797 inline XalanDOMString&
799  unsigned int theValue,
800  XalanDOMString& theResult)
801 {
802  return NumberToDOMString(
803  static_cast<XALAN_UINT64>(theValue),
804  theResult);
805 }
806 
807 
808 
809 /**
810  * Converts an int value into a XalanDOMString
811  *
812  * @param theValue number to be converted
813  * @param theResult the string to append with the result
814  * @return a reference to the passed string result.
815  */
816 inline XalanDOMString&
818  int theValue,
819  XalanDOMString& theResult)
820 {
821  return NumberToDOMString(
822  static_cast<XALAN_INT64>(theValue),
823  theResult);
824 }
825 
826 
827 
828 /**
829  * Converts an unsigned short value into a XalanDOMString
830  *
831  * @param theValue number to be converted
832  * @param theResult the string to append with the result
833  * @return a reference to the passed string result.
834  */
835 inline XalanDOMString&
837  unsigned short theValue,
838  XalanDOMString& theResult)
839 {
840  return NumberToDOMString(
841  static_cast<XALAN_UINT64>(theValue),
842  theResult);
843 }
844 
845 
846 
847 /**
848  * Converts a short value into a XalanDOMString
849  *
850  * @param theValue number to be converted
851  * @param theResult the string to append with the result
852  * @return a reference to the passed string result.
853  */
854 inline XalanDOMString&
856  short theValue,
857  XalanDOMString& theResult)
858 {
859  return NumberToDOMString(
860  static_cast<XALAN_INT64>(theValue),
861  theResult);
862 }
863 
864 
865 
866 /**
867  * Converts an 64-bit unsigned value into a XalanDOMString
868  *
869  * @param theValue number to be converted
870  * @param theResult the string to append with the result
871  * @return a reference to the passed string result.
872  */
875  XALAN_UINT64 theValue,
876  XalanDOMString& theResult);
877 
878 
879 
880 /**
881  * Converts an 64-bit signed value into a XalanDOMString
882  *
883  * @param theValue number to be converted
884  * @param theResult the string to append with the result
885  * @return a reference to the passed string result.
886  */
889  XALAN_INT64 theValue,
890  XalanDOMString& theResult);
891 
892 
893 
894 /**
895  * Converts a XalanSSize_t value into a XalanDOMString
896  *
897  * @param theValue number to be converted
898  * @param theResult the string to append with the result
899  * @return a reference to the passed string result.
900  */
901 inline XalanDOMString&
903  unsigned long theValue,
904  XalanDOMString& theResult)
905 {
906  return NumberToHexDOMString(
907  static_cast<XALAN_UINT64>(theValue),
908  theResult);
909 }
910 
911 
912 
913 /**
914  * Converts a XalanSSize_t value into a XalanDOMString
915  *
916  * @param theValue number to be converted
917  * @param theResult the string to append with the result
918  * @return a reference to the passed string result.
919  */
920 inline XalanDOMString&
922  long theValue,
923  XalanDOMString& theResult)
924 {
925  return NumberToHexDOMString(
926  static_cast<XALAN_INT64>(theValue),
927  theResult);
928 }
929 
930 
931 
932 /**
933  * Converts an unsigned int value into a XalanDOMString
934  *
935  * @param theValue number to be converted
936  * @param theResult the string to append with the result
937  * @return a reference to the passed string result.
938  */
939 inline XalanDOMString&
941  unsigned int theValue,
942  XalanDOMString& theResult)
943 {
944  return NumberToHexDOMString(
945  static_cast<XALAN_UINT64>(theValue),
946  theResult);
947 }
948 
949 
950 
951 /**
952  * Converts an int value into a XalanDOMString
953  *
954  * @param theValue number to be converted
955  * @param theResult the string to append with the result
956  * @return a reference to the passed string result.
957  */
958 inline XalanDOMString&
960  int theValue,
961  XalanDOMString& theResult)
962 {
963  return NumberToHexDOMString(
964  static_cast<XALAN_INT64>(theValue),
965  theResult);
966 }
967 
968 
969 
970 /**
971  * Converts an unsigned short value into a XalanDOMString
972  *
973  * @param theValue number to be converted
974  * @param theResult the string to append with the result
975  * @return a reference to the passed string result.
976  */
977 inline XalanDOMString&
979  unsigned short theValue,
980  XalanDOMString& theResult)
981 {
982  return NumberToHexDOMString(
983  static_cast<XALAN_UINT64>(theValue),
984  theResult);
985 }
986 
987 
988 
989 /**
990  * Converts a short value into a XalanDOMString
991  *
992  * @param theValue number to be converted
993  * @param theResult the string to append with the result
994  * @return a reference to the passed string result.
995  */
996 inline XalanDOMString&
998  short theValue,
999  XalanDOMString& theResult)
1000 {
1001  return NumberToHexDOMString(
1002  static_cast<XALAN_INT64>(theValue),
1003  theResult);
1004 }
1005 
1006 
1007 
1008 /**
1009  * Converts a wide string into an integer value
1010  *
1011  * @param theString target string
1012  * @return integer value of target string
1013  */
1015 WideStringToInt(const XalanDOMChar* theString);
1016 
1017 
1018 
1019 /**
1020  * Converts a wide string into a long value
1021  *
1022  * @param theString target string
1023  * @return long value of target string
1024  */
1026 WideStringToLong(const XalanDOMChar* theString);
1027 
1028 
1029 
1030 /**
1031  * Converts a wide string into an unsigned long value
1032  *
1033  * @param theString target string
1034  * @return unsigned long value of target string
1035  */
1037 WideStringToUnsignedLong(const XalanDOMChar* theString);
1038 
1039 
1040 
1041 /**
1042  * Converts a wide string into a double value
1043  *
1044  * @param theString target string
1045  * @param theMemoryManager The MemoryManager instance to use.
1046  * @return double value of target string
1047  */
1050  const XalanDOMChar* theString,
1051  MemoryManager& theMemoryManager);
1052 
1053 
1054 
1055 /**
1056  * Converts a XalanDOMString into an integer value
1057  *
1058  * @param theString target string
1059  * @return integer value of target string
1060  */
1061 inline int
1063 {
1064  return WideStringToInt(theString.c_str());
1065 }
1066 
1067 
1068 
1069 /**
1070  * Converts a XalanDOMString into a long value
1071  *
1072  * @param theString target string
1073  * @return long value of target string
1074  */
1075 inline long
1077 {
1078  return WideStringToLong(theString.c_str());
1079 }
1080 
1081 
1082 
1083 /**
1084  * Converts a XalanDOMString into a long value
1085  *
1086  * @param theString target string
1087  * @return unsigned long value of target string
1088  */
1089 inline unsigned long
1091 {
1092  return WideStringToUnsignedLong(theString.c_str());
1093 }
1094 
1095 
1096 
1097 /**
1098  * Converts a XalanDOMString into a double value
1099  *
1100  * @param theString target string
1101  * @param theMemoryManager The MemoryManager instance to use.
1102  * @return double value of target string
1103  */
1104 inline double
1106  const XalanDOMString& theString,
1107  MemoryManager& theMemoryManager)
1108 {
1109  return WideStringToDouble(
1110  theString.c_str(),
1111  theMemoryManager);
1112 }
1113 
1114 
1115 
1116 /**
1117  * Outputs the target string to the specified stream
1118  *
1119  * @param theStream output stream
1120  * @param theString target string
1121  * @see operator<<
1122  */
1124 OutputString(
1125  XalanOutputStream& theStream,
1126  const CharVectorType& theString);
1127 
1128 
1129 
1130 /**
1131  * Outputs the target string to the specified stream
1132  *
1133  * @param theStream output stream
1134  * @param theString target string
1135  * @see operator<<
1136  */
1138 OutputString(
1139 #if defined(XALAN_NO_STD_NAMESPACE)
1140  ostream& theStream,
1141 #else
1142  std::ostream& theStream,
1143 #endif
1144  const CharVectorType& theString);
1145 
1146 
1147 
1148 /**
1149  * Outputs the target string to the specified stream
1150  *
1151  * @param theStream output stream
1152  * @param theString target string
1153  * @see operator<<
1154  */
1156 OutputString(
1157  XalanOutputStream& theStream,
1158  const XalanDOMChar* theString);
1159 
1160 
1161 
1162 /**
1163  * Outputs the target string to the specified stream
1164  *
1165  * @param theStream output stream
1166  * @param theString target string
1167  * @see operator<<
1168  */
1170 OutputString(
1171 #if defined(XALAN_NO_STD_NAMESPACE)
1172  ostream& theStream,
1173 #else
1174  std::ostream& theStream,
1175 #endif
1176  const XalanDOMChar* theString,
1177  MemoryManager& theMemoryManager);
1178 
1179 
1180 
1181 /**
1182  * Outputs the target string to the specified stream
1183  *
1184  * @param theStream output stream
1185  * @param theString target string
1186  * @see operator<<
1187  */
1188 inline void
1190  XalanOutputStream& theStream,
1191  const XalanDOMString& theString)
1192 {
1193  if (theString.empty() == false)
1194  {
1195  OutputString(
1196  theStream,
1197  theString.c_str());
1198  }
1199 }
1200 
1201 
1202 
1203 /**
1204  * Outputs the target string to the specified stream
1205  *
1206  * @param theStream output stream
1207  * @param theString target string
1208  * @param theMemoryManager The MemoryManager instance to use.
1209  * @see operator<<
1210  */
1211 inline void
1213 #if defined(XALAN_NO_STD_NAMESPACE)
1214  ostream& theStream,
1215 #else
1216  std::ostream& theStream,
1217 #endif
1218  const XalanDOMString& theString,
1219  MemoryManager& theMemoryManager)
1220 {
1221  OutputString(
1222  theStream,
1223  theString.c_str(),
1224  theMemoryManager);
1225 }
1226 
1227 
1228 
1229 /**
1230  * Outputs the string to the specified stream
1231  *
1232  * @param theStream output stream
1233  * @param theString the string to output
1234  * @see OutputString
1235  */
1236 inline XalanOutputStream&
1238  XalanOutputStream& theStream,
1239  const CharVectorType& theString)
1240 {
1241  OutputString(
1242  theStream,
1243  theString);
1244 
1245  return theStream;
1246 }
1247 
1248 
1249 
1250 /**
1251  * Outputs the string to the specified stream
1252  *
1253  * @param theStream output stream
1254  * @param theString the string to output
1255  * @see OutputString
1256  */
1257 #if defined(XALAN_NO_STD_NAMESPACE)
1258 inline ostream&
1259 operator<<(
1260  ostream& theStream,
1261 #else
1262 inline std::ostream&
1263 operator<<(
1264  std::ostream& theStream,
1265 #endif
1266  const CharVectorType& theString)
1267 {
1268  OutputString(
1269  theStream,
1270  theString);
1271 
1272  return theStream;
1273 }
1274 
1275 
1276 
1277 /**
1278  * Outputs the target string to the specified stream
1279  *
1280  * @param theStream output stream
1281  * @param theString target string
1282  * @see OutputString
1283  */
1284 inline XalanOutputStream&
1286  XalanOutputStream& theStream,
1287  const XalanDOMChar* theString)
1288 {
1289  OutputString(
1290  theStream,
1291  theString);
1292 
1293  return theStream;
1294 }
1295 
1296 
1297 
1298 /**
1299  * Outputs the target string to the specified stream
1300  *
1301  * @param theStream output stream
1302  * @param theString target string
1303  * @see OutputString
1304  */
1305 #if defined(XALAN_NO_STD_NAMESPACE)
1306 inline ostream&
1307 operator<<(
1308  ostream& theStream,
1309 #else
1310 inline std::ostream&
1311 operator<<(
1312  std::ostream& theStream,
1313 #endif
1314  const XalanDOMChar* theString)
1315 {
1316  OutputString(
1317  theStream,
1318  theString,
1320 
1321  return theStream;
1322 }
1323 
1324 
1325 
1326 /**
1327  * Outputs the target string to the specified stream
1328  *
1329  * @param theStream output stream
1330  * @param theString target string
1331  * @see OutputString
1332  */
1333 inline XalanOutputStream&
1335  XalanOutputStream& theStream,
1336  const XalanDOMString& theString)
1337 {
1338  OutputString(theStream,
1339  theString);
1340 
1341  return theStream;
1342 }
1343 
1344 
1345 
1346 /**
1347  * Outputs the target string to the specified stream
1348  *
1349  * @param theStream output stream
1350  * @param theString target string
1351  * @see OutputString
1352  */
1353 #if defined(XALAN_NO_STD_NAMESPACE)
1354 inline ostream&
1355 operator<<(
1356  ostream& theStream,
1357 #else
1358 inline std::ostream&
1359 operator<<(
1360  std::ostream& theStream,
1361 #endif
1362  const XalanDOMString& theString)
1363 {
1364  OutputString(
1365  theStream,
1366  theString,
1368 
1369  return theStream;
1370 }
1371 
1372 
1373 
1374 /**
1375  * Outputs the target string to the specified stream
1376  *
1377  * @param theStream output stream
1378  * @param theString target string
1379  * @see OutputString
1380  */
1381 #if defined(XALAN_NO_STD_NAMESPACE)
1382 inline ostream&
1383 operator<<(
1384  ostream& theStream,
1385 #else
1386 inline std::ostream&
1387 operator<<(
1388  std::ostream& theStream,
1389 #endif
1390  XalanDOMString& theString)
1391 {
1392  OutputString(
1393  theStream,
1394  theString,
1395  theString.getMemoryManager());
1396 
1397  return theStream;
1398 }
1399 
1400 
1401 
1402 /**
1403  * Retrieves a character at a specified index in the target string
1404  *
1405  * @deprecated This function is deprecated.
1406  *
1407  * @param theString target string
1408  * @param theIndex index of character
1409  * @return character at specified index
1410  */
1411 inline XalanDOMChar
1413  const XalanDOMString& theString,
1414  XalanDOMString::size_type theIndex)
1415 {
1416  return theString[theIndex];
1417 }
1418 
1419 
1420 
1421 /**
1422  * Determines whether character represents white space
1423  *
1424  * @param theChar target character
1425  * @return true if character represents white space
1426  */
1427 inline bool
1428 isXMLWhitespace(XalanDOMChar theChar)
1429 {
1430  return XalanXMLChar::isWhitespace(theChar);
1431 }
1432 
1433 
1434 
1435 /**
1436  * Determines whether character represents a digit
1437  *
1438  * @param theChar target character
1439  * @return true if character represents a digit
1440  */
1441 inline bool
1442 isXMLDigit(XalanDOMChar theChar)
1443 {
1444  return XalanXMLChar::isDigit(theChar);
1445 }
1446 
1447 
1448 
1449 /**
1450  * Determines whether character represents a letter or digit
1451  *
1452  * @param theChar target character
1453  * @return true if character represents a letter or digit
1454  */
1455 inline bool
1456 isXMLLetterOrDigit(XalanDOMChar theChar)
1457 {
1458  return XalanXMLChar::isDigit(theChar) ||
1459  XalanXMLChar::isLetter(theChar);
1460 }
1461 
1462 
1463 
1464 
1465 
1466 
1467 /**
1468  * Simulates the java String method substring(). Returns a new string that is
1469  * a substring of this string. The substring begins at the specified
1470  * theStartIndex and extends to the character at index theEndIndex - 1. Thus
1471  * the length of the substring is theEndIndex - theStartIndex.
1472  *
1473  * @param theString source string
1474  * @param theSubstring target string
1475  * @param theStartIndex starting index, inclusive
1476  * @param theEndIndex ending index, exclusive
1477  * @return A reference to theSubstring
1478  */
1480 substring(
1481  const XalanDOMChar* theString,
1482  XalanDOMString& theSubstring,
1483  XalanDOMString::size_type theStartIndex,
1485 
1486 
1487 
1488 /**
1489  * Simulates the java String method substring(). Returns a new string that is
1490  * a substring of this string. The substring begins at the specified
1491  * theStartIndex and extends to the character at index theEndIndex - 1. Thus
1492  * the length of the substring is theEndIndex - theStartIndex.
1493  *
1494  * @param theString source string
1495  * @param theSubstring target string
1496  * @param theStartIndex starting index, inclusive
1497  * @param theEndIndex ending index, exclusive
1498  */
1500 substring(
1501  const XalanDOMString& theString,
1502  XalanDOMString& theSubstring,
1503  XalanDOMString::size_type theStartIndex,
1505 
1506 
1507 
1508 /**
1509  * Simulates the java String method substring(). Returns a new string that is
1510  * a substring of this string. The substring begins at the specified
1511  * theStartIndex and extends to the character at index theEndIndex - 1. Thus
1512  * the length of the substring is theEndIndex-theStartIndex.
1513  *
1514  * @param theString source string
1515  * @param theStartIndex starting index, inclusive
1516  * @param theEndIndex ending index, exclusive
1517  * @return string containing the specified range of characters from target
1518  */
1520 substring(
1521  const XalanDOMString& theString,
1522  XalanDOMString::size_type theStartIndex,
1523  XalanDOMString& theResult,
1525 
1526 
1527 
1528 /**
1529  * Converts ASCII alphabetic characters from upper case to
1530  * lower case. This function works only with the Unicode
1531  * characters A-Z.
1532  *
1533  * @param theString target string
1534  * @return string containing lower case characters
1535  */
1536 inline XalanDOMChar
1537 toLowerASCII(XalanDOMChar theChar)
1538 {
1539  if (theChar >= XalanUnicode::charLetter_A && theChar <= XalanUnicode::charLetter_Z)
1540  {
1541  return XalanDOMChar(theChar - (XalanUnicode::charLetter_A - XalanUnicode::charLetter_a));
1542  }
1543  else
1544  {
1545  return theChar;
1546  }
1547 }
1548 
1549 
1550 
1551 /**
1552  * Converts ASCII alphabetic characters from lower case to
1553  * upper case. This function works only with the Unicode
1554  * characters a-z.
1555  *
1556  * @param theString target string
1557  * @return string containing upper case characters
1558  */
1559 inline XalanDOMChar
1560 toUpperASCII(XalanDOMChar theChar)
1561 {
1562  if (theChar >= XalanUnicode::charLetter_a && theChar <= XalanUnicode::charLetter_z)
1563  {
1564  return XalanDOMChar(theChar + (XalanUnicode::charLetter_A - XalanUnicode::charLetter_a));
1565  }
1566  else
1567  {
1568  return theChar;
1569  }
1570 }
1571 
1572 
1573 
1574 /**
1575  * Flips the case to of the supplied character. This function works only with
1576  * the Unicode characters A-Z and a-z.
1577  *
1578  * @param theString target string
1579  * @return string containing lower case characters
1580  */
1581 inline XalanDOMChar
1582 flipCaseASCII(XalanDOMChar theChar)
1583 {
1584  if (theChar >= XalanUnicode::charLetter_A && theChar <= XalanUnicode::charLetter_Z)
1585  {
1586  return XalanDOMChar(theChar - (XalanUnicode::charLetter_A - XalanUnicode::charLetter_a));
1587  }
1588  else if (theChar >= XalanUnicode::charLetter_a && theChar <= XalanUnicode::charLetter_z)
1589  {
1590  return XalanDOMChar(theChar + (XalanUnicode::charLetter_A - XalanUnicode::charLetter_a));
1591  }
1592  else
1593  {
1594  return theChar;
1595  }
1596 }
1597 
1598 
1599 
1600 /**
1601  * Converts ASCII alphabetic characters from upper case to
1602  * lower case. This function works only with the characters
1603  * a-z and A-Z.
1604  *
1605  * @param theString The source string
1606  * @param theResult The target string
1607  * @return A reference to theResult
1608  */
1611  const XalanDOMChar* theString,
1612  XalanDOMString& theResult);
1613 
1614 
1615 
1616 /**
1617  * Converts ASCII alphabetic characters from upper case to
1618  * lower case. This function works only with the characters
1619  * a-z and A-Z.
1620  *
1621  * @param theString The source string
1622  * @param theResult The target string
1623  * @return A reference to theResult
1624  */
1627  const XalanDOMString& theString,
1628  XalanDOMString& theResult);
1629 
1630 
1631 
1632 /**
1633  * Converts ASCII alphabetic characters from upper case to
1634  * lower case. This function works only with the characters
1635  * a-z and A-Z.
1636  *
1637  * @param theString The string to convert
1638  * @return A reference to theString
1639  */
1641 toLowerCaseASCII(XalanDOMString& theString);
1642 
1643 
1644 
1645 /**
1646  * Converts ASCII alphabetic characters from lower case to
1647  * upper case. This function works only with the characters
1648  * a-z and A-Z.
1649  *
1650  * @param theString The source string
1651  * @param theResult The target string
1652  * @return A reference to theResult
1653  */
1656  const XalanDOMChar* theString,
1657  XalanDOMString& theResult);
1658 
1659 
1660 
1661 /**
1662  * Converts ASCII alphabetic characters from lower case to
1663  * upper case. This function works only with the characters
1664  * a-z and A-Z.
1665  *
1666  * @param theString The source string
1667  * @param theResult The target string
1668  * @return A reference to theResult
1669  */
1672  const XalanDOMString& theString,
1673  XalanDOMString& theResult);
1674 
1675 
1676 
1677 /**
1678  * Converts ASCII alphabetic characters from lower case to
1679  * upper case. This function works only with the characters
1680  * a-z and A-Z.
1681  *
1682  * @param theString The string to convert
1683  * @return A reference to theString
1684  */
1686 toUpperCaseASCII(XalanDOMString& theString);
1687 
1688 
1689 
1690 /**
1691  * Compare the contents of two strings.
1692  *
1693  * THIS FUNCTION DOES NOT COMPARE STRINGS LIKE strcmp() OR ANY
1694  * OTHER "COLLATION" ALGORITHM.
1695  *
1696  * @param theLHS first string to compare
1697  * @param theRHS second string to compare
1698  * @return Returns 0 for equal strings, less than 0 if theLHS is less
1699  * than theRHS, or greater than 0 if theRHS is greater than theLHS.
1700  * @see operator<()
1701  */
1703 compare(
1704  const CharVectorType& theLHS,
1705  const CharVectorType& theRHS);
1706 
1707 
1708 
1709 /**
1710  * Compare the contents of two character arrays.
1711  *
1712  * THIS FUNCTION DOES NOT COMPARE STRINGS LIKE strcmp() OR ANY
1713  * OTHER "COLLATION" ALGORITHM.
1714  *
1715  * @param theLHS first array to compare
1716  * @param theLHSLength the length of the first array
1717  * @param theRHS second array to compare
1718  * @param theRHSLength the length of the second array
1719  * @return Returns 0 for equal arrays, less than 0 if theLHS is less
1720  * than theRHS, or greater than 0 if theRHS is greater than theLHS.
1721  */
1723 compare(
1724  const XalanDOMChar* theLHS,
1725  XalanDOMString::size_type theLHSLength,
1726  const XalanDOMChar* theRHS,
1727  XalanDOMString::size_type theRHSLength);
1728 
1729 
1730 
1731 /**
1732  * Compare the contents of two null-terminated strings.
1733  *
1734  * THIS FUNCTION DOES NOT COMPARE STRINGS LIKE strcmp() OR ANY
1735  * OTHER "COLLATION" ALGORITHM.
1736  *
1737  * @param theLHS first string to compare
1738  * @param theRHS second string to compare
1739  * @return Returns 0 for equal strings, less than 0 if theLHS is less
1740  * than theRHS, or greater than 0 if theRHS is greater than theLHS.
1741  */
1742 inline int
1744  const XalanDOMChar* theLHS,
1745  const XalanDOMChar* theRHS)
1746 {
1747  return compare(theLHS, length(theLHS), theRHS, length(theRHS));
1748 }
1749 
1750 
1751 
1752 /**
1753  * Compare the contents of two strings.
1754  *
1755  * THIS FUNCTION DOES NOT COMPARE STRINGS LIKE strcmp() OR ANY
1756  * OTHER "COLLATION" ALGORITHM.
1757  *
1758  * @param theLHS first string to compare
1759  * @param theRHS second string to compare
1760  * @return Returns 0 for equal strings, less than 0 if theLHS is less
1761  * than theRHS, or greater than 0 if theRHS is greater than theLHS.
1762  * @see operator<()
1763  * @see collationCompare()
1764  */
1765 inline int
1767  const XalanDOMString& theLHS,
1768  const XalanDOMString& theRHS)
1769 {
1770  return compare(
1771  theLHS.c_str(),
1772  theLHS.length(),
1773  theRHS.c_str(),
1774  theRHS.length());
1775 }
1776 
1777 
1778 
1779 /**
1780  * Compare the contents of two strings.
1781  *
1782  * THIS FUNCTION DOES NOT COMPARE STRINGS LIKE strcmp() OR ANY
1783  * OTHER "COLLATION" ALGORITHM.
1784  *
1785  * @param theLHS first string to compare
1786  * @param theRHS second string to compare
1787  * @return Returns 0 for equal strings, less than 0 if theLHS is less
1788  * than theRHS, or greater than 0 if theRHS is greater than theLHS.
1789  */
1790 inline int
1792  const XalanDOMChar* theLHS,
1793  const XalanDOMString& theRHS)
1794 {
1795  return compare(
1796  theLHS,
1797  length(theLHS),
1798  theRHS.c_str(),
1799  theRHS.length());
1800 }
1801 
1802 
1803 
1804 /**
1805  * Compare the contents of two strings.
1806  *
1807  * THIS FUNCTION DOES NOT COMPARE STRINGS LIKE strcmp() OR ANY
1808  * OTHER "COLLATION" ALGORITHM.
1809  *
1810  * @param theLHS first string to compare
1811  * @param theRHS second string to compare
1812  * @return Returns 0 for equal strings, less than 0 if theLHS is less
1813  * than theRHS, or greater than 0 if theRHS is greater than theLHS.
1814  */
1815 inline int
1817  const XalanDOMString& theLHS,
1818  const XalanDOMChar* theRHS)
1819 {
1820  return compare(
1821  theLHS.c_str(),
1822  theLHS.length(),
1823  theRHS,
1824  length(theRHS));
1825 }
1826 
1827 
1828 
1829 /**
1830  * Compare the contents of two arrays in a case insensitive
1831  * manner. Only the characters a-z and A-Z are considered as
1832  * characters with "case".
1833  *
1834  * THIS FUNCTION DOES NOT COMPARE STRINGS LIKE strcmp() OR ANY
1835  * OTHER "COLLATION" ALGORITHM.
1836  *
1837  * @param theLHS first array to compare
1838  * @param theLHSLength the length of the first array
1839  * @param theRHS second array to compare
1840  * @param theRHSLength the length of the second array
1841  * @return Returns 0 for equal arrays, less than 0 if theLHS is less
1842  * than theRHS, or greater than 0 if theRHS is greater than theLHS.
1843  */
1846  const XalanDOMChar* theLHS,
1847  XalanDOMString::size_type theLHSLength,
1848  const XalanDOMChar* theRHS,
1849  XalanDOMString::size_type theRHSLength);
1850 
1851 
1852 
1853 /**
1854  * Compare the contents of two strings, in a case insensitive
1855  * manner. Only the characters a-z and A-Z are considered as
1856  * characters with "case".
1857  *
1858  * THIS FUNCTION DOES NOT COMPARE STRINGS LIKE strcmp() OR ANY
1859  * OTHER "COLLATION" ALGORITHM.
1860  *
1861  * @param theLHS first string to compare
1862  * @param theRHS second string to compare
1863  * @return Returns 0 for equal strings, less than 0 if theLHS is less
1864  * than theRHS, or greater than 0 if theRHS is greater than theLHS.
1865  */
1866 inline int
1868  const XalanDOMChar* theLHS,
1869  const XalanDOMChar* theRHS)
1870 {
1871  return compareIgnoreCaseASCII(theLHS, length(theLHS), theRHS, length(theRHS));
1872 }
1873 
1874 
1875 
1876 /**
1877  * Compare the contents of two strings, in a case insensitive
1878  * manner. Only the characters a-z and A-Z are considered as
1879  * characters with "case".
1880  *
1881  * THIS FUNCTION DOES NOT COMPARE STRINGS LIKE strcmp() OR ANY
1882  * OTHER "COLLATION" ALGORITHM.
1883  *
1884  * @param theLHS first string to compare
1885  * @param theRHS second string to compare
1886  * @return Returns 0 for equal strings, less than 0 if theLHS is less
1887  * than theRHS, or greater than 0 if theRHS is greater than theLHS.
1888  * @see operator<
1889  * @see collationCompare
1890  */
1891 inline int
1893  const XalanDOMString& theLHS,
1894  const XalanDOMString& theRHS)
1895 {
1896  return compareIgnoreCaseASCII(
1897  theLHS.c_str(),
1898  theLHS.length(),
1899  theRHS.c_str(),
1900  theRHS.length());
1901 }
1902 
1903 
1904 
1905 /**
1906  * Compare the contents of two strings, in a case insensitive
1907  * manner. Only the characters a-z and A-Z are considered as
1908  * characters with "case".
1909  *
1910  * THIS FUNCTION DOES NOT COMPARE STRINGS LIKE strcmp() OR ANY
1911  * OTHER "COLLATION" ALGORITHM.
1912  *
1913  * @param theLHS first string to compare
1914  * @param theRHS second string to compare
1915  * @return Returns 0 for equal strings, less than 0 if theLHS is less
1916  * than theRHS, or greater than 0 if theRHS is greater than theLHS.
1917  */
1918 inline int
1920  const XalanDOMString& theLHS,
1921  const XalanDOMChar* theRHS)
1922 {
1923  return compareIgnoreCaseASCII(
1924  theLHS.c_str(),
1925  theLHS.length(),
1926  theRHS,
1927  length(theRHS));
1928 }
1929 
1930 
1931 
1932 /**
1933  * Compare the contents of two strings, in a case insensitive
1934  * manner. Only the characters a-z and A-Z are considered for
1935  * the comparison.
1936  *
1937  * THIS FUNCTION DOES NOT COMPARE STRINGS LIKE strcmp() OR ANY
1938  * OTHER "COLLATION" ALGORITHM.
1939  *
1940  * @param theLHS first string to compare
1941  * @param theRHS second string to compare
1942  * @return Returns 0 for equal strings, less than 0 if theLHS is less
1943  * than theRHS, or greater than 0 if theRHS is greater than theLHS.
1944  */
1945 inline int
1947  const XalanDOMChar* theLHS,
1948  const XalanDOMString& theRHS)
1949 {
1950  return compareIgnoreCaseASCII(
1951  theLHS,
1952  length(theLHS),
1953  theRHS.c_str(),
1954  theRHS.length());
1955 }
1956 
1957 
1958 
1959 /**
1960  * Compare the contents of two character arrays.
1961  *
1962  * @param theLHS first array to compare
1963  * @param theLHSLength the length of the first array
1964  * @param theRHS second array to compare
1965  * @param theRHSLength the length of the second array
1966  * @return Returns 0 for equal arrays, less than 0 if theLHS is less
1967  * than theRHS, or greater than 0 if theRHS is greater than theLHS.
1968  */
1971  const XalanDOMChar* theLHS,
1972  XalanDOMString::size_type theLHSLength,
1973  const XalanDOMChar* theRHS,
1974  XalanDOMString::size_type theRHSLength);
1975 
1976 
1977 
1978 /**
1979  * Compare the contents of two strings.
1980  *
1981  * @param theLHS first string to compare
1982  * @param theRHS second string to compare
1983  * @return Returns 0 for equal strings, less than 0 if theLHS is less
1984  * than theRHS, or greater than 0 if theRHS is greater than theLHS.
1985  * @see operator<()
1986  * @see compare()
1987  */
1990  const XalanDOMChar* theLHS,
1991  const XalanDOMChar* theRHS);
1992 
1993 
1994 
1995 /**
1996  * Compare the contents of two strings.
1997  *
1998  * @param theLHS first string to compare
1999  * @param theRHS second string to compare
2000  * @return Returns 0 for equal strings, less than 0 if theLHS is less
2001  * than theRHS, or greater than 0 if theRHS is greater than theLHS.
2002  * @see operator<()
2003  * @see compare()
2004  */
2005 inline int
2007  const XalanDOMString& theLHS,
2008  const XalanDOMString& theRHS)
2009 {
2010  return collationCompare(theLHS.c_str(), theRHS.c_str());
2011 }
2012 
2013 
2014 
2015 /**
2016  * Compare the contents of two strings.
2017  *
2018  * @param theLHS first string to compare
2019  * @param theRHS second string to compare
2020  * @return Returns 0 for equal strings, less than 0 if theLHS is less
2021  * than theRHS, or greater than 0 if theRHS is greater than theLHS.
2022  */
2023 inline int
2025  const XalanDOMChar* theLHS,
2026  const XalanDOMString& theRHS)
2027 {
2028  return collationCompare(theLHS, theRHS.c_str());
2029 }
2030 
2031 
2032 
2033 /**
2034  * Compare the contents of two strings.
2035  *
2036  * @param theLHS first string to compare
2037  * @param theRHS second string to compare
2038  * @return Returns 0 for equal strings, less than 0 if theLHS is less
2039  * than theRHS, or greater than 0 if theRHS is greater than theLHS.
2040  */
2041 inline int
2043  const XalanDOMString& theLHS,
2044  const XalanDOMChar* theRHS)
2045 {
2046  return collationCompare(
2047  theLHS.c_str(),
2048  theLHS.length(),
2049  theRHS,
2050  length(theRHS));
2051 }
2052 
2053 
2054 
2055 /**
2056  * Compare the contents of two arrays for equality
2057  *
2058  * @param theLHS first array to compare
2059  * @param theRHS second array to compare
2060  * @param theLength the length of the arrays
2061  * @return true if the contents of both arrays are identical
2062  */
2064 equals(
2065  const XalanDOMChar* theLHS,
2066  const XalanDOMChar* theRHS,
2067  XalanDOMString::size_type theLength);
2068 
2069 
2070 
2071 /**
2072  * Compare the contents of two arrays for equality
2073  *
2074  * @param theLHS first array to compare
2075  * @param theLHSLength the length of the theLHS
2076  * @param theRHS second array to compare
2077  * @param theRHSLength the length of the theRHS
2078  * @return true if the contents of both arrays are identical
2079  */
2080 inline bool
2082  const XalanDOMChar* theLHS,
2083  XalanDOMString::size_type theLHSLength,
2084  const XalanDOMChar* theRHS,
2085  XalanDOMString::size_type theRHSLength)
2086 {
2087  return theLHSLength != theRHSLength ? false : equals(theLHS, theRHS, theLHSLength);
2088 }
2089 
2090 
2091 
2092 /**
2093  * Compare the contents of two strings for equality
2094  *
2095  * @param theLHS first string to compare
2096  * @param theRHS second string to compare
2097  * @return true if the contents of both strings are identical
2098  */
2099 inline bool
2101  const XalanDOMChar* theLHS,
2102  const XalanDOMChar* theRHS)
2103 {
2104  const XalanDOMString::size_type theLHSLength = length(theLHS);
2105 
2106  return theLHSLength != length(theRHS) ? false : equals(theLHS, theRHS, theLHSLength);
2107 }
2108 
2109 
2110 
2111 /**
2112  * Compare the contents of two strings for equality
2113  *
2114  * @param theLHS first string to compare
2115  * @param theRHS second string to compare
2116  * @return true if the contents of both strings are identical
2117  */
2118 inline bool
2120  const XalanDOMString& theLHS,
2121  const XalanDOMString& theRHS)
2122 {
2123  return theLHS == theRHS;
2124 }
2125 
2126 
2127 
2128 /**
2129  * Compare the contents of two strings for equality
2130  *
2131  * @param theLHS first string to compare
2132  * @param theRHS second string to compare
2133  * @return true if the contents of both strings are identical
2134  */
2135 inline bool
2137  const XalanDOMChar* theLHS,
2138  const XalanDOMString& theRHS)
2139 {
2140  assert(theLHS != 0);
2141 
2142  // Swap them...
2143  return theRHS == theLHS;
2144 }
2145 
2146 
2147 
2148 /**
2149  * Compare the contents of two strings for equality
2150  *
2151  * @param theLHS first string to compare
2152  * @param theRHS second string to compare
2153  * @return true if the contents of both strings are identical
2154  */
2155 inline bool
2156 equals(const XalanDOMString& theLHS,
2157  const XalanDOMChar* theRHS)
2158 {
2159  return equals(theRHS, theLHS);
2160 }
2161 
2162 
2163 
2164 /**
2165  * Compare the contents of two strings for equality
2166  *
2167  * @param theLHS first string to compare
2168  * @param theRHS second string to compare
2169  * @param theRHSLength the length of the theRHS
2170  * @return true if the contents of both strings are identical
2171  */
2172 inline bool
2174  const XalanDOMString& theLHS,
2175  const XalanDOMChar* theRHS,
2176  XalanDOMString::size_type theRHSLength)
2177 {
2178  return theRHSLength != theLHS.length() ? false : equals(theLHS.c_str(), theRHSLength, theRHS, theRHSLength);
2179 }
2180 
2181 
2182 
2183 
2184 /**
2185  * Compare the contents of two arrays for equality, without regard for case.
2186  * Only the characters a-z and A-Z are considered characters with "case".
2187  *
2188  * @param theLHS first string to compare
2189  * @param theRHS second string to compare
2190  * @return true if the case-insensitive contents of both strings are identical
2191  */
2194  const XalanDOMChar* theLHS,
2195  const XalanDOMChar* theRHS,
2196  XalanDOMString::size_type theLength);
2197 
2198 
2199 
2200 /**
2201  * Compare the contents of two strings for equality, without regard for case.
2202  * Only the characters a-z and A-Z are considered characters with "case".
2203  *
2204  * @param theLHS first string to compare
2205  * @param theLHSLength the length of the theLHS
2206  * @param theRHS second string to compare
2207  * @param theRHSLength the length of the theRHS
2208  * @return true if both strings are identical
2209  */
2210 inline bool
2212  const XalanDOMChar* theLHS,
2213  XalanDOMString::size_type theLHSLength,
2214  const XalanDOMChar* theRHS,
2215  XalanDOMString::size_type theRHSLength)
2216 {
2217  return theLHSLength != theRHSLength ? false :
2218  equalsIgnoreCaseASCII(theLHS, theRHS, theLHSLength);
2219 }
2220 
2221 
2222 
2223 /**
2224  * Compare the contents of two strings for equality, without regard for case.
2225  * Only the characters a-z and A-Z are considered characters with "case".
2226  *
2227  * @param theLHS first string to compare
2228  * @param theRHS second string to compare
2229  * @return true if both strings are identical
2230  */
2231 inline bool
2233  const XalanDOMChar* theLHS,
2234  const XalanDOMChar* theRHS)
2235 {
2236  const XalanDOMString::size_type theLength = length(theLHS);
2237 
2238  return theLength != length(theRHS) ? false :
2239  equalsIgnoreCaseASCII(theLHS, theRHS, theLength);
2240 }
2241 
2242 
2243 
2244 /**
2245  * Compare the contents of two strings for equality, without regard for case
2246  * Only the characters A-Z and a-z are considered.
2247  *
2248  * @param theLHS first string to compare
2249  * @param theRHS second string to compare
2250  * @return true if the case-insensitive contents of both strings are identical
2251  */
2252 inline bool
2254  const XalanDOMString& theLHS,
2255  const XalanDOMString& theRHS)
2256 {
2257  const XalanDOMString::size_type theLength = theLHS.length();
2258 
2259  return theLength != theRHS.length() ? false :
2261  theLHS.c_str(),
2262  theRHS.c_str(),
2263  theLength);
2264 }
2265 
2266 
2267 
2268 /**
2269  * Compare the contents of two strings for equality, without regard for case.
2270  * Only the characters a-z and A-Z are considered characters with "case".
2271  *
2272  * @param theLHS first string to compare
2273  * @param theRHS second string to compare
2274  * @return true if the case-insensitive contents of both strings are identical
2275  */
2276 inline bool
2278  const XalanDOMChar* theLHS,
2279  const XalanDOMString& theRHS)
2280 {
2281  const XalanDOMString::size_type theRHSLength = theRHS.length();
2282 
2283  return theRHSLength != length(theLHS) ? false :
2285  theLHS,
2286  theRHS.c_str(),
2287  theRHSLength);
2288 }
2289 
2290 
2291 
2292 /**
2293  * Compare the contents of two strings for equality, without regard for case.
2294  * Only the characters A-Z and a-z are considered.
2295  *
2296  * @param theLHS first string to compare
2297  * @param theRHS second string to compare
2298  * @return true if the case-insensitive contents of both strings are identical
2299  */
2300 inline bool
2302  const XalanDOMString& theLHS,
2303  const XalanDOMChar* theRHS)
2304 {
2305  return equalsIgnoreCaseASCII(theRHS, theLHS);
2306 }
2307 
2308 
2309 
2310 /**
2311  * Implements operator< for CharVectorType.
2312  *
2313  * @param theLHS first string to compare
2314  * @param theRHS second string to compare
2315  * @return Returns true if theLHS is lexically
2316  * less than theRHS
2317  * @see compare
2318  */
2319 inline bool
2321  const CharVectorType& theLHS,
2322  const CharVectorType& theRHS)
2323 {
2324  return compare(theLHS, theRHS) < 0 ? true : false;
2325 }
2326 
2327 
2328 
2329 /**
2330  * Implements operator< for DOMStrings.
2331  *
2332  * @param theLHS first string to compare
2333  * @param theRHS second string to compare
2334  * @return Returns true if theLHS is lexically
2335  * less than theRHS
2336  * @see compare
2337  */
2338 inline bool
2340  const XalanDOMString& theLHS,
2341  const XalanDOMString& theRHS)
2342 {
2343  return compare(theLHS, theRHS) < 0 ? true : false;
2344 }
2345 
2346 
2347 
2348 /**
2349  * Assign one string to another
2350  *
2351  * @deprecated This function is deprecated.
2352  *
2353  * @param theString target string
2354  * @param theStringToAppend string to assign
2355  * @param theStringToAppendLength length of the string (XalanDOMString::npos implies the string is null-terminated)
2356  * @return a reference to the target string
2357  */
2358 inline XalanDOMString&
2360  XalanDOMString& theString,
2361  const XalanDOMString& theStringToAssign)
2362 {
2363  theString = theStringToAssign;
2364 
2365  return theString;
2366 }
2367 
2368 
2369 
2370 /**
2371  * Assign one string to another
2372  *
2373  * @deprecated This function is deprecated.
2374  *
2375  * @param theString target string
2376  * @param theStringToAppend string to assign
2377  * @param theStringToAppendLength length of the string (XalanDOMString::npos implies the string is null-terminated)
2378  * @return a reference to the target string
2379  */
2380 inline XalanDOMString&
2382  XalanDOMString& theString,
2383  const XalanDOMChar* theStringToAssign,
2384  XalanDOMString::size_type theStringToAssignLength = XalanDOMString::npos)
2385 {
2386  if (theStringToAssignLength == XalanDOMString::npos)
2387  {
2388  theString.assign(theStringToAssign);
2389  }
2390  else
2391  {
2392  theString.assign(theStringToAssign, theStringToAssignLength);
2393  }
2394 
2395  return theString;
2396 }
2397 
2398 
2399 
2400 /**
2401  * Concatenate two strings
2402  *
2403  * @deprecated This function is deprecated.
2404  *
2405  * @param theString target string
2406  * @param theStringToAppend string to add to target
2407  * @return a reference to the target string
2408  */
2409 inline XalanDOMString&
2411  XalanDOMString& theString,
2412  const XalanDOMString& theStringToAppend)
2413 {
2414  theString.append(theStringToAppend);
2415 
2416  return theString;
2417 }
2418 
2419 
2420 
2421 /**
2422  * Concatenate two strings
2423  *
2424  * @deprecated This function is deprecated.
2425  *
2426  * @param theString target string
2427  * @param theStringToAppend string to add to target
2428  * @param theStringToAppendLength length of the string (XalanDOMString::npos implies the string is null-terminated)
2429  * @return a reference to the target string
2430  */
2431 inline XalanDOMString&
2433  XalanDOMString& theString,
2434  const XalanDOMChar* theStringToAppend,
2435  XalanDOMString::size_type theStringToAppendLength = XalanDOMString::npos)
2436 {
2437  assert(theStringToAppend != 0);
2438 
2439  if (theStringToAppendLength == XalanDOMString::npos)
2440  {
2441  theString.append(theStringToAppend);
2442  }
2443  else
2444  {
2445  theString.append(theStringToAppend, theStringToAppendLength);
2446  }
2447 
2448  return theString;
2449 }
2450 
2451 
2452 
2453 /**
2454  * Concatenate two strings
2455  *
2456  * @deprecated This function is deprecated.
2457  *
2458  * @param theString target string
2459  * @param theStringToAppend string to add to target
2460  * @param theStringToAppendLength length of the string (XalanDOMString::npos implies the string is null-terminated)
2461  * @return string with contents of 'theStringToAppend' added to target string
2462  */
2463 inline XalanDOMString&
2465  XalanDOMString& theString,
2466  const char* theStringToAppend,
2467  XalanDOMString::size_type theStringToAppendLength = XalanDOMString::npos)
2468 {
2469  XalanDOMString tmp(theString.getMemoryManager());
2470 
2471  TranscodeFromLocalCodePage(theStringToAppend, tmp, theStringToAppendLength);
2472 
2473  theString.append(tmp);
2474 
2475  return theString;
2476 }
2477 
2478 
2479 
2480 /**
2481  * Concatenate a string and a character
2482  *
2483  * @deprecated This function is deprecated.
2484  *
2485  * @param theString target string
2486  * @param theCharToAppend the character to add to the target
2487  * @return string with the character appended
2488  */
2489 inline XalanDOMString&
2491  XalanDOMString& theString,
2492  const XalanDOMChar theCharToAppend)
2493 {
2494  theString.append(1, theCharToAppend);
2495 
2496  return theString;
2497 }
2498 
2499 
2500 
2501 /**
2502  * Concatenate a string and a character
2503  *
2504  * @deprecated This function is deprecated.
2505  *
2506  * @param theString target string
2507  * @param theCharToAppend the character to add to the target
2508  * @return string with the character appended
2509  */
2510 inline XalanDOMString&
2512  XalanDOMString& theString,
2513  char theCharToAppend)
2514 {
2515  // We have to transcode before appending...
2516  char theTempBuffer[] = { theCharToAppend, '\0' };
2517 
2518  return append(theString, theTempBuffer);
2519 }
2520 
2521 
2522 
2523 /**
2524  * Insert a string into another string.
2525  *
2526  * @deprecated This function is deprecated.
2527  *
2528  * @param theString target string
2529  * @param thePosition The position in the target string to insert
2530  * @param theStringToInsert The string to insert
2531  * @return A reference to the target string
2532  */
2533 inline XalanDOMString&
2535  XalanDOMString& theString,
2536  XalanDOMString::size_type thePosition,
2537  const XalanDOMString& theStringToInsert)
2538 {
2539  theString.insert(thePosition, theStringToInsert);
2540 
2541  return theString;
2542 }
2543 
2544 
2545 
2546 /**
2547  * Insert a string into another string.
2548  *
2549  * @deprecated This function is deprecated.
2550  *
2551  * @param theString target string
2552  * @param thePosition The position in the target string to insert
2553  * @param theStringToInsert The string to insert
2554  * @return A reference to the target string
2555  */
2556 inline XalanDOMString&
2558  XalanDOMString& theString,
2559  XalanDOMString::size_type thePosition,
2560  const XalanDOMChar* theStringToInsert)
2561 {
2562  theString.insert(thePosition, theStringToInsert);
2563 
2564  return theString;
2565 }
2566 
2567 
2568 
2569 /**
2570  * Remove leading and trailing whitespace.
2571  *
2572  * @param theString The string to trim.
2573  * @param theResult The result string.
2574  * @return A reference to theResult.
2575  */
2577 trim(
2578  const XalanDOMString& theString,
2579  XalanDOMString& theResult);
2580 
2581 
2582 
2583 /**
2584  * Remove all elements from target string
2585  *
2586  * @deprecated This function is deprecated.
2587  *
2588  * @param theString target string
2589  */
2590 inline void
2592 {
2593  theString.clear();
2594 }
2595 
2596 
2597 
2598 /**
2599  * Remove all elements from target string
2600  *
2601  * @deprecated This function is deprecated.
2602  *
2603  * @param theString target string
2604  */
2605 inline void
2607 {
2608  theString.erase();
2609 }
2610 
2611 
2612 
2613 /**
2614  * Remove all elements from target string
2615  * and frees all allocated memory.
2616  *
2617  * @param theString target string
2618  */
2619 inline void
2620 releaseMemory(XalanDOMString& theString,MemoryManager& theManager)
2621 {
2622  XalanDOMString(theManager).swap(theString);
2623 }
2624 
2625 
2626 
2629  const XalanDOMChar* theString,
2630  CharVectorType& theVector);
2631 
2632 
2633 
2636  const char* theString,
2637  CharVectorType& theVector);
2638 
2639 
2640 
2641 /**
2642  * Utility function to make a null-terminated vector of XMLChs, from a
2643  * null-terminated array of chars, via transcoding, if requested.
2644  *
2645  * @param data array to be converted
2646  * @param whether or not to transcode
2647  * @return null-terminated vector of XalanDOMChar
2648  */
2651  const char* data,
2652  XalanDOMCharVectorType& result,
2653  bool fTranscode = true);
2654 
2655 
2656 
2657 /**
2658  * Utility function to make a null-terminated vector of XMLChs, from a
2659  * null-terminated array of XalanDOMChar.
2660  *
2661  * @param data array to be converted
2662  * @return null-terminated vector of XalanDOMChar
2663  */
2665 MakeXalanDOMCharVector(const XalanDOMChar* data,
2666  XalanDOMCharVectorType& result);
2667 
2668 
2669 
2670 /**
2671  * Utility function to make a null-terminated vector of XMLChs, from a
2672  * XalanDOMString
2673  *
2674  * @param data XalanDOMString to be converted
2675  * @return null-terminated vector of XalanDOMChar
2676  */
2677 inline XalanDOMCharVectorType&
2679  XalanDOMCharVectorType& result)
2680 {
2681  return MakeXalanDOMCharVector(data.c_str(),result);
2682 }
2683 
2684 
2685 
2686 #if defined(XALAN_NO_STD_NAMESPACE)
2687 struct c_wstr_functor : public unary_function<XalanDOMString, const XalanDOMChar*>
2688 #else
2689 struct c_wstr_functor : public std::unary_function<XalanDOMString, const XalanDOMChar*>
2690 #endif
2691 {
2692  result_type
2693  operator() (const argument_type& theString) const
2694  {
2695  return theString.c_str();
2696  }
2697 };
2698 
2699 
2700 
2701 /**
2702  * Less than functor for DOMStrings which ignores case for the characters a-z and A-Z
2703  *
2704  * @param theLHS first string to compare
2705  * @param theRHS second string to compare
2706  * @return true if the theLHS is less than theRHS, without respect to case.
2707  */
2708 #if defined(XALAN_NO_STD_NAMESPACE)
2709 struct DOMStringLessThanIgnoreCaseASCIIFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
2710 #else
2711 struct DOMStringLessThanIgnoreCaseASCIIFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
2712 #endif
2713 {
2714  result_type
2715  operator() (first_argument_type theLHS,
2716  second_argument_type theRHS) const
2717  {
2718  return compareIgnoreCaseASCII(theLHS, theRHS) < 0 ? true : false;
2719  }
2720 };
2721 
2722 
2723 
2724 /**
2725  * Less than or equal functor for DOMStrings
2726  *
2727  * @param theLHS first string to compare
2728  * @param theRHS second string to compare
2729  * @return true if the theLHS is less than or equal to theRHS
2730  */
2731 #if defined(XALAN_NO_STD_NAMESPACE)
2732 struct DOMStringLessThanOrEqualFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
2733 #else
2734 struct DOMStringLessThanOrEqualFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
2735 #endif
2736 {
2737  result_type
2738  operator() (first_argument_type theLHS,
2739  second_argument_type theRHS) const
2740  {
2741  return compare(theLHS, theRHS) <= 0 ? true : false;
2742  }
2743 };
2744 
2745 
2746 
2747 /**
2748  * Greater than functor for DOMStrings
2749  *
2750  * @param theLHS first string to compare
2751  * @param theRHS second string to compare
2752  * @return true if the theLHS is greater than theRHS
2753  */
2754 #if defined(XALAN_NO_STD_NAMESPACE)
2755 struct DOMStringGreaterThanFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
2756 #else
2757 struct DOMStringGreaterThanFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
2758 #endif
2759 {
2760  result_type
2761  operator() (first_argument_type theLHS,
2762  second_argument_type theRHS) const
2763  {
2764  return compare(theLHS, theRHS) > 0 ? true : false;
2765  }
2766 };
2767 
2768 
2769 
2770 /**
2771  * Greater than or equal functor for DOMStrings
2772  *
2773  * @param theLHS first string to compare
2774  * @param theRHS second string to compare
2775  * @return true if the theLHS is greater than or equal to theRHS
2776  */
2777 #if defined(XALAN_NO_STD_NAMESPACE)
2778 struct DOMStringGreaterThanOrEqualFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
2779 #else
2780 struct DOMStringGreaterThanOrEqualFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
2781 #endif
2782 {
2783  result_type
2784  operator() (first_argument_type theLHS,
2785  second_argument_type theRHS) const
2786  {
2787  return compare(theLHS, theRHS) >= 0 ? true : false;
2788  }
2789 };
2790 
2791 
2792 
2793 /**
2794  * This functor is designed to compare 0-terminated wide strings in a case-insensitive
2795  * manner. It substitutes for the default less<type*> so that the contents of wide strings
2796  * can be compared, rather than just the pointers.
2797  */
2798 #if defined(XALAN_NO_STD_NAMESPACE)
2799 struct less_no_case_ascii_wide_string : public binary_function<const XalanDOMChar*, const XalanDOMChar*, bool>
2800 #else
2801 struct less_no_case_ascii_wide_string : public std::binary_function<const XalanDOMChar*, const XalanDOMChar*, bool>
2802 #endif
2803 {
2804  /**
2805  * Compare the values of two objects.
2806  *
2807  *
2808  * @param theLHS first object to compare
2809  * @param theRHS second object to compare
2810  * @return true if objects are the same
2811  */
2812  result_type
2814  first_argument_type theLHS,
2815  second_argument_type theRHS) const
2816  {
2817  return compareIgnoreCaseASCII(theLHS, theRHS) < 0 ? true : false;
2818  }
2819 };
2820 
2821 
2822 
2823 /**
2824  * Determines if the string contains only whitespace
2825  *
2826  * @param theString target string
2827  * @return true if string contains only whitespace
2828  */
2830 isXMLWhitespace(const XalanDOMString& string);
2831 
2832 
2833 
2834 /**
2835  * Determines if a range in an array contains only whitespace
2836  *
2837  * @param ch target array
2838  * @param start starting index to examine
2839  * @param length number of characters to examine
2840  * @return true if specified range contains only whitespace
2841  */
2844  const XalanDOMChar ch[],
2847 
2848 
2849 
2850 /**
2851  * Determines if a null-terminated string contains only whitespace
2852  *
2853  * @param theString target string
2854  * @return true if the string contains only whitespace
2855  */
2856 inline bool
2857 isXMLWhitespace(const XalanDOMChar* theString)
2858 {
2859  assert(theString != 0);
2860 
2861  return isXMLWhitespace(theString, 0, length(theString));
2862 }
2863 
2864 
2865 
2866 XALAN_CPP_NAMESPACE_END
2867 
2868 
2869 
2870 #endif // DOMSTRINGHELPER_HEADER_GUARD_1357924680
toLowerCaseASCII(const XalanDOMChar *theString, XalanDOMString &theResult)
Converts ASCII alphabetic characters from upper case to lower case.
const XalanDOMChar * c_wstr(const XalanDOMString &theString)
Get the underlying representation of the target XalanDOMString as a null-terminated string...
XalanDOMChar toLowerASCII(XalanDOMChar theChar)
Converts ASCII alphabetic characters from upper case to lower case.
startsWith(const XalanDOMChar *theString, XalanDOMString::size_type theStringLength, const XalanDOMChar *theSubstring, XalanDOMString::size_type theSubstringLength)
Simulates the java String method startsWith().
void reserve(XalanDOMString &theString, XalanDOMString::size_type theCount)
Reserve some space in the string for more efficient concatenation...
OutputString(XalanOutputStream &theStream, const CharVectorType &theString)
Outputs the target string to the specified stream.
void reserve(size_type theCount=0)
XalanDOMString & assign(XalanDOMString &theString, const XalanDOMString &theStringToAssign)
Assign one string to another.
Greater than functor for DOMStrings.
toUpperCaseASCII(const XalanDOMChar *theString, XalanDOMString &theResult)
Converts ASCII alphabetic characters from lower case to upper case.
void erase(XalanDOMString &theString)
Remove all elements from target string.
lastIndexOf(const XalanDOMChar *theString, XalanDOMChar theChar)
Simulates the java String method lastIndexOf().
equalsIgnoreCaseASCII(const XalanDOMChar *theLHS, const XalanDOMChar *theRHS, XalanDOMString::size_type theLength)
Compare the contents of two arrays for equality, without regard for case.
void swap(XalanDOMString &theOther)
unsigned long DOMStringToUnsignedLong(const XalanDOMString &theString)
Converts a XalanDOMString into a long value.
WideStringToLong(const XalanDOMChar *theString)
Converts a wide string into a long value.
static bool isLetter(XalanDOMChar c)
OutputIteratorType XalanTransform(InputIteratorType begin, InputIteratorType end, OutputIteratorType iterator, UnaryFunction function)
double DOMStringToDouble(const XalanDOMString &theString, MemoryManager &theMemoryManager)
Converts a XalanDOMString into a double value.
XalanDOMString & insert(size_type thePosition, const XalanDOMString &theString)
PointerToDOMString(const void *theValue, XalanDOMString &theResult)
Converts a pointer into a XalanDOMString.
iterator erase(iterator thePosition)
void clear(XalanDOMString &theString)
Remove all elements from target string.
compare(const CharVectorType &theLHS, const CharVectorType &theRHS)
Compare the contents of two strings.
Less than functor for DOMStrings which ignores case for the characters a-z and A-Z.
WideStringToInt(const XalanDOMChar *theString)
Converts a wide string into an integer value.
XalanDOMString::size_type indexOf(const XalanDOMChar *theString, XalanDOMChar theChar)
Simulates the java String method indexOf().
XalanDOMString & append(XalanDOMString &theString, const XalanDOMString &theStringToAppend)
Concatenate two strings.
XalanSize_t size_type
void releaseMemory(XalanDOMString &theString, MemoryManager &theManager)
Remove all elements from target string and frees all allocated memory.
This functor is designed to compare 0-terminated wide strings in a case-insensitive manner...
XalanOutputStream & operator<<(XalanOutputStream &theStream, const CharVectorType &theString)
Outputs the string to the specified stream.
const XalanDOMChar * c_str() const
long DOMStringToLong(const XalanDOMString &theString)
Converts a XalanDOMString into a long value.
bool operator<(const CharVectorType &theLHS, const CharVectorType &theRHS)
Implements operator< for CharVectorType.
XalanDOMString & assign(const XalanDOMChar *theSource)
int DOMStringToInt(const XalanDOMString &theString)
Converts a XalanDOMString into an integer value.
WideStringToUnsignedLong(const XalanDOMChar *theString)
Converts a wide string into an unsigned long value.
A SAX-based formatter interface for the XSL processor.
#define XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(T)
#define XALAN_NO_STD_NAMESPACE
UINT64 XALAN_UINT64
OutputIteratorType XalanCopy(InputIteratorType begin, InputIteratorType end, OutputIteratorType iterator)
collationCompare(const XalanDOMChar *theLHS, XalanDOMString::size_type theLHSLength, const XalanDOMChar *theRHS, XalanDOMString::size_type theRHSLength)
Compare the contents of two character arrays.
bool empty() const
size_type length() const
endsWith(const XalanDOMChar *theString, XalanDOMString::size_type theStringLength, const XalanDOMChar *theSubstring, XalanDOMString::size_type theSubstringLength)
Simulates the java String method endsWith().
const char * c_str(const CharVectorType &theString)
Get the underlying representation of the target CharVectorType as a null-terminated string...
size_type size() const
substring(const XalanDOMChar *theString, XalanDOMString &theSubstring, XalanDOMString::size_type theStartIndex, XalanDOMString::size_type theEndIndex=XalanDOMString::npos)
Simulates the java String method substring().
MemoryManager & getMemoryManager()
result_type operator()(first_argument_type theLHS, second_argument_type theRHS) const
Compare the values of two objects.
NumberToDOMString(double theValue, XalanDOMString &theResult)
Converts a double value into a XalanDOMString.
static MemoryManager & getDefault()
bool isXMLLetterOrDigit(XalanDOMChar theChar)
Determines whether character represents a letter or digit.
bool empty() const
compareIgnoreCaseASCII(const XalanDOMChar *theLHS, XalanDOMString::size_type theLHSLength, const XalanDOMChar *theRHS, XalanDOMString::size_type theRHSLength)
Compare the contents of two arrays in a case insensitive manner.
INT64 XALAN_INT64
XalanDOMChar toUpperASCII(XalanDOMChar theChar)
Converts ASCII alphabetic characters from lower case to upper case.
static bool isWhitespace(XalanDOMChar c)
MakeXalanDOMCharVector(const char *data, XalanDOMCharVectorType &result, bool fTranscode=true)
Utility function to make a null-terminated vector of XMLChs, from a null-terminated array of chars...
WideStringToDouble(const XalanDOMChar *theString, MemoryManager &theMemoryManager)
Converts a wide string into a double value.
Less than or equal functor for DOMStrings.
XalanDOMChar charAt(const XalanDOMString &theString, XalanDOMString::size_type theIndex)
Retrieves a character at a specified index in the target string.
CopyStringToVector(const char *theString, CharVectorType &theVector)
Greater than or equal functor for DOMStrings.
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
XalanDOMString & append(const XalanDOMString &theSource)
const XalanDOMChar * toCharArray(const XalanDOMString &theString)
Get the underlying representation of the target XalanDOMString as an array of XalanDOMChar, not guaranteed to be null-terminated.
NumberToHexDOMString(XALAN_UINT64 theValue, XalanDOMString &theResult)
Converts an 64-bit unsigned value into a XalanDOMString.
#define XALAN_PLATFORMSUPPORT_EXPORT
bool isXMLDigit(XalanDOMChar theChar)
Determines whether character represents a digit.
bool isXMLWhitespace(XalanDOMChar theChar)
Determines whether character represents white space.
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.
XalanDOMChar flipCaseASCII(XalanDOMChar theChar)
Flips the case to of the supplied character.
bool isEmpty(const XalanDOMString &str)
Determines if the target string contains any elements.
XALAN_CPP_NAMESPACE_BEGIN XALAN_USING_XERCES(Locator)
equals(const XalanDOMChar *theLHS, const XalanDOMChar *theRHS, XalanDOMString::size_type theLength)
Compare the contents of two arrays for equality.
trim(const XalanDOMString &theString, XalanDOMString &theResult)
Remove leading and trailing whitespace.
XalanDOMString & insert(XalanDOMString &theString, XalanDOMString::size_type thePosition, const XalanDOMString &theStringToInsert)
Insert a string into another string.
static bool isDigit(XalanDOMChar c)
CopyWideStringToVector(const XalanDOMChar *theString, CharVectorType &theVector)

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.11
Copyright © 1999-2012 The Apache Software Foundation.
All Rights Reserved.

Apache Logo