STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
_Regex_traits< _Elem > Class Template Reference
Inheritance diagram for _Regex_traits< _Elem >:
_Regex_traits_base

Public Types

typedef make_unsigned< _Elem >::type _Uelem
 
typedef _Regex_traits< _Elem > _Myt
 
typedef _Elem char_type
 
typedef size_t size_type
 
typedef basic_string< _Elem > string_type
 
typedef locale locale_type
 
- Public Types inherited from _Regex_traits_base
enum  _Char_class_type {
  _Ch_none = 0, _Ch_alnum = ctype_base::alnum, _Ch_alpha = ctype_base::alpha, _Ch_cntrl = ctype_base::cntrl,
  _Ch_digit = ctype_base::digit, _Ch_graph = ctype_base::graph, _Ch_lower = ctype_base::lower, _Ch_print = ctype_base::print,
  _Ch_punct = ctype_base::punct, _Ch_space = ctype_base::space, _Ch_upper = ctype_base::upper, _Ch_xdigit = ctype_base::xdigit,
  _Ch_blank = ctype_base::blank
}
 
typedef ctype_base::mask char_class_type
 

Public Member Functions

 _Regex_traits ()
 
 _Regex_traits (const _Myt &_Right)
 
_Mytoperator= (const _Myt &_Right)
 
_Elem translate (_Elem _Ch) const
 
_Elem translate_nocase (_Elem _Ch) const
 
template<class _FwdIt >
string_type transform (_FwdIt _First, _FwdIt _Last) const
 
template<class _FwdIt >
string_type transform_primary (_FwdIt _First, _FwdIt _Last) const
 
bool isctype (_Elem _Ch, char_class_type _Fx) const
 
template<class _Iter >
char_class_type lookup_classname (_Iter _First, _Iter _Last, bool _Icase=false) const
 
template<class _FwdIt >
string_type lookup_collatename (_FwdIt _First, _FwdIt _Last) const
 
locale_type imbue (locale_type _Lx)
 
locale_type getloc () const
 
const collate< _Elem > * _Getcoll () const
 
const ctype< _Elem > * _Getctype () const
 

Static Public Member Functions

static size_type length (const _Elem *_Str)
 

Private Member Functions

void _Cache_locale ()
 

Private Attributes

const collate< _Elem > * _Pcoll
 
const ctype< _Elem > * _Pctype
 
locale_type _Loc
 

Member Typedef Documentation

template<class _Elem>
typedef _Regex_traits<_Elem> _Regex_traits< _Elem >::_Myt
template<class _Elem>
typedef make_unsigned<_Elem>::type _Regex_traits< _Elem >::_Uelem
template<class _Elem>
typedef _Elem _Regex_traits< _Elem >::char_type
template<class _Elem>
typedef locale _Regex_traits< _Elem >::locale_type
template<class _Elem>
typedef size_t _Regex_traits< _Elem >::size_type
template<class _Elem>
typedef basic_string<_Elem> _Regex_traits< _Elem >::string_type

Constructor & Destructor Documentation

template<class _Elem>
_Regex_traits< _Elem >::_Regex_traits ( )
inline
276  { // default construct
277  _Cache_locale();
278  }
void _Cache_locale()
Definition: regex:410
template<class _Elem>
_Regex_traits< _Elem >::_Regex_traits ( const _Myt _Right)
inline
281  : _Loc(_Right._Loc)
282  { // copy construct
283  _Cache_locale();
284  }
locale_type _Loc
Definition: regex:418
void _Cache_locale()
Definition: regex:410
constexpr const _Ty &() _Right
Definition: algorithm:3723

Member Function Documentation

