basic_string.h File Reference

#include <bits/atomicity.h>
#include <debug/debug.h>

Include dependency graph for basic_string.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  std

Functions

template<typename CharT, typename Traits, typename Alloc>
basic_string< CharT, Traits,
Alloc > 
operator+ (const basic_string< CharT, Traits, Alloc > &__lhs, const basic_string< CharT, Traits, Alloc > &__rhs)
 Concatenate two strings.
template<typename CharT, typename Traits, typename Alloc>
basic_string< CharT, Traits,
Alloc > 
operator+ (const CharT *__lhs, const basic_string< CharT, Traits, Alloc > &__rhs)
 Concatenate C string and string.
template<typename CharT, typename Traits, typename Alloc>
basic_string< CharT, Traits,
Alloc > 
operator+ (CharT __lhs, const basic_string< CharT, Traits, Alloc > &__rhs)
 Concatenate character and string.
template<typename CharT, typename Traits, typename Alloc>
basic_string< CharT, Traits,
Alloc > 
operator+ (const basic_string< CharT, Traits, Alloc > &__lhs, const CharT *__rhs)
 Concatenate string and C string.
template<typename CharT, typename Traits, typename Alloc>
basic_string< CharT, Traits,
Alloc > 
operator+ (const basic_string< CharT, Traits, Alloc > &__lhs, CharT __rhs)
 Concatenate string and character.
template<typename CharT, typename Traits, typename Alloc>
bool operator== (const basic_string< CharT, Traits, Alloc > &__lhs, const basic_string< CharT, Traits, Alloc > &__rhs)
 Test equivalence of two strings.
template<typename CharT, typename Traits, typename Alloc>
bool operator== (const CharT *__lhs, const basic_string< CharT, Traits, Alloc > &__rhs)
 Test equivalence of C string and string.
template<typename CharT, typename Traits, typename Alloc>
bool operator== (const basic_string< CharT, Traits, Alloc > &__lhs, const CharT *__rhs)
 Test equivalence of string and C string.
template<typename CharT, typename Traits, typename Alloc>
bool operator!= (const basic_string< CharT, Traits, Alloc > &__lhs, const basic_string< CharT, Traits, Alloc > &__rhs)
 Test difference of two strings.
template<typename CharT, typename Traits, typename Alloc>
bool operator!= (const CharT *__lhs, const basic_string< CharT, Traits, Alloc > &__rhs)
 Test difference of C string and string.
template<typename CharT, typename Traits, typename Alloc>
bool operator!= (const basic_string< CharT, Traits, Alloc > &__lhs, const CharT *__rhs)
 Test difference of string and C string.
template<typename CharT, typename Traits, typename Alloc>
bool operator< (const basic_string< CharT, Traits, Alloc > &__lhs, const basic_string< CharT, Traits, Alloc > &__rhs)
 Test if string precedes string.
template<typename CharT, typename Traits, typename Alloc>
bool operator< (const basic_string< CharT, Traits, Alloc > &__lhs, const CharT *__rhs)
 Test if string precedes C string.
template<typename CharT, typename Traits, typename Alloc>
bool operator< (const CharT *__lhs, const basic_string< CharT, Traits, Alloc > &__rhs)
 Test if C string precedes string.
template<typename CharT, typename Traits, typename Alloc>
bool operator> (const basic_string< CharT, Traits, Alloc > &__lhs, const basic_string< CharT, Traits, Alloc > &__rhs)
 Test if string follows string.
template<typename CharT, typename Traits, typename Alloc>
bool operator> (const basic_string< CharT, Traits, Alloc > &__lhs, const CharT *__rhs)
 Test if string follows C string.
template<typename CharT, typename Traits, typename Alloc>
bool operator> (const CharT *__lhs, const basic_string< CharT, Traits, Alloc > &__rhs)
 Test if C string follows string.
template<typename CharT, typename Traits, typename Alloc>
bool operator<= (const basic_string< CharT, Traits, Alloc > &__lhs, const basic_string< CharT, Traits, Alloc > &__rhs)
 Test if string doesn't follow string.
