Top of document
©Copyright 1999 Rogue Wave Software

string_char_traits

Summary

A traits class providing types and operations to the basic_string container.


Contents

Synopsis

#include <string>
template <class charT> struct string_char_traits
struct string_char_traits<char>; .
struct string_char_traits<wchar_t>;

Description

The string_char_traits struct provides elementary operations to instantiations of basic_string. As with all traits classes, string_char_traits is used to specialize the behavior of a template. In this case, the traits class provides functions based on character type to the basic_string template.

Specializations of string_char_traits are provided for char and wchar_t. These are used to define, respectively, string and wstring.

Interface

template <class charT> struct string_char_traits .
{  
typedef charT                    char_type;
static void assign (char_type&, const char_type&); .
static char_type* assign (char_type*, size_t, const char_type&);
static bool eq (const char_type&, const char_type&); .
static bool ne (const char_type&, const char_type&); .
static bool lt (const char_type&, const char_type&); .
static char_type eos ();  .
static int compare (const char_type*, const char_type*, size_t);
.
static size_t length (const char_type * s); .
static char_type* copy (char_type*,  const char_type*, size_t);
.
static char_type* move (char_type*,  const char_type*, size_t);
.
static const char_type*  .
find (const char_type*, int, const char_type&);
};

Type

char_type

Operations

static 
void assign (char_type& c1, const char_type& c2) 
static 
char_type* assign (char_type* s, size_t n, const char_type& a)
static 
bool eq (const char_type& c1, const char_type& c2)
static 
bool ne (const char_type& c1, const char_type& c2)
static 
bool lt (const char_type& c1, const char_type& c2)
static 
char_type eos ()
static 
int compare (const char_type* s1, const char_type* s2, 
             size_t n)
static 
size_t length (const char_type * s)
static 
char_type* copy (char_type* s1, const char_type* s2, size_t n)
static
char_type* move (char_type* s1, const char_type* s2, size_t n)
static 
const char_type* find (const char_type* s, int n, 
       const char_type& a)

See Also

basic_string


Top of document