__gnu_cxx::char_traits< _CharT > Struct Template Reference

Base class used to implement std::char_traits. More...

#include <char_traits.h>

Inheritance diagram for __gnu_cxx::char_traits< _CharT >:

std::char_traits< _CharT > __gnu_cxx::encoding_char_traits< _CharT > List of all members.

Public Types

typedef _CharT char_type
typedef _Char_types< _CharT
>::int_type 
int_type
typedef _Char_types< _CharT
>::pos_type 
pos_type
typedef _Char_types< _CharT
>::off_type 
off_type
typedef _Char_types< _CharT
>::state_type 
state_type

Static Public Member Functions

static void assign (char_type &__c1, const char_type &__c2)
static bool eq (const char_type &__c1, const char_type &__c2)
static bool lt (const char_type &__c1, const char_type &__c2)
static int compare (const char_type *__s1, const char_type *__s2, std::size_t __n)
static std::size_t length (const char_type *__s)
static const char_typefind (const char_type *__s, std::size_t __n, const char_type &__a)
static char_typemove (char_type *__s1, const char_type *__s2, std::size_t __n)
static char_typecopy (char_type *__s1, const char_type *__s2, std::size_t __n)
static char_typeassign (char_type *__s, std::size_t __n, char_type __a)
static char_type to_char_type (const int_type &__c)
static int_type to_int_type (const char_type &__c)
static bool eq_int_type (const int_type &__c1, const int_type &__c2)
static int_type eof ()
static int_type not_eof (const int_type &__c)

Detailed Description

template<typename _CharT>
struct __gnu_cxx::char_traits< _CharT >

Base class used to implement std::char_traits.

Note:
For any given actual character type, this definition is probably wrong. (Most of the member functions are likely to be right, but the int_type and state_type typedefs, and the eof() member function, are likely to be wrong.) The reason this class exists is so users can specialize it. Classes in namespace std may not be specialized for fundamentl types, but classes in namespace __gnu_cxx may be.
See http://gcc.gnu.org/onlinedocs/libstdc++/21_strings/howto.html#5 for advice on how to make use of this class for "unusual" character types. Also, check out include/ext/pod_char_traits.h.

Definition at line 87 of file char_traits.h.


Member Typedef Documentation

template<typename _CharT>
typedef _CharT __gnu_cxx::char_traits< _CharT >::char_type

Definition at line 89 of file char_traits.h.

template<typename _CharT>
typedef _Char_types<_CharT>::int_type __gnu_cxx::char_traits< _CharT >::int_type

Definition at line 90 of file char_traits.h.

template<typename _CharT>
typedef _Char_types<_CharT>::off_type __gnu_cxx::char_traits< _CharT >::off_type

Definition at line 92 of file char_traits.h.

template<typename _CharT>
typedef _Char_types<_CharT>::pos_type __gnu_cxx::char_traits< _CharT >::pos_type

Reimplemented in __gnu_cxx::encoding_char_traits< _CharT >.

Definition at line 91 of file char_traits.h.

template<typename _CharT>
typedef _Char_types<_CharT>::state_type __gnu_cxx::char_traits< _CharT >::state_type

Reimplemented in __gnu_cxx::encoding_char_traits< _CharT >.

Definition at line 93 of file char_traits.h.


Member Function Documentation

template<typename _CharT>
char_traits< _CharT >::char_type * __gnu_cxx::char_traits< _CharT >::assign ( char_type __s,
std::size_t  __n,
char_type  __a 
) [static]

Definition at line 202 of file char_traits.h.

References std::fill_n().

template<typename _CharT>
static void __gnu_cxx::char_traits< _CharT >::assign ( char_type __c1,
const char_type __c2 
) [inline, static]

Definition at line 96 of file char_traits.h.

template<typename _CharT>
int __gnu_cxx::char_traits< _CharT >::compare ( const char_type __s1,
const char_type __s2,
std::size_t  __n 
) [static]

Definition at line 149 of file char_traits.h.

References __gnu_cxx::char_traits< _CharT >::lt().

template<typename _CharT>
char_traits< _CharT >::char_type * __gnu_cxx::char_traits< _CharT >::copy ( char_type __s1,
const char_type __s2,
std::size_t  __n 
) [static]

Definition at line 193 of file char_traits.h.

References std::copy().

template<typename _CharT>
static int_type __gnu_cxx::char_traits< _CharT >::eof (  )  [inline, static]

Definition at line 138 of file char_traits.h.

Referenced by std::char_traits< char >::not_eof(), and __gnu_cxx::char_traits< _CharT >::not_eof().

template<typename _CharT>
static bool __gnu_cxx::char_traits< _CharT >::eq ( const char_type __c1,
const char_type __c2 
) [inline, static]

Definition at line 100 of file char_traits.h.

Referenced by __gnu_cxx::char_traits< _CharT >::find(), and __gnu_cxx::char_traits< _CharT >::length().

template<typename _CharT>
static bool __gnu_cxx::char_traits< _CharT >::eq_int_type ( const int_type __c1,
const int_type __c2 
) [inline, static]

Definition at line 134 of file char_traits.h.

Referenced by __gnu_cxx::char_traits< _CharT >::not_eof().

template<typename _CharT>
const char_traits< _CharT >::char_type * __gnu_cxx::char_traits< _CharT >::find ( const char_type __s,
std::size_t  __n,
const char_type __a 
) [static]

Definition at line 173 of file char_traits.h.

References __gnu_cxx::char_traits< _CharT >::eq().

template<typename _CharT>
std::size_t __gnu_cxx::char_traits< _CharT >::length ( const char_type __s  )  [static]

Definition at line 162 of file char_traits.h.

References __gnu_cxx::char_traits< _CharT >::eq().

template<typename _CharT>
static bool __gnu_cxx::char_traits< _CharT >::lt ( const char_type __c1,
const char_type __c2 
) [inline, static]

Definition at line 104 of file char_traits.h.

Referenced by __gnu_cxx::char_traits< _CharT >::compare().

template<typename _CharT>
char_traits< _CharT >::char_type * __gnu_cxx::char_traits< _CharT >::move ( char_type __s1,
const char_type __s2,
std::size_t  __n 
) [static]

Definition at line 184 of file char_traits.h.

template<typename _CharT>
static int_type __gnu_cxx::char_traits< _CharT >::not_eof ( const int_type __c  )  [inline, static]

Definition at line 142 of file char_traits.h.

References __gnu_cxx::char_traits< _CharT >::eof(), __gnu_cxx::char_traits< _CharT >::eq_int_type(), and __gnu_cxx::char_traits< _CharT >::to_int_type().

template<typename _CharT>
static char_type __gnu_cxx::char_traits< _CharT >::to_char_type ( const int_type __c  )  [inline, static]

Definition at line 126 of file char_traits.h.

template<typename _CharT>
static int_type __gnu_cxx::char_traits< _CharT >::to_int_type ( const char_type __c  )  [inline, static]

Definition at line 130 of file char_traits.h.

Referenced by __gnu_cxx::char_traits< _CharT >::not_eof().


The documentation for this struct was generated from the following file:
Generated on Tue Feb 2 16:57:51 2010 for GNU C++ STL by  doxygen 1.4.7