(file) Return to String.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2