|
VMS Help CXXLSTD, string, string_char_traits *Conan The Librarian |
Standard C++ Library
NAME
string_char_traits_ - A traits class providing types and operations
to the basic_string container.
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
The basic character type. Same as the template parameter.
OPERATIONS
static
void assign (char_type& c1, const char_type& c2)
Assign one character value to another. The value of c2 is assigned
to c1.
static
char_type* assign (char_type* s, size_t n, const char_type& a)
Assign one character value to n elements of a character array.
The value of a is assigned to n elements of s.
static
bool eq (const char_type& c1, const char_type& c2)
Return true if c1 equals c2.
static
bool ne (const char_type& c1, const char_type& c2)
Return true if c1 does not equal c2.
static
bool lt (const char_type& c1, const char_type& c2)
Return true if c1 is less than c2.
static
char_type eos ()
Return the end of string value for the the character type.
Typically char_type().
static
int compare (const char_type* s1, const char_type* s2,
size_t n)
Compare n values from s1 with n values from s2. Return 1 if
s1 is greater than s2, -1 if s1 is less than s2, or 0 if they
are equal.
static
size_t length (const char_type * s)
Return the length of the null terminated character array s. The eos
terminator is not counted.
static
char_type* copy (char_type* s1, const char_type* s2, size_t n)
Copy n values from s1 to s2. The ranges of (s1,s1+n) and (s2,s2+n)
may not overlap.
static
char_type* move (char_type* s1, const char_type* s2, size_t n)
Move n values from s1 to s2. The ranges of (s1,s1+n) and
(s2,s2+n) may overlap.
static
const char_type* find (const char_type* s, int n,
const char_type& a)
Look for the value of a in s. Only n elements of s are
examined. Returns a pointer to the matched element if one is
found. Otherwise returns s + n.
SEE ALSO
basic_string, traits
STANDARDS CONFORMANCE
ANSI X3J16/ISO WG21 Joint C++ Committee
|
|