template<typename CharT, typename Traits, typename Alloc>
bool operator<= (const basic_string< CharT, Traits, Alloc > &__lhs, const CharT *__rhs)
 Test if string doesn't follow C string.
template<typename CharT, typename Traits, typename Alloc>
bool operator<= (const CharT *__lhs, const basic_string< CharT, Traits, Alloc > &__rhs)
 Test if C string doesn't follow string.
template<typename CharT, typename Traits, typename Alloc>
bool operator>= (const basic_string< CharT, Traits, Alloc > &__lhs, const basic_string< CharT, Traits, Alloc > &__rhs)
 Test if string doesn't precede string.
template<typename CharT, typename Traits, typename Alloc>
bool operator>= (const basic_string< CharT, Traits, Alloc > &__lhs, const CharT *__rhs)
 Test if string doesn't precede C string.
template<typename CharT, typename Traits, typename Alloc>
bool operator>= (const CharT *__lhs, const basic_string< CharT, Traits, Alloc > &__rhs)
 Test if C string doesn't precede string.
template<typename CharT, typename Traits, typename Alloc>
void swap (basic_string< CharT, Traits, Alloc > &__lhs, basic_string< CharT, Traits, Alloc > &__rhs)
 Swap contents of two strings.
template<typename CharT, typename Traits, typename Alloc>
basic_istream< CharT, Traits > & operator>> (basic_istream< CharT, Traits > &__is, basic_string< CharT, Traits, Alloc > &str)
 Read stream into a string.
template<typename CharT, typename Traits, typename Alloc>
basic_ostream< CharT, Traits > & operator<< (basic_ostream< CharT, Traits > &__os, const basic_string< CharT, Traits, Alloc > &str)
 Write string to a stream.
template<typename CharT, typename Traits, typename Alloc>
basic_istream< CharT, Traits > & getline (basic_istream< CharT, Traits > &__is, basic_string< CharT, Traits, Alloc > &str, CharT __delim)
 Read a line from stream into a string.
template<typename CharT, typename Traits, typename Alloc>
basic_istream< CharT, Traits > & getline (basic_istream< CharT, Traits > &__is, basic_string< CharT, Traits, Alloc > &str)
 Read a line from stream into a string.


Detailed Description

This is an internal header file, included by other library headers. You should not attempt to use it directly.

Definition in file basic_string.h.


Function Documentation

template<typename CharT, typename Traits, typename Alloc>
basic_istream< CharT, Traits > & std::getline basic_istream< CharT, Traits > &  __is,
basic_string< CharT, Traits, Alloc > &  str
[inline]
 

Read a line from stream into a string.

Parameters:
is Input stream.
str Buffer to store into.
Returns:
Reference to the input stream.
Stores characters from is into str until '
' is found, the end of the stream is encountered, or str.max_size() is reached. If is.width() is non-zero, that is the limit on the number of characters stored into str. Any previous contents of str are erased. If end of line was encountered, it is extracted but not stored into str.

Definition at line 1162 of file istream.tcc.

template<typename CharT, typename Traits, typename Alloc>
basic_istream< CharT, Traits > & std::getline basic_istream< CharT, Traits > &  __is,
basic_string< CharT, Traits, Alloc > &  str,
CharT  __delim
 

Read a line from stream into a string.

Parameters:
is Input stream.
str Buffer to store into.
delim Character marking end of line.
Returns:
Reference to the input stream.
Stores characters from is into str until delim is found, the end of the stream is encountered, or str.max_size() is reached. If is.width() is non-zero, that is the limit on the number of characters stored into str. Any previous contents of str are erased. If delim was encountered, it is extracted but not stored into str.

Definition at line 1093 of file istream.tcc.

References std::basic_string< CharT, Traits, Alloc >::append(), std::ios_base::badbit, std::ios_base::eofbit, std::basic_string< CharT, Traits, Alloc >::erase(), std::ios_base::failbit, std::ios_base::goodbit, and std::basic_string< CharT, Traits, Alloc >::max_size().

