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