ReactOS 0.4.15-dev-7846-g8ba6c66
__char_traits_base< _CharT, _IntT > Class Template Reference

#include <char_traits.h>

Public Types

typedef _CharT char_type
 
typedef _IntT int_type
 
typedef streamoff off_type
 
typedef streampos pos_type
 
typedef mbstate_t state_type
 

Static Public Member Functions

static void _STLP_CALL assign (char_type &__c1, const char_type &__c2)
 
static bool _STLP_CALL eq (const char_type &__c1, const char_type &__c2)
 
static bool _STLP_CALL lt (const char_type &__c1, const char_type &__c2)
 
static int _STLP_CALL compare (const char_type *__s1, const char_type *__s2, size_t __n)
 
static size_t _STLP_CALL length (const char_type *__s)
 
static const char_type *_STLP_CALL find (const char_type *__s, size_t __n, const char_type &__c)
 
static char_type *_STLP_CALL move (char_type *__s1, const char_type *__s2, size_t _Sz)
 
static char_type *_STLP_CALL copy (char_type *__s1, const char_type *__s2, size_t __n)
 
static char_type *_STLP_CALL assign (char_type *__s, size_t __n, char_type __c)
 
static int_type _STLP_CALL not_eof (const int_type &__c)
 
static char_type _STLP_CALL to_char_type (const int_type &__c)
 
static int_type _STLP_CALL to_int_type (const char_type &__c)
 
static bool _STLP_CALL eq_int_type (const int_type &__c1, const int_type &__c2)
 
static int_type _STLP_CALL eof ()
 

Detailed Description

template<class _CharT, class _IntT>
class __char_traits_base< _CharT, _IntT >

Definition at line 132 of file char_traits.h.

Member Typedef Documentation

◆ char_type

template<class _CharT , class _IntT >
typedef _CharT __char_traits_base< _CharT, _IntT >::char_type

Definition at line 134 of file char_traits.h.

◆ int_type

template<class _CharT , class _IntT >
typedef _IntT __char_traits_base< _CharT, _IntT >::int_type

Definition at line 135 of file char_traits.h.

◆ off_type

template<class _CharT , class _IntT >
typedef streamoff __char_traits_base< _CharT, _IntT >::off_type

Definition at line 136 of file char_traits.h.

◆ pos_type

template<class _CharT , class _IntT >
typedef streampos __char_traits_base< _CharT, _IntT >::pos_type

Definition at line 137 of file char_traits.h.

◆ state_type

template<class _CharT , class _IntT >
typedef mbstate_t __char_traits_base< _CharT, _IntT >::state_type

Definition at line 138 of file char_traits.h.

Member Function Documentation

◆ assign() [1/2]

template<class _CharT , class _IntT >
static void _STLP_CALL __char_traits_base< _CharT, _IntT >::assign ( char_type __c1,
const char_type __c2 
)
inlinestatic

Definition at line 140 of file char_traits.h.

140{ __c1 = __c2; }

◆ assign() [2/2]

template<class _CharT , class _IntT >
static char_type *_STLP_CALL __char_traits_base< _CharT, _IntT >::assign ( char_type __s,
size_t  __n,
char_type  __c 
)
inlinestatic

Definition at line 175 of file char_traits.h.

175 {
176 for (size_t __i = 0; __i < __n; ++__i)
177 __s[__i] = __c;
178 return __s;
179 }
return __n
Definition: _algo.h:75
#define __c
Definition: schilyio.h:209

◆ compare()

template<class _CharT , class _IntT >
static int _STLP_CALL __char_traits_base< _CharT, _IntT >::compare ( const char_type __s1,
const char_type __s2,
size_t  __n 
)
inlinestatic

Definition at line 146 of file char_traits.h.

146 {
147 for (size_t __i = 0; __i < __n; ++__i)
148 if (!eq(__s1[__i], __s2[__i]))
149 return __s1[__i] < __s2[__i] ? -1 : 1;
150 return 0;
151 }
#define eq(received, expected, label, type)
Definition: locale.c:144

◆ copy()

template<class _CharT , class _IntT >
static char_type *_STLP_CALL __char_traits_base< _CharT, _IntT >::copy ( char_type __s1,
const char_type __s2,
size_t  __n 
)
inlinestatic