template<typename CharT, typename Traits, typename Alloc>
bool std::operator!= const basic_string< CharT, Traits, Alloc > &  __lhs,
const CharT *  __rhs
[inline]
 

Test difference of string and C string.

Parameters:
lhs String.
rhs C string.
Returns:
True if lhs.compare(rhs) != 0. False otherwise.

Definition at line 2120 of file basic_string.h.

template<typename CharT, typename Traits, typename Alloc>
bool std::operator!= const CharT *  __lhs,
const basic_string< CharT, Traits, Alloc > &  __rhs
[inline]
 

Test difference of C string and string.

Parameters:
lhs C string.
rhs String.
Returns:
True if rhs.compare(lhs) != 0. False otherwise.

Definition at line 2108 of file basic_string.h.

References std::basic_string< CharT, Traits, Alloc >::compare().

template<typename CharT, typename Traits, typename Alloc>
bool std::operator!= const basic_string< CharT, Traits, Alloc > &  __lhs,
const basic_string< CharT, Traits, Alloc > &  __rhs
[inline]
 

Test difference of two strings.

Parameters:
lhs First string.
rhs Second string.
Returns:
True if lhs.compare(rhs) != 0. False otherwise.

Definition at line 2096 of file basic_string.h.

References std::basic_string< CharT, Traits, Alloc >::compare().

template<typename CharT, typename Traits, typename Alloc>
basic_string<CharT, Traits, Alloc> std::operator+ const basic_string< CharT, Traits, Alloc > &  __lhs,
CharT  __rhs
[inline]
 

Concatenate string and character.

Parameters:
lhs First string.
rhs Last string.
Returns:
New string with lhs followed by rhs.

Definition at line 2041 of file basic_string.h.

template<typename CharT, typename Traits, typename Alloc>
basic_string<CharT, Traits, Alloc> std::operator+ const basic_string< CharT, Traits, Alloc > &  __lhs,
const CharT *  __rhs
[inline]
 

Concatenate string and C string.

Parameters:
lhs First string.
rhs Last string.
Returns:
New string with lhs followed by rhs.

Definition at line 2025 of file basic_string.h.

References std::basic_string< CharT, Traits, Alloc >::append().

template<typename CharT, typename Traits, typename Alloc>
basic_string< CharT, Traits, Alloc > std::operator+ CharT  __lhs,
const basic_string< CharT, Traits, Alloc > &  __rhs
 

Concatenate character and string.

Parameters:
lhs First string.
rhs Last string.
Returns:
New string with lhs followed by rhs.

Definition at line 663 of file basic_string.tcc.

References std::basic_string< CharT, Traits, Alloc >::size().

template<typename CharT, typename Traits, typename Alloc>
basic_string< CharT, Traits, Alloc > std::operator+ const CharT *  __lhs,
const basic_string< CharT, Traits, Alloc > &  __rhs
 

Concatenate C string and string.

Parameters:
lhs First string.
rhs Last string.
Returns:
New string with value of lhs followed by rhs.

Definition at line 647 of file basic_string.tcc.

References std::basic_string< CharT, Traits, Alloc >::size().

template<typename CharT, typename Traits, typename Alloc>
basic_string<CharT, Traits, Alloc> std::operator+ const basic_string< CharT, Traits, Alloc > &  __lhs,
const basic_string< CharT, Traits, Alloc > &  __rhs
 

Concatenate two strings.

Parameters:
lhs First string.
rhs Last string.
Returns:
New string with value of lhs followed by rhs.

Definition at line 1988 of file basic_string.h.

References std::basic_string< CharT, Traits, Alloc >::append().

template<typename CharT, typename Traits, typename Alloc>
bool std::operator< const CharT *  __lhs,
const basic_string< CharT, Traits, Alloc > &  __rhs
[inline]
 

Test if C string precedes string.

Parameters:
lhs C string.
rhs String.
Returns:
True if lhs precedes rhs. False otherwise.

