GitHub Actions: Try MSVC builds with /std:c++17 and 20
[ACE_TAO.git] / ACE / ace / String_Base.h
blob8005c34b7681ecea768790f969ef46b09de8d385
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file String_Base.h
7 * @author Douglas C. Schmidt (d.schmidt@vanderbilt.edu)
8 * @author Nanbor Wang <nanbor@cs.wustl.edu>
9 */
10 //=============================================================================
12 #ifndef ACE_STRING_BASE_H
13 #define ACE_STRING_BASE_H
15 #include /**/ "ace/pre.h"
17 #include "ace/Global_Macros.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "ace/String_Base_Const.h"
24 #include <iterator>
26 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
28 // Forward decl.
29 template <class ACE_CHAR_T>
30 class ACE_String_Base_Iterator;
32 // Forward decl.
33 template <class ACE_CHAR_T>
34 class ACE_String_Base_Const_Iterator;
36 /**
37 * @class ACE_String_Base
39 * @brief This class provides a wrapper facade for C strings.
41 * This class uses an ACE_Allocator to allocate memory. The
42 * user can make this a persistant class by providing an
43 * ACE_Allocator with a persistable memory pool. This class is
44 * optimized for efficiency, so it doesn't provide any internal
45 * locking.
46 * @note If an instance of this class is constructed from or
47 * assigned an empty string (with first element of '\0'), then it
48 * is not allocated new space. Instead, its internal
49 * representation is set equal to a global empty string.
50 * CAUTION: in cases when ACE_String_Base is constructed from a
51 * provided buffer with the release parameter set to false,
52 * ACE_String_Base is not guaranteed to be '\0' terminated.
54 * \li Do not use a "@c -1" magic number to refer to the "no position"
55 * condition. This was never the right thing to do. The "@c npos"
56 * constant should be used in such cases.
57 * \li Do not assign or pass string positions to or from signed types.
58 * Use the "@c size_type" @c typedef found in all ACE string
59 * classes. This typedef is analogous to the "@c size_type"
60 * @c typedef found in the standard C++ string class as well as
61 * many STL class templates. If you find yourself casting you're
62 * probably doing something wrong.
64 template <class ACE_CHAR_T>
65 class ACE_String_Base : public ACE_String_Base_Const
67 public:
68 using ACE_String_Base_Const::size_type;
70 friend class ACE_String_Base_Iterator <ACE_CHAR_T>;
71 friend class ACE_String_Base_Const_Iterator <ACE_CHAR_T>;
73 // ACE-style iterators
74 typedef ACE_String_Base_Iterator <ACE_CHAR_T> ITERATOR;
75 typedef ACE_String_Base_Const_Iterator <ACE_CHAR_T> CONST_ITERATOR;
77 // STL-style iterators
78 typedef ACE_String_Base_Iterator <ACE_CHAR_T> iterator;
79 typedef ACE_String_Base_Const_Iterator <ACE_CHAR_T> const_iterator;
81 /**
82 * Default constructor.
84 * @param the_allocator ACE_Allocator associated with string
85 * @return Default ACE_String_Base string.
87 ACE_String_Base (ACE_Allocator *the_allocator = 0);
89 /**
90 * Constructor that copies @a s into dynamically allocated memory.
92 * if release == true then a new buffer is allocated internally, and
93 * s is copied to the internal buffer.
94 * if release == false then the s buffer is used directly. If s == 0
95 * then it will _not_ be used, and instead the internal buffer
96 * is set to NULL_String_.
98 * @param s Zero terminated input string
99 * @param the_allocator ACE_Allocator associated with string
100 * @param release Allocator responsible(true)/not responsible(false) for
101 * freeing memory.
102 * @return ACE_String_Base containing const ACE_CHAR_T *s
104 ACE_String_Base (const ACE_CHAR_T *s,
105 ACE_Allocator *the_allocator = 0,
106 bool release = true);
109 * Constructor that copies @a len CHARs of @a s into dynamically
110 * allocated memory (will zero terminate the result).
112 * if release == true then a new buffer is allocated internally.
113 * s is copied to the internal buffer.
114 * if release == false then the s buffer is used directly. If s == 0
115 * then it will _not_ be used, and instead the internal buffer
116 * is set to NULL_String_.
118 * @param s Non-zero terminated input string
119 * @param len Length of non-zero terminated input string
120 * @param the_allocator ACE_Allocator associated with string
121 * @param release Allocator responsible(true)/not responsible(false) for
122 * freeing memory.
123 * @return ACE_String_Base containing const ACE_CHAR_T *s
125 ACE_String_Base (const ACE_CHAR_T *s,
126 size_type len,
127 ACE_Allocator *the_allocator = 0,
128 bool release = true);
131 * Copy constructor.
133 * @param s Input ACE_String_Base string to copy
134 * @return Copy of input string @a s
136 ACE_String_Base (const ACE_String_Base < ACE_CHAR_T > &s);
139 * Constructor that copies @a c into dynamically allocated memory.
141 * @param c Single input character.
142 * @param the_allocator ACE_Allocator associated with string
143 * @return ACE_String_Base containing ACE_CHAR_T 'c'
145 ACE_String_Base (ACE_CHAR_T c, ACE_Allocator *the_allocator = 0);
148 * Constructor that allocates a len long string.
150 * Warning : This constructor was incorrectly documented in the past.
151 * It simply calls resize(len, c).
152 * It is probably not advisable to use the second parameter. See
153 * resize() for more information.
155 * @param len Amount of space to reserve for the string.
156 * @param c The array is filled with c's
157 * @param the_allocator ACE_Allocator associated with string
158 * @return Empty ACE_String_Base with room for len CHARs
160 ACE_String_Base (size_type len,
161 ACE_CHAR_T c = 0,
162 ACE_Allocator *the_allocator = 0);
165 * Deletes the memory...
167 ~ACE_String_Base (void);
170 * Return the <slot'th> character in the string (doesn't perform
171 * bounds checking).
173 * @param slot Index of the desired character
174 * @return The character at index @a slot
176 const ACE_CHAR_T & operator[] (size_type slot) const;
179 * Return the <slot'th> character by reference in the string
180 * (doesn't perform bounds checking).
182 * @param slot Index of the desired character
183 * @return The character at index @a slot
185 ACE_CHAR_T & operator[] (size_type slot);
188 * Assignment operator (does copy memory).
190 * @param s Input null-terminated ACE_CHAR_T string to assign to this object.
191 * @return Return a copy of the this string.
193 ACE_String_Base < ACE_CHAR_T > &operator = (const ACE_CHAR_T * s);
196 * Assignment operator (does copy memory).
198 * @param s Input ACE_String_Base string to assign to this object.
199 * @return Return a copy of the this string.
201 ACE_String_Base < ACE_CHAR_T > &operator = (const ACE_String_Base < ACE_CHAR_T > &s);
204 * Assignment alternative method (does not copy memory).
206 * @param s Input ACE_String_Base string to assign to this object.
207 * @return Return this string.
209 ACE_String_Base < ACE_CHAR_T > &assign_nocopy (const ACE_String_Base < ACE_CHAR_T > &s);
212 * Copy @a s into this @a ACE_String_Base.
214 * If release == true then a new buffer is allocated internally if the
215 * existing one is not big enough to hold s. If the existing
216 * buffer is big enough, then it will be used. This means that
217 * set(*, 1) can be illegal when the string is constructed with a
218 * const char*. (e.g. ACE_String_Base("test", 0, false)).
220 * if release == false then the s buffer is used directly, and any
221 * existing buffer is destroyed. If s == 0 then it will _not_ be
222 * used, and instead the internal buffer is set to NULL_String_.
224 * @param s Null terminated input string
225 * @param release Allocator responsible(true)/not responsible(false) for
226 * freeing memory.
228 void set (const ACE_CHAR_T * s, bool release = true);
231 * Copy @a len bytes of @a s (will zero terminate the result).
233 * If release == true then a new buffer is allocated internally if the
234 * existing one is not big enough to hold s. If the existing
235 * buffer is big enough, then it will be used. This means that
236 * set(*, *, 1) is illegal when the string is constructed with a
237 * non-owned const char*. (e.g. ACE_String_Base("test", 0, 0))
239 * If release == false then the s buffer is used directly, and any
240 * existing buffer is destroyed. If s == 0 then it will _not_ be
241 * used, and instead the internal buffer is set to NULL_String_.
243 * @param s Non-zero terminated input string
244 * @param len Length of input string 's'
245 * @param release Allocator responsible(true)/not responsible(false) for
246 * freeing memory.
248 void set (const ACE_CHAR_T * s, size_type len, bool release);
251 * Clear this string. Memory is _not_ freed if @a release is false.
253 * Warning: This method was incorrectly documented in the past, but
254 * the current implementation has been changed to match the documented
255 * behavior.
257 * Warning: clear(false) behaves like fast_clear() below.
259 * @param release Memory is freed if true, and not freed if false.
261 void clear (bool release = false);
264 * A more specialized version of clear(): "fast clear". fast_clear()
265 * resets the string to 0 length. If the string owns the buffer
266 * (@arg release_== true):
267 * - the string buffer is not freed
268 * - the first character of the buffer is set to 0.
270 * If @arg release_ is false (this object does not own the buffer):
271 * - the buffer pointer is reset to the NULL_String_ and does not
272 * maintain a pointer to the caller-supplied buffer on return
273 * - the maximum string length is reset to 0.
275 * Warning : Calling clear(false) or fast_clear() can have unintended
276 * side-effects if the string was constructed (or set()) with an
277 * external buffer. The string will be disassociated with the buffer
278 * and the next append() or +=() will cause a new buffer to be
279 * allocated internally.
281 void fast_clear (void);
284 * Return a substring given an offset and length.
285 * If length == @c npos use rest of str. Return empty substring if
286 * offset or offset/length are invalid.
288 * @param offset Index of first desired character of the substring.
289 * @param length How many characters to return starting at the offset.
290 * @return The string containing the desired substring
292 ACE_String_Base < ACE_CHAR_T > substring (size_type offset,
293 size_type length = npos) const;
296 * Same as <substring>.
298 * @param offset Index of first desired character of the substring.
299 * @param length How many characters to return starting at the offset.
300 * @return The string containing the desired substring
302 ACE_String_Base < ACE_CHAR_T > substr (size_type offset,
303 size_type length = npos) const;
306 * Concat operator (copies memory).
308 * @param s Input ACE_String_Base string to concatenate to this string.
309 * @return The combined string (input append to the end of the old). New
310 * string is zero terminated.
312 ACE_String_Base < ACE_CHAR_T > &operator += (const ACE_String_Base < ACE_CHAR_T > &s);
315 * Concat operator (copies memory).
317 * @param s Input C string to concatenate to this string.
318 * @return The combined string (input append to the end of the old). New
319 * string is zero terminated.
321 ACE_String_Base < ACE_CHAR_T >& operator += (const ACE_CHAR_T* s);
324 * Concat operator (copies memory).
326 * @param c Input ACE_CHAR_T to concatenate to this string.
327 * @return The combined string (input append to the end of the old). New
328 * string is zero terminated.
330 ACE_String_Base < ACE_CHAR_T >& operator += (const ACE_CHAR_T c);
333 * Append function (copies memory).
335 * @param s Input ACE_CHAR_T array to concatenate to this string.
336 * @param slen The length of the array.
337 * @return The combined string (input append to the end of the old). New
338 * string is zero terminated.
340 ACE_String_Base < ACE_CHAR_T >& append (const ACE_CHAR_T* s, size_type slen);
343 * Returns a hash value for this string.
345 * @return Hash value of string
347 u_long hash (void) const;
350 * Return the length of the string.
352 * @return Length of stored string
354 size_type length (void) const;
357 * Return the number of allocated CHARs in the string object.
358 * This may be greater than the current length of the string.
360 * @return Maximum number of ACE_CHAR_T units that can be stored, including
361 * any terminating nul that may be needed.
363 size_t capacity (void) const;
366 * Return @c true if the length of the string is zero, else @c false.
368 bool is_empty (void) const;
371 * Return @c true if the length of the string is zero, else @c
372 * false. We recommend using @c is_empty() instead since it's more
373 * consistent with the ACE container naming conventions.
375 bool empty (void) const;
378 * Get a copy of the underlying representation.
380 * This method allocates memory for a copy of the string and returns
381 * a pointer to the new area. The caller is responsible for freeing
382 * the memory when finished; use delete []
384 * @return Pointer reference to the string data. Returned string is
385 * zero terminated.
387 ACE_CHAR_T *rep (void) const;
390 * Get at the underlying representation directly!
391 * _Don't_ even think about casting the result to (char *) and modifying it,
392 * if it has length 0!
394 * @return Pointer reference to the stored string data. No guarantee is
395 * that the string is zero terminated.
398 const ACE_CHAR_T *fast_rep (void) const;
401 * Same as STL String's c_str() and fast_rep().
403 const ACE_CHAR_T *c_str (void) const;
406 * Comparison operator that will match substrings. Returns the
407 * slot of the first location that matches, else @c npos.
409 * @param s Input ACE_String_Base string
410 * @return Integer index value of the first location of string @a s or
411 * @c npos (not found).
413 size_type strstr (const ACE_String_Base<ACE_CHAR_T> &s) const;
416 * Find @a str starting at pos. Returns the slot of the first
417 * location that matches (will be >= pos), else @c npos.
419 * @param str Input ACE_String_Base string to search for in stored string.
420 * @param pos Starting index position to start searching for string @a str.
421 * @return Index value of the first location of string @a str else
422 * @c npos.
424 size_type find (const ACE_String_Base<ACE_CHAR_T> &str, size_type pos = 0) const;
427 * Find @a s starting at @a pos. Returns the slot of the first
428 * location that matches (will be >= pos), else @c npos.
430 * @param s non-zero input string to search for in stored string.
431 * @param pos Starting index position to start searching for string @a str.
432 * @return Index value of the first location of string @a str else
433 * @c npos.
435 size_type find (const ACE_CHAR_T *s, size_type pos = 0) const;
438 * Find @a c starting at @a pos. Returns the slot of the first
439 * location that matches (will be >= pos), else @c npos.
441 * @param c Input character to search for in stored string.
442 * @param pos Starting index position to start searching for string @a str.
443 * @return Index value of the first location of string @a str else
444 * @c npos.
446 size_type find (ACE_CHAR_T c, size_type pos = 0) const;
449 * Find @a c starting at @a pos (counting from the end). Returns the
450 * slot of the first location that matches, else @c npos.
452 * @param c Input character to search for in stored string.
453 * @param pos Starting index position to start searching for string @a str.
454 * @return Index value of the first location of string @a str else
455 * @c npos.
457 size_type rfind (ACE_CHAR_T c, size_type pos = npos) const;
460 * Equality comparison operator (must match entire string).
462 * @param s Input ACE_String_Base string to compare against stored string.
463 * @return @c true if equal, @c false otherwise.
465 bool operator == (const ACE_String_Base<ACE_CHAR_T> &s) const;
468 * Equality comparison operator (must match entire string).
470 * @param s Null terminated string to compare against stored string.
471 * @return @c true if equal, @c false otherwise.
473 bool operator == (const ACE_CHAR_T *s) const;
476 * Less than comparison operator.
478 * @param s Input ACE_String_Base string to compare against stored string.
479 * @return @c true if less than, @c false otherwise.
481 bool operator < (const ACE_String_Base<ACE_CHAR_T> &s) const;
484 * Greater than comparison operator.
486 * @param s Input ACE_String_Base string to compare against stored string.
487 * @return @c true if greater than, @c false otherwise.
489 bool operator > (const ACE_String_Base<ACE_CHAR_T> &s) const;
492 * Inequality comparison operator.
494 * @param s String to compare against stored string.
495 * @return @c true if not equal, @c false otherwise.
497 bool operator != (const ACE_String_Base<ACE_CHAR_T> &s) const;
500 * Inequality comparison operator.
502 * @param s Null terminated string to compare against stored string.
503 * @return @c true if not equal, @c false otherwise.
505 bool operator != (const ACE_CHAR_T *s) const;
508 * Performs a strncmp comparison.
510 * @param s Input ACE_String_Base string to compare against stored string.
511 * @return Integer value of result (less than 0, 0, greater than 0)
512 * depending on how input string @a s is to the stored string.
514 int compare (const ACE_String_Base<ACE_CHAR_T> &s) const;
517 * Dump the state of an object.
519 void dump (void) const;
522 * This method is designed for high-performance. Please use with
523 * care ;-)
525 * Warning : This method was documented incorrectly in the past.
526 * The original intention was to change the length of the string to
527 * len, and to fill the whole thing with c CHARs.
528 * However, what was actually done was to set the length of the
529 * string to zero, and fill the buffer with c's. The buffer was
530 * also not null-terminated unless c happened to be zero.
531 * Rather than fix the method to work as documented, the code is
532 * left as is, but the second parameter should probably not be used.
534 * fast_resize just adjusts the buffer if needed and sets the length,
535 * it doesn't fill the buffer, so is much faster.
537 * @param len The number of CHARs to reserve
538 * @param c The ACE_CHAR_T to use when filling the string.
540 void resize (size_type len, ACE_CHAR_T c = 0);
541 void fast_resize (size_t len);
543 /// Swap the contents of this @c ACE_String_Base with @a str.
545 * @note This is non-throwing operation.
547 void swap (ACE_String_Base<ACE_CHAR_T> & str);
549 iterator begin (void);
550 const_iterator begin (void) const;
552 iterator end (void);
553 const_iterator end (void) const;
556 * Declare the dynamic allocation hooks.
558 ACE_ALLOC_HOOK_DECLARE;
560 protected:
562 * Pointer to a memory allocator.
564 ACE_Allocator *allocator_;
567 * Length of the ACE_String_Base data (not counting the trailing '\0').
569 size_type len_;
572 * Length of the ACE_String_Base data buffer. Keeping track of the
573 * length allows to avoid unnecessary dynamic allocations.
575 size_type buf_len_;
578 * Pointer to data.
580 ACE_CHAR_T *rep_;
583 * Flag that indicates if we own the memory
585 bool release_;
588 * Represents the "NULL" string to simplify the internal logic.
590 static ACE_CHAR_T NULL_String_;
594 * @class ACE_String_Base_Iterator
596 * @brief Iterator class for the ACE_String_Base class.
598 * This class is an implementation of an iterator that allows client
599 * applications it iterator over the contents of a string. Currently,
600 * now this iterator fall under the std::bidirectional_iterator_tag
601 * category. Future versions of the class will support the operations
602 * of std::random_access_iterator_tag.
604 template <class ACE_CHAR_T>
605 class ACE_String_Base_Iterator
607 public:
608 // = std::iterator_traits typedefs/traits.
609 typedef std::bidirectional_iterator_tag iterator_category;
610 typedef ACE_CHAR_T value_type;
611 typedef ACE_CHAR_T & reference;
612 typedef ACE_CHAR_T * pointer;
613 typedef ptrdiff_t difference_type;
616 * Initializing constructor
618 * @param[in] str Target string for iterator.
620 ACE_String_Base_Iterator (ACE_String_Base <ACE_CHAR_T> & str, int end = 0);
623 * Copy constructor
625 * @param[in] iter Iterator to copy.
627 ACE_String_Base_Iterator (const ACE_String_Base_Iterator <ACE_CHAR_T> & iter);
629 /// Destructor.
630 ~ACE_String_Base_Iterator (void);
633 * Test if the iterator has seen all characters.
635 * @retval 0 Characters still remain.
636 * @retval 1 All characters have been seen.
638 int done (void) const;
641 * Get the current character.
643 * @param[out] ch The current character.
644 * @retval 0 All characters have been seen.
645 * @retval 1 Items still remain to be seen.
647 int next (ACE_CHAR_T * & ch) const;
650 * Move to the next character in the string.
652 * @retval 0 All characters have been seen.
653 * @retval 1 Items still remain to be seen.
655 int advance (void);
658 * Assignment operator
660 * @param[in] iter Right-hand side of operator.
661 * @return Reference to self.
663 const ACE_String_Base_Iterator <ACE_CHAR_T> & operator = (const ACE_String_Base_Iterator <ACE_CHAR_T> & iter);
666 * Dereference operator
668 * @return Reference to current character seen by iterator.
670 ACE_CHAR_T & operator * (void);
673 * Prefix operator
675 ACE_String_Base_Iterator <ACE_CHAR_T> & operator ++ (void);
678 * Postfix operator
680 ACE_String_Base_Iterator <ACE_CHAR_T> operator ++ (int);
683 * Prefix operator
685 ACE_String_Base_Iterator <ACE_CHAR_T> & operator -- (void);
688 * Postfix operator
690 ACE_String_Base_Iterator <ACE_CHAR_T> operator -- (int);
693 * Eqaulity comparison operator
695 * @param[in] rhs Right-hand side of operator.
697 bool operator == (const ACE_String_Base_Iterator <ACE_CHAR_T> & rhs) const;
700 * Ineqaulity comparison operator
702 * @param[in] rhs Right-hand side of operator.
704 bool operator != (const ACE_String_Base_Iterator <ACE_CHAR_T> & rhs) const;
706 bool operator < (const ACE_String_Base_Iterator <ACE_CHAR_T> & rhs) const;
707 bool operator > (const ACE_String_Base_Iterator <ACE_CHAR_T> & rhs) const;
709 bool operator <= (const ACE_String_Base_Iterator <ACE_CHAR_T> & rhs) const;
710 bool operator >= (const ACE_String_Base_Iterator <ACE_CHAR_T> & rhs) const;
712 private:
713 /// Target string to iterate over.
714 ACE_String_Base <ACE_CHAR_T> * str_;
716 /// Current location in the string.
717 size_t index_;
721 * @class ACE_String_Base_Const_Iterator
723 * @brief Const iterator class for the ACE_String_Base class.
725 * This class is an implementation of an iterator that allows client
726 * applications it iterator over the contents of a string. Currently,
727 * now this iterator fall under the std::bidirectional_iterator_tag
728 * category. Future versions of the class will support the operations
729 * of std::random_access_iterator_tag.
731 template <class ACE_CHAR_T>
732 class ACE_String_Base_Const_Iterator
734 public:
735 // = std::iterator_traits typedefs/traits.
736 typedef std::bidirectional_iterator_tag iterator_category;
737 typedef const ACE_CHAR_T value_type;
738 typedef const ACE_CHAR_T & reference;
739 typedef const ACE_CHAR_T * pointer;
740 typedef ptrdiff_t difference_type;
743 * Initializing constructor
745 * @param[in] str Target string for iterator.
747 ACE_String_Base_Const_Iterator (const ACE_String_Base <ACE_CHAR_T> & str, int end = 0);
750 * Copy constructor
752 * @param[in] iter Iterator to copy.
754 ACE_String_Base_Const_Iterator (const ACE_String_Base_Const_Iterator <ACE_CHAR_T> & iter);
756 /// Destructor.
757 ~ACE_String_Base_Const_Iterator (void);
760 * Test if the iterator has seen all characters.
762 * @retval 0 Characters still remain.
763 * @retval 1 All characters have been seen.
765 int done (void) const;
768 * Get the current character.
770 * @param[out] ch The current character.
771 * @retval 0 All characters have been seen.
772 * @retval 1 Items still remain to be seen.
774 int next (const ACE_CHAR_T * & ch) const;
777 * Move to the next character in the string.
779 * @retval 0 All characters have been seen.
780 * @retval 1 Items still remain to be seen.
782 int advance (void);
785 * Assignment operator
787 * @param[in] iter Right-hand side of operator.
788 * @return Reference to self.
790 const ACE_String_Base_Const_Iterator <ACE_CHAR_T> & operator = (const ACE_String_Base_Const_Iterator <ACE_CHAR_T> & iter);
793 * Dereference operator
795 * @return Reference to current character seen by iterator.
797 const ACE_CHAR_T & operator * (void);
800 * Prefix operator
802 ACE_String_Base_Const_Iterator <ACE_CHAR_T> & operator ++ (void);
805 * Postfix operator
807 ACE_String_Base_Const_Iterator <ACE_CHAR_T> operator ++ (int);
810 * Prefix operator
812 ACE_String_Base_Const_Iterator <ACE_CHAR_T> & operator -- (void);
815 * Postfix operator
817 ACE_String_Base_Const_Iterator <ACE_CHAR_T> operator -- (int);
820 * Eqaulity comparison operator
822 * @param[in] rhs Right-hand side of operator.
824 bool operator == (const ACE_String_Base_Const_Iterator <ACE_CHAR_T> & rhs) const;
827 * Ineqaulity comparison operator
829 * @param[in] rhs Right-hand side of operator.
831 bool operator != (const ACE_String_Base_Const_Iterator <ACE_CHAR_T> & rhs) const;
833 bool operator < (const ACE_String_Base_Const_Iterator <ACE_CHAR_T> & rhs) const;
834 bool operator > (const ACE_String_Base_Const_Iterator <ACE_CHAR_T> & rhs) const;
836 bool operator <= (const ACE_String_Base_Const_Iterator <ACE_CHAR_T> & rhs) const;
837 bool operator >= (const ACE_String_Base_Const_Iterator <ACE_CHAR_T> & rhs) const;
839 private:
840 /// Target string to iterate over.
841 const ACE_String_Base <ACE_CHAR_T> * str_;
843 /// Current location in the string.
844 size_t index_;
847 template < class ACE_CHAR_T >
848 ACE_String_Base < ACE_CHAR_T > operator + (const ACE_String_Base < ACE_CHAR_T > &,
849 const ACE_String_Base < ACE_CHAR_T > &);
850 template < class ACE_CHAR_T >
851 ACE_String_Base < ACE_CHAR_T > operator + (const ACE_String_Base < ACE_CHAR_T > &,
852 const ACE_CHAR_T *);
853 template < class ACE_CHAR_T >
854 ACE_String_Base < ACE_CHAR_T > operator + (const ACE_CHAR_T *,
855 const ACE_String_Base < ACE_CHAR_T > &);
857 template < class ACE_CHAR_T >
858 ACE_String_Base < ACE_CHAR_T > operator + (const ACE_String_Base < ACE_CHAR_T > &t,
859 const ACE_CHAR_T c);
861 template < class ACE_CHAR_T >
862 ACE_String_Base < ACE_CHAR_T > operator + (const ACE_CHAR_T c,
863 const ACE_String_Base < ACE_CHAR_T > &t);
865 template <class ACE_CHAR_T>
866 bool operator == (const ACE_CHAR_T *s,
867 const ACE_String_Base<ACE_CHAR_T> &t);
869 template <class ACE_CHAR_T>
870 bool operator != (const ACE_CHAR_T *s,
871 const ACE_String_Base<ACE_CHAR_T> &t);
873 ACE_END_VERSIONED_NAMESPACE_DECL
875 #if defined (__ACE_INLINE__)
876 #include "ace/String_Base.inl"
877 #endif /* __ACE_INLINE__ */
879 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
880 #include "ace/String_Base.cpp"
881 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
883 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
884 #pragma implementation ("String_Base.cpp")
885 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
887 #include /**/ "ace/post.h"
889 #endif /* ACE_STRING_BASE_H */