1 karl 1.96 //%2006////////////////////////////////////////////////////////////////////////
|
2 mike 1.38 //
|
3 karl 1.86 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 karl 1.78 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.86 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.87 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.96 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 mike 1.38 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
15 kumpf 1.50 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
18 mike 1.38 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
|
20 karl 1.96 //
|
21 kumpf 1.50 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
22 mike 1.38 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
24 kumpf 1.50 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
27 mike 1.38 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
31 //
32 //%/////////////////////////////////////////////////////////////////////////////
33
34 #ifndef Pegasus_String_h
35 #define Pegasus_String_h
36
|
37 kumpf 1.71 #ifdef PEGASUS_OS_HPUX
|
38 kumpf 1.72 # ifdef HPUX_IA64_NATIVE_COMPILER
39 # include <iostream>
40 # else
41 # include <iostream.h>
42 # endif
|
43 kumpf 1.71 #else
44 # include <iostream>
45 #endif
|
46 mike 1.38 #include <Pegasus/Common/Config.h>
47 #include <Pegasus/Common/Char16.h>
|
48 kumpf 1.54 #include <Pegasus/Common/Linkage.h>
|
49 mike 1.38
50 PEGASUS_NAMESPACE_BEGIN
51
|
52 kumpf 1.59 class String;
|
53 mike 1.90 struct StringRep;
|
54 kumpf 1.51
|
55 kumpf 1.59 /** The CString class provides access to an 8-bit String representation.
56 */
|
57 kumpf 1.60 class PEGASUS_COMMON_LINKAGE CString
|
58 kumpf 1.59 {
59 public:
60
|
61 karl 1.79 /** Constructs a CString object with null values (default constructor).
62 */
|
63 kumpf 1.59 CString();
64
|
65 karl 1.79 /** REVIEWERS: Describe method here.
|
66 david.dillard 1.89 @param cstr Specifies the name of the CString instance to copy.
|
67 karl 1.79 */
|
68 kumpf 1.59 CString(const CString& cstr);
69
|
70 karl 1.79 /** CString destructor.
71 */
|
72 kumpf 1.59 ~CString();
73
|
74 karl 1.79 /** Assigns the values of one CString instance to another.
|
75 david.dillard 1.89 @param cstr Specifies the name of the CString instance whose values
|
76 karl 1.79 are assigned to CString.
77 */
|
78 kumpf 1.62 CString& operator=(const CString& cstr);
79
|
80 david.dillard 1.89 /** Gets a pointer to the CString's data.
81 @return Returns a const char pointer to the CString's data.
|
82 karl 1.79 */
|
83 kumpf 1.59 operator const char*() const;
84
85 private:
86
87 CString(char* cstr);
88
89 friend class String;
90
|
91 mike 1.90 char* _rep;
|
92 kumpf 1.59 };
93
|
94 mike 1.38 /**
95 The Pegasus String C++ Class implements the CIM string type.
|
96 karl 1.79 REVIEWERS: We need more definition here.
|
97 mike 1.38 */
98 class PEGASUS_COMMON_LINKAGE String
99 {
100 public:
101
|
102 david.dillard 1.89 /** This member is used to represent an empty string. Using this
|
103 karl 1.79 member avoids construction of an empty string (for example, String()).
|
104 kumpf 1.48 */
105 static const String EMPTY;
106
|
107 mike 1.38 /** Default constructor without parameters. This constructor creates a
|
108 david.dillard 1.89 null string. For example,
109 <pre>
110 String test;
111 </pre>
112 @exception bad_alloc Thrown if there is insufficient memory.
|
113 mike 1.38 */
114 String();
115
|
116 karl 1.79 /** Copy constructor.
117 @param str Specifies the name of the String instance.
|
118 david.dillard 1.89 @exception bad_alloc Thrown if there is insufficient memory.
|
119 karl 1.79 */
|
120 kumpf 1.48 String(const String& str);
|
121 mike 1.38
|
122 david.dillard 1.89 /** Initialize with first <TT>n</TT> characters from <TT>str</TT>.
|
123 karl 1.79 @param str Specifies the name of the String instance.
|
124 mike 1.90 @param n Specifies Uint32 size to use for the length of the string object.
|
125 david.dillard 1.89 @exception bad_alloc Thrown if there is insufficient memory.
|
126 karl 1.79 */
|
127 kumpf 1.48 String(const String& str, Uint32 n);
|
128 mike 1.38
|
129 karl 1.79 /** Initialize with str.
130 @param str Specifies the name of the String instance.
|
131 david.dillard 1.89 @exception NullPointer Thrown if str is NULL.
132 @exception bad_alloc Thrown if there is insufficient memory.
|
133 karl 1.79 */
|
134 kumpf 1.48 String(const Char16* str);
|
135 mike 1.38
|
136 karl 1.79 /** Initialize with first n characters of str.
137 @param str Specifies the name of the String instance.
138 @param n Specifies the Uint32 size.
|
139 david.dillard 1.89 @exception NullPointer Thrown if str is NULL.
140 @exception bad_alloc Thrown if there is insufficient memory.
|
141 karl 1.79 */
|
142 kumpf 1.48 String(const Char16* str, Uint32 n);
|
143 mike 1.38
|
144 karl 1.79 /** Initialize from a plain C-String:
145 @param str Specifies the name of the String instance.
|
146 david 1.81 API supports UTF8
|
147 david.dillard 1.89 @exception NullPointer Thrown if str is NULL.
148 @exception bad_alloc Thrown if there is insufficient memory.
|
149 karl 1.79 */
|
150 kumpf 1.48 String(const char* str);
|
151 chuck 1.77
|
152 david.dillard 1.89 /** Initialize from the first <TT>n</TT> characters of a plain C-String:
|
153 karl 1.79 @param str Specifies the name of the String instance.
154 @param u Specifies the Uint32 size.
|
155 david 1.81 API supports UTF8
|
156 david.dillard 1.89 @exception NullPointer Thrown if str is NULL.
157 @exception bad_alloc Thrown if there is insufficient memory.
|
158 karl 1.79 */
|
159 kumpf 1.48 String(const char* str, Uint32 n);
|
160 mike 1.38
|
161 david.dillard 1.89 /** String destructor.
|
162 karl 1.79 */
|
163 mike 1.38 ~String();
164
|
165 karl 1.79 /** Assign this string with str. For example,
|
166 david.dillard 1.89 <pre>
167 String t1 = "abc";
168 String t2 = t1;
169 </pre>
170 String t2 is assigned the value of t1.
171 @param str Specifies the name of the String to assign to another
172 String instance.
173 @exception bad_alloc Thrown if there is insufficient memory.
|
174 mike 1.38 */
|
175 kumpf 1.48 String& operator=(const String& str);
|
176 mike 1.38
|
177 kumpf 1.74 /** Assign this string with String str.
|
178 david.dillard 1.89 @param str String to assign.
179 @return Returns the String.
180 API supports UTF8
181 @exception bad_alloc Thrown if there is insufficient memory.
|
182 mike 1.38 */
|
183 kumpf 1.48 String& assign(const String& str);
|
184 mike 1.38
|
185 karl 1.79 /** Assign this string with str.
|
186 david.dillard 1.89 @exception NullPointer Thrown if str is NULL.
187 @exception bad_alloc Thrown if there is insufficient memory.
|
188 karl 1.79 */
|
189 kumpf 1.48 String& assign(const Char16* str);
|
190 mike 1.38
|
191 karl 1.79 /** Assign this string with first n characters of str.
192 @param n REVIEWERS: Insert text here.
193 @param str REVIEWERS: Insert text here.
|
194 david.dillard 1.89 @exception NullPointer Thrown if str is NULL.
195 @exception bad_alloc Thrown if there is insufficient memory.
|
196 karl 1.79 */
|
197 kumpf 1.48 String& assign(const Char16* str, Uint32 n);
|
198 mike 1.38
|
199 karl 1.79 /** Assign this string with the plain C-String str.
200 @param str REVIEWERS: Insert text here.
|
201 david 1.81 API supports UTF8
|
202 david.dillard 1.89 @exception NullPointer Thrown if str is NULL.
203 @exception bad_alloc Thrown if there is insufficient memory.
|
204 karl 1.79 */
|
205 kumpf 1.48 String& assign(const char* str);
|
206 mike 1.38
|
207 karl 1.79 /** Assign this string with first n characters of the plain C-String str.
208 @param str REVIEWERS: Insert text here.
209 @param n REVIEWERS: Insert text here.
|
210 david 1.81 API supports UTF8
|
211 david.dillard 1.89 @exception NullPointer Thrown if str is NULL.
212 @exception bad_alloc Thrown if there is insufficient memory.
|
213 karl 1.79 */
|
214 kumpf 1.48 String& assign(const char* str, Uint32 n);
|
215 mike 1.38
|
216 kumpf 1.74 /** Clear this string. After calling clear(), size() will return 0.
|
217 david.dillard 1.89 <pre>
218 String test = "abc";
219 test.clear();
220 </pre>
|
221 mike 1.38 */
222 void clear();
223
|
224 kumpf 1.74 /** Reserves memory for capacity characters. Notice
|
225 david.dillard 1.89 that this does not change the size of the string (size() returns
226 what it did before). If the capacity of the string is already
227 greater or equal to the capacity argument, this method has no
228 effect. The capacity of a String object has no bearing on its
229 external behavior. The capacity of a String is set only for
230 performance reasons.
231 @param capacity Defines the capacity in characters to reserve.
|
232 mike 1.38 */
|
233 kumpf 1.51 void reserveCapacity(Uint32 capacity);
|
234 mike 1.38
235 /** Returns the length of the String object.
|
236 david.dillard 1.89 @return Length of the String in characters. For example,
237 <pre>
238 String s = "abcd";
|
239 jim.wunderlich 1.94 assert(s.size() == 4);
|
240 david.dillard 1.89 </pre>
|
241 karl 1.79 returns a value of 4 for the length.
|
242 mike 1.38 */
|
243 kumpf 1.48 Uint32 size() const;
|
244 mike 1.38
|
245 david.dillard 1.89 /** Returns a pointer to the first character in the
246 null-terminated Char16 buffer of the String object.
247 @return Pointer to the first character of the String object. For example,
248 <pre>
249 String test = "abc";
250 const Char16* q = test.getChar16Data();
251 </pre>
|
252 karl 1.79 points to the first character in the String instance named test.
|
253 mike 1.38 */
|
254 kumpf 1.61 const Char16* getChar16Data() const;
|
255 mike 1.38
|
256 karl 1.79 /** Create an 8-bit representation of this String object. For example,
|
257 kumpf 1.59
|
258 david.dillard 1.89 @return CString object that provides access to the UTF8 String
259 representation.
|
260 kumpf 1.59
|
261 david.dillard 1.89 <pre>
262 String test = "abc";
|
263 kumpf 1.59 printf("test = %s\n", (const char*)test.getCString());
|
264 chuck 1.75
|
265 jim.wunderlich 1.91 USAGE WARNING: Do not do the following:
266
267 const char * p = (const char *)test.getCString();
268
|
269 chuck 1.75 The pointer p will be invalid. This is because
|
270 jim.wunderlich 1.91 the Compiler casues the CString object to be created on the
271 callers stack as a temporary object. The deletion is therefore
272 also the responsibility of the Compiler. The Compiler may cause
273 it to be deleted at anytime after the return. Typically it is
|
274 kumpf 1.97 done at the closeof the next scope. When it is deleted the
275 "const char *p" above will become a dangling pointer.
|
276 jim.wunderlich 1.91
|
277 kumpf 1.97 The correct usage to achieve the "const char * p" is
|
278 jim.wunderlich 1.91 as follows:
279
280 String str = "hello";
281 ...
282 CString cstr = str.getCString();
283
284 const char* p = (const char*)cstr;
285
286 This tells the compiler to create a CString object on the callers
287 stack that is the deleted at the discretion of the caller rather
288 than the compiler. The "const char *p" above will be good until
289 the caller explicity deletes the CString object.
290
291
|
292 david.dillard 1.89 </pre>
293 @exception bad_alloc Thrown if there is insufficient memory.
|
294 mike 1.38 */
|
295 kumpf 1.59 CString getCString() const;
|
296 mike 1.38
|
297 kumpf 1.58 /** Returns the specified character of the String object.
|
298 david.dillard 1.89 @param index Index of the character to access.
299 @return Specified character of the String object.
300 @exception IndexOutOfBoundsException If <TT>index</TT>
301 is outside the bounds of the String.
302 <pre>
303 String test = "abc;
304 Char16 c = test[1];
305 </pre>
|
306 mike 1.38 */
|
307 kumpf 1.58 Char16& operator[](Uint32 index);
|
308 mike 1.38
|
309 kumpf 1.58 /** Returns the specified character of the String object (const version).
|
310 david.dillard 1.89 @param index Index of the character to access.
311 @return Specified character of the String object.
312 @exception IndexOutOfBoundsException If <TT>index</TT>
313 is outside the bounds of the String.
|
314 mike 1.38 */
|
315 kumpf 1.58 const Char16 operator[](Uint32 index) const;
|
316 mike 1.38
|
317 kumpf 1.57 /** Append the given character to this String.
|
318 david.dillard 1.89 @param c Character to append.
319 @return This String.
320 <pre>
321 String test = "abc";
322 test.append(Char16('d'));
|
323 jim.wunderlich 1.94 assert(test == "abcd");
|
324 david.dillard 1.89 </pre>
325 @exception bad_alloc Thrown if there is insufficient memory.
|
326 mike 1.38 */
327 String& append(const Char16& c);
328
|
329 karl 1.79 /** Append n characters from str to this String.
330 @param str REVIEWERS: Insert text here.
331 @param n REVIEWERS: Insert text here.
|
332 david.dillard 1.89 @exception NullPointer Thrown if str is NULL.
333 @exception bad_alloc Thrown if there is insufficient memory.
|
334 karl 1.79 */
|
335 mike 1.38 String& append(const Char16* str, Uint32 n);
336
|
337 kumpf 1.57 /** Append the given String to this String.
|
338 david.dillard 1.89 @param str String to append.
339 @return This String.
340 <pre>
341 String test = "abc";
342 test.append("def");
|
343 jim.wunderlich 1.94 assert(test == "abcdef");
|
344 david.dillard 1.89 </pre>
345 @exception bad_alloc Thrown if there is insufficient memory.
|
346 mike 1.38 */
|
347 kumpf 1.57 String& append(const String& str);
|
348 mike 1.38
349 /** Remove size characters from the string starting at the given
|
350 david.dillard 1.89 index. If size is PEG_NOT_FOUND, then all characters after
351 <TT>index</TT> are removed.
352 @param index Position in string to start remove.
353 @param size Number of characters to remove. Default is PEG_NOT_FOUND
354 which causes all characters after <TT>index</TT> to be removed.
355 <pre>
356 String s;
357 s = "abc";
358 s.remove(0, 1);
|
359 jim.wunderlich 1.94 assert(String::equal(s, "bc"));
360 assert(s.size() == 2);
|
361 david.dillard 1.89 s.remove(0);
|
362 jim.wunderlich 1.94 assert(String::equal(s, ""));
363 assert(s.size() == 0);
|
364 david.dillard 1.89 </pre>
365 @exception IndexOutOfBoundsException If size is greater than
366 length of String plus starting index for remove.
|
367 mike 1.38 */
|
368 kumpf 1.58 void remove(Uint32 index, Uint32 size = PEG_NOT_FOUND);
|
369 mike 1.38
370 /** Return a new String which is initialzed with <TT>length</TT>
|
371 david.dillard 1.89 characters from this string starting at <TT>index</TT>.
372 @param index Specifies the index in string to start getting the
373 substring.
374 @param length Specifies the number of characters to get. If length
375 is PEG_NOT_FOUND, then all characters after index are added to the new
376 string.
377 @return String Specifies the Sting with the defined substring.
378 @exception bad_alloc Thrown if there is insufficient memory.
|
379 mike 1.38 */
|
380 kumpf 1.58 String subString(Uint32 index, Uint32 length = PEG_NOT_FOUND) const;
|
381 mike 1.38
|
382 karl 1.79 /** Find the index of the first occurrence of the character c.
|
383 david.dillard 1.89 If the character is not found, PEG_NOT_FOUND is returned.
384 @param c Char to be found in the String.
385 @return Position of the character in the string or PEG_NOT_FOUND if not
386 found.
|
387 mike 1.38 */
388 Uint32 find(Char16 c) const;
389
|
390 karl 1.79 /** Find the index of the first occurence of the character c.
|
391 david.dillard 1.89 If the character is not found, PEG_NOT_FOUND is returned.
392 Searching begins from the specified index.
393 @param c Char to be found in the String.
394 @return Position of the character in the string or PEG_NOT_FOUND if the
395 character is not found.
|
396 kumpf 1.74 */
|
397 kumpf 1.58 Uint32 find(Uint32 index, Char16 c) const;
|
398 mike 1.38
|
399 kumpf 1.58 /** Find the index of the first occurence of the string object.
|
400 david.dillard 1.89 This function finds one string inside another.
401 If the matching substring is not found, PEG_NOT_FOUND is returned.
402 @param s String object to be found in the String.
403 @return Position of the substring in the String or PEG_NOT_FOUND if the
404 substring is not found.
|
405 mike 1.38 */
406 Uint32 find(const String& s) const;
407
|
408 kumpf 1.74 /** Same as find() but start looking in reverse (last character first).
|
409 david.dillard 1.89 @param c Char16 character to find in String.
410 @return Position of the character in the string or PEG_NOT_FOUND if the
411 character is not found.
|
412 mike 1.38 */
413 Uint32 reverseFind(Char16 c) const;
414
|
415 david 1.81 /** Converts all characters in this string to lowercase characters,
416 */
417 void toLower();
418
|
419 denise.eckstein 1.85 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
420 /** <I><B>Experimental Interface</B></I><BR>
421 Converts all characters in this string to uppercase characters.
|
422 mike 1.38 */
|
423 chuck 1.88 void toUpper();
|
424 david 1.81 #endif
|
425 kumpf 1.48
|
426 kumpf 1.95 /**
427 Compares the first n characters of two String objects.
428 @param s1 The first String to compare.
429 @param s2 The second String to compare.
430 @param n The maximum number of characters to compare.
431 @return Returns a negative integer if the first n characters of s1
432 are lexographically less than s2, 0 if the first n characters of s1
433 and s2 are equal, and a positive integer otherwise.
|
434 mike 1.38 */
|
435 kumpf 1.51 static int compare(const String& s1, const String& s2, Uint32 n);
|
436 mike 1.38
|
437 kumpf 1.95 /**
438 Compares two String objects.
439 @param s1 The first String to compare.
440 @param s2 The second String to compare.
441 @return Returns a negative integer if s1 is lexographically less
442 than s2, 0 if s1 and s2 are equal, and a positive integer otherwise.
|
443 mike 1.38
|
444 kumpf 1.95 NOTE: Use the comparison operators <,<= > >= to compare
445 String objects.
|
446 mike 1.38 */
|
447 kumpf 1.51 static int compare(const String& s1, const String& s2);
|
448 mike 1.38
|
449 kumpf 1.95 /**
450 Compares two String objects, ignoring case differences.
451 @param s1 The first String to compare.
452 @param s2 The second String to compare.
453 @return Returns a negative integer if s1 is lexographically less
454 than s2, 0 if s1 and s2 are equal, and a positive integer otherwise.
455 (Case differences are ignored in all cases.)
|
456 kumpf 1.48 */
|
457 kumpf 1.49 static int compareNoCase(const String& s1, const String& s2);
|
458 kumpf 1.48
|
459 mike 1.38 /** Compare two String objects for equality.
|
460 david.dillard 1.89 @param s1 First <TT>String</TT> for comparison.
461 @param s2 Second <TT>String</TT> for comparison.
|
462 mike 1.38
|
463 david.dillard 1.89 @return true If the two strings are equal; otherwise, false. For example,
464 <pre>
465 String s1 = "Hello World";
466 String s2 = s1;
467 String s3(s2);
|
468 jim.wunderlich 1.94 assert(String::equal(s1, s3));
|
469 david.dillard 1.89 </pre>
|
470 mike 1.38 */
|
471 kumpf 1.48 static Boolean equal(const String& str1, const String& str2);
|
472 mike 1.38
|
473 kumpf 1.74 /** Compares two strings and returns true if they
|
474 david.dillard 1.89 are equal indepedent of case of the characters.
475 @param str1 First String parameter.
476 @param str2 Second String parameter.
477 @return true If strings are equal independent of case, flase
|
478 kumpf 1.74 otherwise.
|
479 karl 1.47 */
|
480 kumpf 1.48 static Boolean equalNoCase(const String& str1, const String& str2);
|
481 david 1.76
|
482 mike 1.90 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
483
484 String(const String& s1, const String& s2);
485
486 String(const String& s1, const char* s2);
487
488 String(const char* s1, const String& s2);
489
490 String& operator=(const char* str);
491
492 Uint32 find(const char* s) const;
493
494 static Boolean equal(const String& s1, const char* s2);
495
496 static int compare(const String& s1, const char* s2);
497
498 String& append(const char* str);
499
500 String& append(const char* str, Uint32 size);
501
502 static Boolean equalNoCase(const String& s1, const char* s2);
503 mike 1.90
504 #endif /* PEGASUS_USE_EXPERIMENTAL_INTERFACES */
505
|
506 mike 1.38 private:
507
|
508 kumpf 1.51 StringRep* _rep;
|
509 mike 1.38 };
|
510 mike 1.40
|
511 karl 1.79 /** String operator == tests for equality between two strings of any of the
|
512 mike 1.38 types String or char*.
|
513 karl 1.79 @return true If the strings are equal; otherwise, false.
514 @param str1 REVIEWERS: Insert description here.
515 @param str2 REVIEWERS: Insert description here.
|
516 mike 1.38 */
|
517 kumpf 1.48 PEGASUS_COMMON_LINKAGE Boolean operator==(
518 const String& str1,
519 const String& str2);
|
520 mike 1.38
|
521 kumpf 1.74 /** String operator ==. Test for equality between two strings.
|
522 karl 1.79 @param str1 REVIEWERS: Insert description here.
523 @param str2 REVIEWERS: Insert description here.
|
524 mike 1.38 */
|
525 kumpf 1.48 PEGASUS_COMMON_LINKAGE Boolean operator==(const String& str1, const char* str2);
|
526 mike 1.38
|
527 kumpf 1.74 /** String operator ==. Test for equality between two strings.
|
528 karl 1.79 @param str1 REVIEWERS: Insert description here.
529 @param str2 REVIEWERS: Insert description here.
|
530 mike 1.38 */
|
531 kumpf 1.48 PEGASUS_COMMON_LINKAGE Boolean operator==(const char* str1, const String& str2);
|
532 mike 1.38
|
533 kumpf 1.74 /** String operator ==. Test for equality between two strings.
|
534 karl 1.79 @param str1 REVIEWERS: Insert description here.
535 @param str2 REVIEWERS: Insert description here.
|
536 mike 1.38 */
|
537 kumpf 1.48 PEGASUS_COMMON_LINKAGE Boolean operator!=(
538 const String& str1,
539 const String& str2);
|
540 mike 1.38
|
541 karl 1.79 /** REVIEWERS: Insert description here.
542 @param str REVIEWERS: Insert description here.
543 @param os REVIEWERS: Insert description here.
544 */
|
545 mike 1.38 PEGASUS_COMMON_LINKAGE PEGASUS_STD(ostream)& operator<<(
546 PEGASUS_STD(ostream)& os,
|
547 kumpf 1.48 const String& str);
|
548 mike 1.38
|
549 david.dillard 1.89 /** This overload operator (+) concatenates String objects. For example,
|
550 mike 1.38 <pre>
|
551 david.dillard 1.89 String t1 = "abc";
552 String t2;
553 t2 = t1 + "def"
|
554 jim.wunderlich 1.94 assert(t2 == "abcdef");
|
555 mike 1.38 </pre>
556 */
|
557 kumpf 1.48 PEGASUS_COMMON_LINKAGE String operator+(const String& str1, const String& str2);
|
558 mike 1.38
|
559 karl 1.79 /** The overload operator (<) compares String obects.
|
560 mike 1.38 <pre>
|
561 david.dillard 1.89 String t1 = "def";
562 String t2 = "a";
|
563 jim.wunderlich 1.94 assert (t2 < t1);
|
564 mike 1.38 </pre>
|
565 karl 1.79 @param str1 REVIEWERS: Insert description here.
566 @param str2 REVIEWERS: Insert description here.
|
567 mike 1.38 */
|
568 kumpf 1.48 PEGASUS_COMMON_LINKAGE Boolean operator<(
569 const String& str1,
570 const String& str2);
|
571 mike 1.38
|
572 karl 1.79 /** The overload operator (<=) compares String objects.
573 @param str1 REVIEWERS: Insert description here.
574 @param str2 REVIEWERS: Insert description here.
|
575 mike 1.38 */
|
576 kumpf 1.48 PEGASUS_COMMON_LINKAGE Boolean operator<=(
577 const String& str1,
578 const String& str2);
|
579 mike 1.38
|
580 karl 1.79 /** The overload operator (>) compares String objects.
581 @param str1 REVIEWERS: Insert description here.
582 @param str2 REVIEWERS: Insert description here.
|
583 mike 1.38 */
|
584 kumpf 1.48 PEGASUS_COMMON_LINKAGE Boolean operator>(
585 const String& str1,
586 const String& str2);
|
587 mike 1.38
|
588 karl 1.79 /** The overload operator (>=) compares String objects.
589 @param str1 REVIEWERS: Insert description here.
590 @param str2 REVIEWERS: Insert description here.
|
591 mike 1.38 */
|
592 kumpf 1.48 PEGASUS_COMMON_LINKAGE Boolean operator>=(
593 const String& str1,
594 const String& str2);
|
595 mike 1.38
|
596 mike 1.90 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
597
598 PEGASUS_COMMON_LINKAGE Boolean operator==(const String& s1, const String& s2);
599
600 PEGASUS_COMMON_LINKAGE Boolean operator==(const String& s1, const char* s2);
601
602 PEGASUS_COMMON_LINKAGE Boolean operator==(const char* s1, const String& s2);
603
604 PEGASUS_COMMON_LINKAGE Boolean operator!=(const String& s1, const String& s2);
605
606 PEGASUS_COMMON_LINKAGE Boolean operator!=(const String& s1, const char* s2);
607
608 PEGASUS_COMMON_LINKAGE Boolean operator!=(const char* s1, const String& s2);
609
610 PEGASUS_COMMON_LINKAGE Boolean operator<(const String& s1, const String& s2);
611
612 PEGASUS_COMMON_LINKAGE Boolean operator<(const String& s1, const char* s2);
613
614 PEGASUS_COMMON_LINKAGE Boolean operator<(const char* s1, const String& s2);
615
616 PEGASUS_COMMON_LINKAGE Boolean operator>(const String& s1, const String& s2);
617 mike 1.90
618 PEGASUS_COMMON_LINKAGE Boolean operator>(const String& s1, const char* s2);
619
620 PEGASUS_COMMON_LINKAGE Boolean operator>(const char* s1, const String& s2);
621
622 PEGASUS_COMMON_LINKAGE Boolean operator<=(const String& s1, const String& s2);
623
624 PEGASUS_COMMON_LINKAGE Boolean operator<=(const String& s1, const char* s2);
625
626 PEGASUS_COMMON_LINKAGE Boolean operator<=(const char* s1, const String& s2);
627
628 PEGASUS_COMMON_LINKAGE Boolean operator>=(const String& s1, const String& s2);
629
630 PEGASUS_COMMON_LINKAGE Boolean operator>=(const String& s1, const char* s2);
631
632 PEGASUS_COMMON_LINKAGE Boolean operator>=(const char* s1, const String& s2);
633
634 PEGASUS_COMMON_LINKAGE String operator+(const String& s1, const String& s2);
635
636 PEGASUS_COMMON_LINKAGE String operator+(const String& s1, const char* s2);
637
638 mike 1.90 PEGASUS_COMMON_LINKAGE String operator+(const char* s1, const String& s2);
639
640 #endif /* PEGASUS_USE_EXPERIMENTAL_INTERFACES */
641
|
642 mike 1.38 PEGASUS_NAMESPACE_END
643
|
644 mike 1.90 #if defined(PEGASUS_INTERNALONLY) && !defined(PEGASUS_DISABLE_INTERNAL_INLINES)
645 # include "StringInline.h"
646 #endif
647
|
648 mike 1.38 #endif /* Pegasus_String_h */
|