Definition at line 2157 of file basic_string.h.

References std::basic_string< CharT, Traits, Alloc >::compare().

template<typename CharT, typename Traits, typename Alloc>
bool std::operator< const basic_string< CharT, Traits, Alloc > &  __lhs,
const CharT *  __rhs
[inline]
 

Test if string precedes C string.

Parameters:
lhs String.
rhs C string.
Returns:
True if lhs precedes rhs. False otherwise.

Definition at line 2145 of file basic_string.h.

template<typename CharT, typename Traits, typename Alloc>
bool std::operator< const basic_string< CharT, Traits, Alloc > &  __lhs,
const basic_string< CharT, Traits, Alloc > &  __rhs
[inline]
 

Test if string precedes string.

Parameters:
lhs First string.
rhs Second string.
Returns:
True if lhs precedes rhs. False otherwise.

Definition at line 2133 of file basic_string.h.

template<typename CharT, typename Traits, typename Alloc>
basic_ostream< CharT, Traits > & std::operator<< basic_ostream< CharT, Traits > &  __os,
const basic_string< CharT, Traits, Alloc > &  str
 

Write string to a stream.

Parameters:
os Output stream.
str String to write out.
Returns:
Reference to the output stream.
Output characters of str into os following the same rules as for writing a C string.

Definition at line 643 of file ostream.tcc.

template<typename CharT, typename Traits, typename Alloc>
bool std::operator<= const CharT *  __lhs,
const basic_string< CharT, Traits, Alloc > &  __rhs
[inline]
 

Test if C string doesn't follow string.

Parameters:
lhs C string.
rhs String.
Returns:
True if lhs doesn't follow rhs. False otherwise.

Definition at line 2231 of file basic_string.h.

References std::basic_string< CharT, Traits, Alloc >::compare().

template<typename CharT, typename Traits, typename Alloc>
bool std::operator<= const basic_string< CharT, Traits, Alloc > &  __lhs,
const CharT *  __rhs
[inline]
 

Test if string doesn't follow C string.

Parameters:
lhs String.
rhs C string.
Returns:
True if lhs doesn't follow rhs. False otherwise.

Definition at line 2219 of file basic_string.h.

template<typename CharT, typename Traits, typename Alloc>
bool std::operator<= const basic_string< CharT, Traits, Alloc > &  __lhs,
const basic_string< CharT, Traits, Alloc > &  __rhs
[inline]
 

Test if string doesn't follow string.

Parameters:
lhs First string.
rhs Second string.
Returns:
True if lhs doesn't follow rhs. False otherwise.

Definition at line 2207 of file basic_string.h.

template<typename CharT, typename Traits, typename Alloc>
bool std::operator== const basic_string< CharT, Traits, Alloc > &  __lhs,
const CharT *  __rhs
[inline]
 

Test equivalence of string and C string.

Parameters:
lhs String.
rhs C string.
Returns:
True if lhs.compare(rhs) == 0. False otherwise.

Definition at line 2083 of file basic_string.h.

template<typename CharT, typename Traits, typename Alloc>
bool std::operator== const CharT *  __lhs,
const basic_string< CharT, Traits, Alloc > &  __rhs
[inline]
 

Test equivalence of C string and string.

Parameters:
lhs C string.
rhs String.
Returns:
True if rhs.compare(lhs) == 0. False otherwise.

Definition at line 2071 of file basic_string.h.

References std::basic_string< CharT, Traits, Alloc >::compare().

template<typename CharT, typename Traits, typename Alloc>
bool std::operator== const basic_string< CharT, Traits, Alloc > &  __lhs,
const basic_string< CharT, Traits, Alloc > &  __rhs
[inline]
 

Test equivalence of two strings.

Parameters:
lhs First string.
rhs Second string.
Returns:
True if lhs.compare(rhs) == 0. False otherwise.

Definition at line 2059 of file basic_string.h.