Definition at line 170 of file char_traits.h.

170 {
171 return (__n == 0 ? __s1 :
172 (char_type*)memcpy(__s1, __s2, __n * sizeof(char_type)));
173 }
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

◆ eof()

template<class _CharT , class _IntT >
static int_type _STLP_CALL __char_traits_base< _CharT, _IntT >::eof ( )
inlinestatic

Definition at line 193 of file char_traits.h.

194 { return (int_type)-1; }

Referenced by __char_traits_base< _CharT, _IntT >::not_eof().

◆ eq()

template<class _CharT , class _IntT >
static bool _STLP_CALL __char_traits_base< _CharT, _IntT >::eq ( const char_type __c1,
const char_type __c2 
)
inlinestatic

Definition at line 141 of file char_traits.h.

142 { return __c1 == __c2; }

◆ eq_int_type()

template<class _CharT , class _IntT >
static bool _STLP_CALL __char_traits_base< _CharT, _IntT >::eq_int_type ( const int_type __c1,
const int_type __c2 
)
inlinestatic

Definition at line 190 of file char_traits.h.

191 { return __c1 == __c2; }

Referenced by __char_traits_base< _CharT, _IntT >::not_eof().

◆ find()

template<class _CharT , class _IntT >
static const char_type *_STLP_CALL __char_traits_base< _CharT, _IntT >::find ( const char_type __s,
size_t  __n,
const char_type __c 
)
inlinestatic

Definition at line 160 of file char_traits.h.

160 {
161 for ( ; __n > 0 ; ++__s, --__n)
162 if (eq(*__s, __c))
163 return __s;
164 return 0;
165 }

◆ length()

template<class _CharT , class _IntT >
static size_t _STLP_CALL __char_traits_base< _CharT, _IntT >::length ( const char_type __s)
inlinestatic

Definition at line 153 of file char_traits.h.

153 {
155 size_t __i(0);
156 for (; !eq(__s[__i], _NullChar); ++__i) {}
157 return __i;
158 }
#define _STLP_DEFAULT_CONSTRUCTED(_TTp)
Definition: _construct.h:265

◆ lt()

template<class _CharT , class _IntT >
static bool _STLP_CALL __char_traits_base< _CharT, _IntT >::lt ( const char_type __c1,
const char_type __c2 
)
inlinestatic

Definition at line 143 of file char_traits.h.

144 { return __c1 < __c2; }

◆ move()

template<class _CharT , class _IntT >
static char_type *_STLP_CALL __char_traits_base< _CharT, _IntT >::move ( char_type __s1,
const char_type __s2,
size_t  _Sz 
)
inlinestatic

Definition at line 167 of file char_traits.h.

168 { return (_Sz == 0 ? __s1 : (char_type*)memmove(__s1, __s2, _Sz * sizeof(char_type))); }
#define memmove(s1, s2, n)
Definition: mkisofs.h:881

◆ not_eof()

template<class _CharT , class _IntT >
static int_type _STLP_CALL __char_traits_base< _CharT, _IntT >::not_eof ( const int_type __c)
inlinestatic

Definition at line 181 of file char_traits.h.

182 { return !eq_int_type(__c, eof()) ? __c : __STATIC_CAST(int_type, 0); }
static bool _STLP_CALL eq_int_type(const int_type &__c1, const int_type &__c2)
Definition: char_traits.h:190
static int_type _STLP_CALL eof()
Definition: char_traits.h:193
#define __STATIC_CAST(__x, __y)
Definition: features.h:585

◆ to_char_type()

template<class _CharT , class _IntT >
static char_type _STLP_CALL __char_traits_base< _CharT, _IntT >::to_char_type ( const int_type __c)
inlinestatic

Definition at line 184 of file char_traits.h.

185 { return (char_type)__c; }

◆ to_int_type()

template<class _CharT , class _IntT >
static int_type _STLP_CALL __char_traits_base< _CharT, _IntT >::to_int_type ( const char_type __c)
inlinestatic

Definition at line 187 of file char_traits.h.

188 { return (int_type)__c; }

The documentation for this class was generated from the following file: