1 mike 1.18 //%/////////////////////////////////////////////////////////////////////////////
|
2 mike 1.1 //
3 // Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a
6 // copy of this software and associated documentation files (the "Software"),
7 // to deal in the Software without restriction, including without limitation
8 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 // and/or sell copies of the Software, and to permit persons to whom the
10 // Software is furnished to do so, subject to the following conditions:
11 //
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
15 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18 // DEALINGS IN THE SOFTWARE.
19 //
|
20 mike 1.18 //==============================================================================
|
21 mike 1.1 //
|
22 mike 1.18 // Author: Mike Brasher (mbrasher@bmc.com)
|
23 mike 1.1 //
|
24 mike 1.18 // Modified By:
|
25 mike 1.17 //
|
26 mike 1.18 //%/////////////////////////////////////////////////////////////////////////////
|
27 mike 1.1
28 #ifndef Pegasus_String_h
29 #define Pegasus_String_h
30
31 #include <iostream>
32 #include <cstring>
33 #include <Pegasus/Common/Config.h>
34 #include <Pegasus/Common/Char16.h>
35 #include <Pegasus/Common/Array.h>
36
37 PEGASUS_NAMESPACE_BEGIN
38
|
39 karl 1.2 /**
|
40 karl 1.12 The Pegasus String C++ Class implements the CIM string type.
41 This class is based on the general handle/representation pattern
42 defined for all the Pegasus objects. However, it differes from
|
43 karl 1.24 most in that it implements "copy on assign" all of the others implement
|
44 mike 1.22 "no copy on assign" semantics. The string class uses the Array class and
|
45 karl 1.12 implements an array of characters.
|
46 mike 1.22 */
|
47 mike 1.1 class PEGASUS_COMMON_LINKAGE String
48 {
49 public:
50
|
51 karl 1.24 /** Default constructor without parameters. This constructor creates a
|
52 karl 1.12 null string
53 <pre>
54 String test;
|
55 karl 1.24 </pre>
|
56 karl 1.12 */
|
57 mike 1.1 String();
|
58 mike 1.6
59 /// Copy constructor.
|
60 mike 1.1 String(const String& x);
|
61 mike 1.6
62 /// Initialize with first n characters from x.
|
63 mike 1.1 String(const String& x, Uint32 n);
|
64 mike 1.6
65 /// Initialize with x.
|
66 mike 1.1 String(const Char16* x);
|
67 mike 1.6
68 /// Initialize with first n characters of x.
|
69 mike 1.1 String(const Char16* x, Uint32 n);
|
70 mike 1.6
71 /// Initialize from a plain old C-String:
|
72 mike 1.1 String(const char* x);
|
73 mike 1.6
74 /// Initialize from the first n characters of a plain old C-String:
|
75 mike 1.1 String(const char* x, Uint32 n);
76
|
77 karl 1.12 /// String destructor. Used by the representation of the String object
|
78 karl 1.24 ~String()
|
79 mike 1.6 {
80 }
81
|
82 karl 1.12 /** Assign this string with x.
83 <pre>
84 String t1 = "abc";
85 String t2 = t1;
86 </pre>
87 */
|
88 mike 1.1 String& operator=(const String& x) { _rep = x._rep; return *this; }
|
89 mike 1.6
|
90 karl 1.25 /// Assign this string with Char16 x.
|
91 mike 1.1 String& operator=(const Char16* x) { assign(x); return *this; }
|
92 mike 1.6
|
93 karl 1.25 /** Assign this string with String x
94 @param x String to assign
95 @return Returns the String
|
96 sage 1.26 */
|
97 mike 1.1 String& assign(const String& x) { _rep = x._rep; return *this; }
|
98 mike 1.6
99 /// Assign this string with x.
|
100 mike 1.1 String& assign(const Char16* x);
|
101 mike 1.6
102 /// Assign this string with first n characters of x.
|
103 mike 1.1 String& assign(const Char16* x, Uint32 n);
|
104 mike 1.6
105 /// Assign this string with the plain old C-String x.
|
106 mike 1.1 String& assign(const char* x);
|
107 mike 1.6
108 /// Assign this string with first n characters of the plain old C-String x.
|
109 mike 1.1 String& assign(const char* x, Uint32 n);
|
110 mike 1.6
|
111 karl 1.25 /** clear - Clear this string. After calling clear(), size() will return 0.
|
112 karl 1.12 <pre>
113 String test = "abc";
114 test.clear(); // String test is now NULL (length == 0)
115 </pre>
116 */
|
117 mike 1.1 void clear() { _rep.clear(); _rep.append('\0'); }
|
118 mike 1.4
|
119 karl 1.25 /** reserve - Reserves memory for capacity characters. Notice that this does
120 not
|
121 mike 1.22 change the size of the string (size() returns what it did before).
|
122 mike 1.6 If the capacity of the string is already greater or equal to the
123 capacity argument, this method has no effect. After calling reserve(),
|
124 karl 1.24 getCapicty() returns a value which is greater or equal to the
|
125 mike 1.6 capacity argument.
|
126 karl 1.12 @param capacity defines the capacity in characters to reserve.
|
127 karl 1.2 */
|
128 mike 1.1 void reserve(Uint32 capacity) { _rep.reserve(capacity + 1); }
|
129 mike 1.4
|
130 karl 1.12 /** Returns the length of the String object.
131 @return Length of the string in characters.
132 <pre>
133 String s = "abcd";
|
134 mike 1.22 assert(s.size() == 4);
|
135 karl 1.12 </pre>
136 */
|
137 mike 1.22 Uint32 size() const { return _rep.size() - 1; }
|
138 mike 1.4
|
139 karl 1.24 /** Returns a pointer to the first character in the null-terminated string
|
140 karl 1.12 string.
141 @return Pointer to the first character of the String object
142 <pre>
143 String t1 = "abc";
144 const Char16* q = t1.getData();
145 </pre>
146 */
|
147 mike 1.1 const Char16* getData() const { return _rep.getData(); }
148
|
149 karl 1.25 /** AallocateCString - llocates an 8 bit representation of this string. The
150 user is
|
151 karl 1.24 responsible for freeing the result. If any characters are truncated,
|
152 mike 1.6 a TruncatedCharacter exception is thrown. This exception may
153 be suppressed by passing true as the noThrow argument. Extra
154 characters may be allocated at the end of the new string by
155 passing a non-zero value to the extraBytes argument.
|
156 karl 1.24 @param extraBytes Defines the number of extra characters to be
|
157 karl 1.12 allocated at the end of the new string. Default is zero.
|
158 karl 1.24 @param noThrow If true, no exception will be thrown if characters
|
159 karl 1.12 are truncated
160 @return pointer to the new representation of the string
161 @exception Throws TruncatedCharacter exception if any characters are
162 truncated
163 <pre>
164 String test = "abc";
165 char* p = test.allocateCString();
166 </pre>
|
167 mike 1.6 */
|
168 mike 1.1 char* allocateCString(Uint32 extraBytes = 0, Boolean noThrow = false) const;
169
|
170 karl 1.25 /** appendToCString - Append the given string to a C-string. If the length
171 is not Uint32(-1),
|
172 karl 1.24 then the lesser of the the length argument and the length of this
173 string is truncated. Otherwise, the entire string is trunctated. The
|
174 mike 1.6 TruncatedCharacter exception is thrown if any characters are truncated.
|
175 karl 1.11 <pre>
176 const char STR0[] = "one two three four";
177 String s = STR0;
178 const char STR1[] = "zero ";
|
179 mike 1.22 char* tmp = new char[strlen(STR1) + s.size() + 1];
|
180 karl 1.11 strcpy(tmp, STR1);
181 s.appendToCString(tmp, 7);
182 assert(strcmp(tmp, "zero one two") == 0);
183 </pre>
|
184 karl 1.2 */
|
185 mike 1.1 void appendToCString(
|
186 karl 1.2 char* str,
|
187 mike 1.1 Uint32 length = Uint32(-1),
188 Boolean noThrow = false) const;
189
|
190 karl 1.12 /** Returns the Ith character of the String object.
|
191 mike 1.15 @exception - Throws exception "OutofBounds" if the index
192 is outside the length of the string.
193 <pre>
194 String t1 = "abc;
195 Char16 c = t1[1]; // character b
196 </pre>
|
197 karl 1.12 */
|
198 mike 1.1 Char16& operator[](Uint32 i);
199
|
200 karl 1.12 /** Returns the Ith character of the String (const version).
|
201 mike 1.15 @exception - Throws exception "OutofBounds" if the index
202 is outside the length of the string.
|
203 karl 1.24
|
204 karl 1.12 */
|
205 mike 1.1 const Char16 operator[](Uint32 i) const;
|
206 mike 1.6
|
207 karl 1.11 /** Append the given character to the string.
208 <pre>
209 String s4 = "Hello";
210 s4.append(Char16(0x0000))
211 </pre>
212 */
|
213 karl 1.2 String& append(const Char16& c)
214 {
|
215 mike 1.22 _rep.insert(_rep.size() - 1, c);
|
216 mike 1.1 return *this;
217 }
|
218 mike 1.6
|
219 karl 1.12 /// Append n characters from str to this String object.
|
220 mike 1.1 String& append(const Char16* str, Uint32 n);
|
221 mike 1.6
|
222 karl 1.12 /// Append the characters of str to this String object.
|
223 karl 1.2 String& append(const String& str)
|
224 mike 1.1 {
|
225 mike 1.22 return append(str.getData(), str.size());
|
226 mike 1.1 }
|
227 mike 1.6
|
228 karl 1.12 /** Overload operator += appends the parameter String to this String.
|
229 karl 1.24 @param String to append.
|
230 mike 1.15 @return This String
231 <pre>
232 String test = "abc";
233 test += "def";
234 assert(test == "abcdef");
235 </pre>
|
236 karl 1.12 */
|
237 mike 1.1 String& operator+=(const String& x)
238 {
239 return append(x);
240 }
|
241 mike 1.6
|
242 karl 1.12 /** Append the character given by c to this String object.
|
243 karl 1.24 @param c Single character to be appended
244 @return String with appended character
|
245 karl 1.12 */
|
246 mike 1.1 String& operator+=(Char16 c)
247 {
248 return append(c);
249 }
|
250 mike 1.6
|
251 karl 1.12 /** Append the character given by c to this string.
|
252 mike 1.15 <pre>
253 String t1 = "abc";
254 t1 += 'd'
255 assert(t1 == "abcd");
256 </pre>
|
257 karl 1.12 */
|
258 mike 1.1 String& operator+=(char c)
259 {
260 return append(Char16(c));
261 }
|
262 mike 1.3
|
263 mike 1.6 /** Remove size characters from the string starting at the given
264 position. If size is -1, then all characters after pos are removed.
|
265 karl 1.24 @param pos Position in string to start remove
266 @param size Number of characters to remove. Default is -1 which
|
267 karl 1.12 causes all characters after pos to be removed
268 <pre>
269 String s;
270 s = "abc";
271 s.remove(0, 1);
272 assert(String::equal(s, "bc"));
|
273 mike 1.22 assert(s.size() == 2);
|
274 karl 1.12 s.remove(0);
275 assert(String::equal(s, ""));
|
276 mike 1.22 assert(s.size() == 0);
|
277 karl 1.12 </pre>
278 @exception throws "OutOfBounds" exception if size is greater than
279 length of String plus starting position for remove.
|
280 mike 1.6 */
|
281 mike 1.1 void remove(Uint32 pos, Uint32 size = Uint32(-1));
|
282 mike 1.3
|
283 karl 1.24 /** Return a new String which is initialzed with <TT>length</TT>
284 characters from this string starting at <TT>pos</TT>.
285 @param <TT>pos</TT> is the positon in string to start getting the
286 substring.
|
287 karl 1.8 @param <TT>length</TT> is the number of characters to get. If length
288 is -1, then all characters after pos are added to the new string.
289 @return String with the defined substring.
|
290 karl 1.11 <pre>
291 s = "abcdefg";
292 s.remove(3);
293 assert(String::equal(s, "abc"));
294 </pre>
|
295 mike 1.6 */
|
296 mike 1.1 String subString(Uint32 pos, Uint32 length = Uint32(-1)) const;
|
297 mike 1.3
|
298 mike 1.7 /** Find the position of the first occurence of the character c.
299 If the character is not found, -1 is returned.
|
300 karl 1.24 @param c Char to be found in the String
|
301 karl 1.12 @return Position of the character in the string or -1 if not found.
|
302 mike 1.6 */
|
303 mike 1.1 Uint32 find(Char16 c) const;
|
304 mike 1.7
|
305 karl 1.24 /** Find the position of the first occurence of the string object.
|
306 karl 1.12 This function finds one string inside another
307 If the matching substring is not found, -1 is returned.
|
308 karl 1.24 @param s String object to be found in the String
309 @return Position of the substring in the String or -1 if not
310 found.
|
311 mike 1.14 */
|
312 karl 1.13 Uint32 find(const String& s) const;
|
313 karl 1.12
314 /** Find substring
|
315 karl 1.25 @ param 16 bit character pointer
|
316 karl 1.12 @seealso find
|
317 karl 1.25 @return Position of the substring in the String or -1 if not
318 found.
|
319 karl 1.12 */
320 Uint32 find(const Char16* s) const;
|
321 mike 1.14
|
322 karl 1.12 /** find substring
|
323 karl 1.25 @param s char* to substring
324 @return Position of the substring in the String or -1 if not
325 found.
|
326 karl 1.12 */
327 Uint32 find(const char* s) const;
|
328 karl 1.24
|
329 karl 1.25 /** reverseFind - Same as find() but start looking in reverse (last
330 character first).
331 @param c Char16 character to find in String.
|
332 karl 1.12 @Seealso find
333 @return Position of the character in the string or -1 if not found.
|
334 karl 1.24
335 NOTE: This function is defined only for char* input, not for
336 String.
|
337 mike 1.7 */
338 Uint32 reverseFind(Char16 c) const;
|
339 mike 1.3
|
340 mike 1.19 /** Converts all characters in this string to lower case.
341 */
342 void toLower();
343
|
344 mike 1.21 /** Translate any occurences of fromChar to toChar.
345 */
346 void translate(Char16 fromChar, Char16 toChar);
347
|
348 karl 1.24 /** Compare the first n characters of the two strings.
349 @param s1 First null-terminated string for the comparison
350 @param s2 Second null-terminated string for the comparison
351 @param n Number of characters to compare
|
352 karl 1.12 @return Return -1 if s1 is lexographically less than s2. If they
353 are equavalent return 0. Otherwise return 1.
|
354 mike 1.6 */
|
355 mike 1.1 static int compare(const Char16* s1, const Char16* s2, Uint32 n);
|
356 mike 1.3
|
357 karl 1.24 /** Compare two null-terminated strings.
358 @param s1 First null-terminated string for the comparison
359 @param s2 Second null-terminated string for the comparison
|
360 karl 1.12 @return If s1 is less than s2, return -1; if equal return 0;
361 otherwise, return 1.
|
362 karl 1.24
|
363 karl 1.12 NOTE: Use the comparison operators <,<= > >= to compare
364 String objects.
|
365 mike 1.6 */
|
366 mike 1.1 static int compare(const Char16* s1, const Char16* s2);
|
367 mike 1.3
|
368 karl 1.12 /** Compare two String objects for equality.
|
369 karl 1.24 @param s1 First <TT>String</TT> for comparison.
370 @param s2 Second <TT>String</TT> for comparison.
371
|
372 karl 1.12 @return Boolean true if the two strings are equal.
|
373 karl 1.11 <pre>
374 String s1 = "Hello World";
375 String s2 = s1;
376 String s3(s2);
377 assert(String::equal(s1, s3));
378 </pre>
379 */
|
380 mike 1.9 static Boolean equal(const String& x, const String& y);
381
|
382 karl 1.12 /// Return true if the two strings are equal.
|
383 mike 1.9 static Boolean equal(const String& x, const Char16* y);
384
|
385 karl 1.12 /// Return true if the two strings are equal.
|
386 mike 1.9 static Boolean equal(const Char16* x, const String& y);
387
|
388 karl 1.12 /// Return true if the two strings are equal.
|
389 mike 1.9 static Boolean equal(const String& x, const char* y);
390
|
391 karl 1.11 /// Return true if the two strings are equal.
|
392 mike 1.9 static Boolean equal(const char* x, const String& y);
393
|
394 mike 1.20 static Boolean equalIgnoreCase(const String& x, const String& y);
395
|
396 mike 1.6 /// Convert the plain old C-string to lower case:
397 static void toLower(char* str);
398
|
399 karl 1.10 /** EMPTY - Represent an empty string.
|
400 mike 1.6 This member is used to represent empty strings. Using this member
|
401 karl 1.10 avoids an expensive construction of an empty string (e.g., String()).
|
402 mike 1.6 */
|
403 mike 1.1 static const String EMPTY;
404
405 private:
406
407 static Uint32 _min(Uint32 x, Uint32 y) { return x < y ? x : y; }
408
|
409 karl 1.2 Array<Char16> _rep;
|
410 mike 1.1 };
411
|
412 karl 1.24 /** String operator ==. Test for equality between two strings of any of the
|
413 karl 1.12 types String or char*.
414 @return Boolean - True if the strings are equal
|
415 karl 1.24
|
416 karl 1.12 */
|
417 mike 1.9 inline Boolean operator==(const String& x, const String& y)
418 {
419 return String::equal(x, y);
420 }
|
421 mike 1.1
|
422 karl 1.12 /** String operator ==. Test for equality between two strings
|
423 karl 1.24
424 */
|
425 mike 1.9 inline Boolean operator==(const String& x, const char* y)
426 {
427 return String::equal(x, y);
428 }
|
429 mike 1.1
|
430 karl 1.12 /** String operator ==. Test for equality between two strings
|
431 karl 1.24
|
432 karl 1.12 */
|
433 mike 1.9 inline Boolean operator==(const char* x, const String& y)
434 {
435 return String::equal(x, y);
436 }
|
437 mike 1.1
|
438 karl 1.12 /** String operator ==. Test for equality between two strings
|
439 karl 1.24
440 */
|
441 mike 1.1 inline Boolean operator!=(const String& x, const String& y)
442 {
|
443 mike 1.9 return !String::equal(x, y);
|
444 mike 1.1 }
445
|
446 mike 1.6 PEGASUS_COMMON_LINKAGE std::ostream& operator<<(
|
447 karl 1.24 std::ostream& os,
|
448 mike 1.6 const String& x);
|
449 mike 1.1
|
450 karl 1.12 /** overload operator + - Concatenates String objects.
|
451 karl 1.24
|
452 karl 1.12 <pre>
453 String t1 = "abc";
454 String t2;
455 t2 = t1 + "def"
456 assert(t2 == "abcdef");
457 </pre>
458 */
|
459 mike 1.1 inline String operator+(const String& x, const String& y)
460 {
461 return String(x).append(y);
462 }
|
463 mike 1.15
|
464 karl 1.12 /** overload operator < - Compares String obects.
465 <pre>
466 String t1 = "def";
467 String t2 = "a";
468 assert (t2 < t1);
469 </pre>
470 */
|
471 mike 1.1 inline Boolean operator<(const String& x, const String& y)
472 {
473 return String::compare(x.getData(), y.getData()) < 0;
474 }
|
475 mike 1.15
476 /** overload operator <= compares String objects.
|
477 mike 1.1
|
478 karl 1.12 */
|
479 mike 1.1 inline Boolean operator<=(const String& x, const String& y)
480 {
481 return String::compare(x.getData(), y.getData()) <= 0;
482 }
|
483 mike 1.15
|
484 karl 1.12 /** Overload operator > compares String objects
485 */
|
486 mike 1.1 inline Boolean operator>(const String& x, const String& y)
487 {
488 return String::compare(x.getData(), y.getData()) > 0;
489 }
|
490 mike 1.15
|
491 karl 1.12 /** overload operator >= - Compares String objects
492 */
|
493 mike 1.1 inline Boolean operator>=(const String& x, const String& y)
494 {
495 return String::compare(x.getData(), y.getData()) >= 0;
496 }
|
497 mike 1.6
498 /** Return a version of this string whose characters have been shifted
499 to lower case.
500 */
501 PEGASUS_COMMON_LINKAGE String ToLower(const String& str);
|
502 mike 1.15
503 /** Compare two strings but ignore any case differences.
504 */
505 PEGASUS_COMMON_LINKAGE int CompareIgnoreCase(const char* s1, const char* s2);
|
506 mike 1.16
507 /** Get the next line from the input file.
508 */
509 PEGASUS_COMMON_LINKAGE Boolean GetLine(std::istream& is, String& line);
|
510 mike 1.6
|
511 mike 1.17 /* This is an internal class not to be used by the internal Pegasus
512 components only. It provides an easy way to create an 8-bit string
513 representation on the fly without calling allocateCString() and
514 then worrying about deleting the string. The underscore before the
515 class name denotes that this class is internal, unsupported, undocumented,
516 and may be removed in future releases.
517 */
518 class _CString
519 {
520 public:
521
522 _CString(const String& x)
523 {
524 _rep = x.allocateCString();
525 }
526
527 _CString(const _CString& x)
528 {
529 _rep = strcpy(new char[strlen(x._rep) + 1], x._rep);
530 }
531
532 mike 1.17 ~_CString()
533 {
534 delete [] _rep;
535 }
536
537 _CString& operator=(const _CString& x)
538 {
539 if (this != &x)
540 _rep = strcpy(new char[strlen(x._rep) + 1], x._rep);
541
542 return *this;
543 }
544
545 operator const char*() const
546 {
547 return _rep;
548 }
549
550 const char* data() const
551 {
552 return _rep;
553 mike 1.17 }
554
555 private:
556
557 char* _rep;
558 };
|
559 mike 1.22
560 inline Uint32 _Length(const String& s1) { return s1.size(); }
561
562 inline Uint32 _Length(const char* s1) { return strlen(s1); }
563
564 inline Uint32 _Length(const char) { return 1; }
565
566 template<class S1, class S2>
567 inline String Cat(const S1& s1, const S2& s2)
568 {
569 String tmp;
570 tmp.reserve(_Length(s1) + _Length(s2));
571 tmp.append(s1);
572 tmp.append(s2);
573 return tmp;
574 }
575
576 template<class S1, class S2, class S3>
577 inline String Cat(const S1& s1, const S2& s2, const S3& s3)
578 {
579 String tmp;
580 mike 1.22 tmp.reserve(_Length(s1) + _Length(s2) + _Length(s3));
581 tmp.append(s1);
582 tmp.append(s2);
583 tmp.append(s3);
584 return tmp;
585 }
586
587 template<class S1, class S2, class S3, class S4>
588 inline String Cat(const S1& s1, const S2& s2, const S3& s3, const S4& s4)
589 {
590 String tmp;
591 tmp.reserve(_Length(s1) + _Length(s2) + _Length(s3) + _Length(s4));
592 tmp.append(s1);
593 tmp.append(s2);
594 tmp.append(s3);
595 tmp.append(s4);
596 return tmp;
597 }
|
598 mike 1.1
|
599 mike 1.23 template<class S1, class S2, class S3, class S4, class S5>
600 inline String Cat(
|
601 karl 1.24 const S1& s1,
602 const S2& s2,
603 const S3& s3,
604 const S4& s4,
|
605 mike 1.23 const S5& s5)
606 {
607 String tmp;
608
|
609 karl 1.24 tmp.reserve(_Length(s1) + _Length(s2) + _Length(s3) + _Length(s4) +
|
610 mike 1.23 _Length(s5));
611
612 tmp.append(s1);
613 tmp.append(s2);
614 tmp.append(s3);
615 tmp.append(s4);
616 tmp.append(s5);
617
618 return tmp;
619 }
620
621 template<class S1, class S2, class S3, class S4, class S5, class S6>
622 inline String Cat(
|
623 karl 1.24 const S1& s1,
624 const S2& s2,
625 const S3& s3,
626 const S4& s4,
|
627 mike 1.23 const S5& s5,
628 const S6& s6)
629 {
630 String tmp;
631
|
632 karl 1.24 tmp.reserve(_Length(s1) + _Length(s2) + _Length(s3) + _Length(s4) +
|
633 mike 1.23 _Length(s5) + _Length(s6));
634
635 tmp.append(s1);
636 tmp.append(s2);
637 tmp.append(s3);
638 tmp.append(s4);
639 tmp.append(s5);
640 tmp.append(s6);
641
642 return tmp;
643 }
644
|
645 mike 1.1 PEGASUS_NAMESPACE_END
646
647 #endif /* Pegasus_String_h */
|
648 karl 1.25
|