template<typename CharT, typename Traits, typename Alloc>
bool std::operator> const CharT *  __lhs,
const basic_string< CharT, Traits, Alloc > &  __rhs
[inline]
 

Test if C string follows string.

Parameters:
lhs C string.
rhs String.
Returns:
True if lhs follows rhs. False otherwise.

Definition at line 2194 of file basic_string.h.

References std::basic_string< CharT, Traits, Alloc >::compare().

template<typename CharT, typename Traits, typename Alloc>
bool std::operator> const basic_string< CharT, Traits, Alloc > &  __lhs,
const CharT *  __rhs
[inline]
 

Test if string follows C string.

Parameters:
lhs String.
rhs C string.
Returns:
True if lhs follows rhs. False otherwise.

Definition at line 2182 of file basic_string.h.

template<typename CharT, typename Traits, typename Alloc>
bool std::operator> const basic_string< CharT, Traits, Alloc > &  __lhs,
const basic_string< CharT, Traits, Alloc > &  __rhs
[inline]
 

Test if string follows string.

Parameters:
lhs First string.
rhs Second string.
Returns:
True if lhs follows rhs. False otherwise.

Definition at line 2170 of file basic_string.h.

template<typename CharT, typename Traits, typename Alloc>
bool std::operator>= const CharT *  __lhs,
const basic_string< CharT, Traits, Alloc > &  __rhs
[inline]
 

Test if C string doesn't precede string.

Parameters:
lhs C string.
rhs String.
Returns:
True if lhs doesn't precede rhs. False otherwise.

Definition at line 2268 of file basic_string.h.

References std::basic_string< CharT, Traits, Alloc >::compare().

template<typename CharT, typename Traits, typename Alloc>
bool std::operator>= const basic_string< CharT, Traits, Alloc > &  __lhs,
const CharT *  __rhs
[inline]
 

Test if string doesn't precede C string.

Parameters:
lhs String.
rhs C string.
Returns:
True if lhs doesn't precede rhs. False otherwise.

Definition at line 2256 of file basic_string.h.

template<typename CharT, typename Traits, typename Alloc>
bool std::operator>= const basic_string< CharT, Traits, Alloc > &  __lhs,
const basic_string< CharT, Traits, Alloc > &  __rhs
[inline]
 

Test if string doesn't precede string.

Parameters:
lhs First string.
rhs Second string.
Returns:
True if lhs doesn't precede rhs. False otherwise.

Definition at line 2244 of file basic_string.h.

template<typename CharT, typename Traits, typename Alloc>
basic_istream< CharT, Traits > & std::operator>> basic_istream< CharT, Traits > &  __is,
basic_string< CharT, Traits, Alloc > &  str
 

Read stream into a string.

Parameters:
is Input stream.
str Buffer to store into.
Returns:
Reference to the input stream.
Stores characters from is into str until whitespace is found, the end of the stream is encountered, or str.max_size() is reached. If is.width() is non-zero, that is the limit on the number of characters stored into str. Any previous contents of str are erased.

Definition at line 1027 of file istream.tcc.

References std::basic_string< CharT, Traits, Alloc >::append(), std::ios_base::badbit, std::ios_base::eofbit, std::basic_string< CharT, Traits, Alloc >::erase(), std::ios_base::failbit, std::ios_base::goodbit, and std::basic_string< CharT, Traits, Alloc >::max_size().

template<typename CharT, typename Traits, typename Alloc>
void std::swap basic_string< CharT, Traits, Alloc > &  __lhs,
basic_string< CharT, Traits, Alloc > &  __rhs
[inline]
 

Swap contents of two strings.

Parameters:
lhs First string.
rhs Second string.
Exchanges the contents of lhs and rhs in constant time.

Definition at line 2281 of file basic_string.h.

Referenced by __gnu_debug::Safe_sequence_base::M_swap(), std::vector< Type, Allocator >::swap(), std::list< Type, Allocator >::swap(), and std::deque< Type, Allocator >::swap().


Generated on Fri May 6 01:09:26 2005 for libstdc++-v3 Source by  doxygen 1.4.2