Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

char_traits



Summary

A traits class with types and operations for the basic_string container and iostream classes.

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include <string>
template<class charT>
struct char_traits

Description

The template structure char_traits<charT> defines the types and functions necessary to implement the iostreams and string template classes. It is templatized on charT, which represents the character container type. Each specialized version of char_traits<charT> includes the default definitions corresponding to the specialized character container type.

Users have to provide specialization for char_traits if they use character types other than char and wchar_t.

Interface

Types

char_type
int_type
off_type
pos_type
state_type

Types Default-Values

specialization type on char on wchar_t
char_type
char
wchar_t
int_type
int
wint_t
off_type
streamoff
wstreamoff
pos_type
streampos
wstreampos
state_type
mbstate_t
mbstate_t

Value Functions

void 
assign(char_type& c1, const char_type& c2);
char_type*
assign(char_type* s, size_t n, const char_type& a);
char_type* 
copy(char_type* s1, const char_type* s2, size_t n);
int_type 
eof();
const char_type* 
find(const char_type* s, int n, const char_type& a);
size_t 
length(const char_type* s);
char_type* 
move(char_type* s1, const char_type* s2, size_t n);
int_type 
not_eof(const int_type& c);

Test Functions

int 
compare(const char_type* s1,const char_type* s2,size_t n);
bool 
eq(const char_type& c1, const char_type& c2);
bool 
eq_int_type(const int_type& c1, const int_type& c2);
bool 
lt(const char_type& c1,const char_type& c2);

Conversion Functions

char_type 
to_char_type(const int_type& c);
int_type 
to_int_type(const char_type& c);

See Also

iosfwd(3C++), fpos(3C++)

Working Paper for Draft Proposed International Standard for Information Systems--Programming Language C++, Section 21.1.4, 21.1.5, 27.1.2.

Standards Conformance

ANSI X3J16/ISO WG21 Joint C++ Committee



Previous fileTop of documentContentsIndexNext file
©Copyright 1998, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.
OEM Release, June 1998