template<class _Elem>
void _Regex_traits< _Elem >::_Cache_locale ( )
inlineprivate
411  { // populate _Pcoll and _Pctype with _Loc locale
414  }
const collate< _Elem > * _Pcoll
Definition: regex:416
const ctype< _Elem > * _Pctype
Definition: regex:417
#define _USE(loc, fac)
Definition: xlocale:499
Definition: xlocale:2077
locale_type _Loc
Definition: regex:418
Definition: locale:24
template<class _Elem>
const collate<_Elem>* _Regex_traits< _Elem >::_Getcoll ( ) const
inline
400  { // get collate facet pointer
401  return (_Pcoll);
402  }
const collate< _Elem > * _Pcoll
Definition: regex:416
template<class _Elem>
const ctype<_Elem>* _Regex_traits< _Elem >::_Getctype ( ) const
inline
405  { // get ctype facet pointer
406  return (_Pctype);
407  }
const ctype< _Elem > * _Pctype
Definition: regex:417
template<class _Elem>
locale_type _Regex_traits< _Elem >::getloc ( ) const
inline
395  { // return locale object
396  return (_Loc);
397  }
locale_type _Loc
Definition: regex:418
template<class _Elem>
locale_type _Regex_traits< _Elem >::imbue ( locale_type  _Lx)
inline
387  { // store locale object
388  locale_type _Tmp = _Loc;
389  _Loc = _Lx;
390  _Cache_locale();
391  return (_Tmp);
392  }
locale_type _Loc
Definition: regex:418
void _Cache_locale()
Definition: regex:410
locale locale_type
Definition: regex:268
template<class _Elem>
bool _Regex_traits< _Elem >::isctype ( _Elem  _Ch,
char_class_type  _Fx 
) const
inline
328  { // return true if _Ch is in character class _Fx
329  if (_Fx != (char_class_type)(-1))
330  return (_Getctype()->is(_Fx, _Ch));
331  else
332  return (_Ch == '_' // assumes L'_' == '_'
333  || _Getctype()->is(_Ch_alnum, _Ch));
334  }
const ctype< _Elem > * _Getctype() const
Definition: regex:404
Definition: regex:242
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
ctype_base::mask char_class_type
Definition: regex:255
template<class _Elem>
static size_type _Regex_traits< _Elem >::length ( const _Elem *  _Str)
inlinestatic
271  { // return length of _Str
272  return (char_traits<_Elem>::length(_Str));
273  }
Definition: iosfwd:247
template<class _Elem>
template<class _Iter >
char_class_type _Regex_traits< _Elem >::lookup_classname ( _Iter  _First,
_Iter  _Last,
bool  _Icase = false 
) const
inline
339  { // map [_First, _Last) to character class mask value
340  #define _REGEX_CHAR_CLASS_NAME(n, c) \
341  {n, L ## n, sizeof (n) / sizeof (n[0]) - 1, c}
342  static constexpr _Cl_names _Names[] =
343  { // map class names to numeric constants
359  {0, 0, 0},
360  };
361  #undef _REGEX_CHAR_CLASS_NAME
362 
363  _DEBUG_RANGE(_First, _Last);
364  unsigned int _Ix = 0;
365  for (; _Names[_Ix]._Get<_Elem>(); ++_Ix)
366  if (_STD equal(_First, _Last,
367  _Names[_Ix]._Get<_Elem>(),
368  _Names[_Ix]._Get<_Elem>() + _Names[_Ix]._Len,
370  break;
371 
373  if (_Names[_Ix]._Get<_Elem>() != 0)
374  _Mask = _Names[_Ix]._Ctype;
375  if (_Icase && _Mask & (_Ch_lower | _Ch_upper))
376  _Mask |= _Ch_lower | _Ch_upper;
377  return (_Mask);
378  }
Definition: regex:196
Definition: regex:249
Definition: regex:251
#define _DEBUG_RANGE(first, last)
Definition: xutility:902
Definition: regex:244
Definition: regex:162
Definition: regex:259
Definition: regex:242
Definition: regex:243
Definition: regex:252
#define _REGEX_CHAR_CLASS_NAME(n, c)
Definition: regex:248
short mask
Definition: xlocale:2063
ctype_base::mask char_class_type
Definition: regex:255
Definition: regex:253
bool equal(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2)
Definition: memory:611
Definition: regex:247
Definition: regex:245
_CRT_MANAGED_FP_DEPRECATE _In_ unsigned int _Mask
Definition: float.h:235
Definition: regex:250
Definition: regex:246
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem>
template<class _FwdIt >
string_type _Regex_traits< _Elem >::lookup_collatename ( _FwdIt  _First,
_FwdIt  _Last 
) const
inline
382  { // map [_First, _Last) to collation element
383  return (string_type(_First, _Last));
384  }
basic_string< _Elem > string_type
Definition: regex:267
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem>
_Myt& _Regex_traits< _Elem >::operator= ( const _Myt _Right)
inline
287  { // assign
288  _Loc = _Right._Loc;
289  _Cache_locale();
290  return (*this);
291  }
locale_type _Loc
Definition: regex:418
void _Cache_locale()
Definition: regex:410
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem>
template<class _FwdIt >
string_type _Regex_traits< _Elem >::transform ( _FwdIt  _First,
_FwdIt  _Last 
) const
inline
306  { // apply locale-specific transformation
307  return (_Getcoll()->transform(_First, _Last));
308  }
const collate< _Elem > * _Getcoll() const
Definition: regex:399
string_type transform(_FwdIt _First, _FwdIt _Last) const
Definition: regex:305
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem>
template<class _FwdIt >
string_type _Regex_traits< _Elem >::transform_primary ( _FwdIt  _First,
_FwdIt  _Last 
) const
inline
312  { // apply locale-specific case-insensitive transformation
313  string_type _Res;
314 
315  if (_First != _Last)
316  { // non-empty string, transform it
317  vector<_Elem> _Temp(_First, _Last);
318 
319  _Getctype()->tolower(&*_Temp.begin(),
320  &*_Temp.begin() + _Temp.size());
321  _Res = _Getcoll()->transform(&*_Temp.begin(),
322  &*_Temp.begin() + _Temp.size());
323  }
324  return (_Res);
325  }
const ctype< _Elem > * _Getctype() const
Definition: regex:404
const collate< _Elem > * _Getcoll() const
Definition: regex:399
Definition: vector:699
basic_string< _Elem > string_type
Definition: regex:267
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem>
_Elem _Regex_traits< _Elem >::translate ( _Elem  _Ch) const
inline
294  { // provide locale-sensitive mapping
295  string_type _Res = _Getcoll()->transform(&_Ch, &_Ch + 1);
296  return (_Res.length() == 1 ? _Res[0] : _Ch);
297  }
const collate< _Elem > * _Getcoll() const
Definition: regex:399
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
basic_string< _Elem > string_type
Definition: regex:267
template<class _Elem>
_Elem _Regex_traits< _Elem >::translate_nocase ( _Elem  _Ch) const
inline
300  { // provide case-insensitive mapping
301  return (_Getctype()->tolower(_Ch));
302  }
const ctype< _Elem > * _Getctype() const
Definition: regex:404
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Elem() tolower(_Elem _Ch, const locale &_Loc)
Definition: locale:259

Member Data Documentation

template<class _Elem>
locale_type _Regex_traits< _Elem >::_Loc
private
template<class _Elem>
const collate<_Elem>* _Regex_traits< _Elem >::_Pcoll
private
template<class _Elem>
const ctype<_Elem>* _Regex_traits< _Elem >::_Pctype
private

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