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

Public Types

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 Attributes

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

Static Private Attributes

static const _Cl_names< _Elem > _Names []
 

Member Typedef Documentation

template<class _Elem>
typedef _Regex_traits<_Elem> _Regex_traits< _Elem >::_Myt
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
313  : _Pcoll(0), _Pctype(0)
314  { // default construct
315  }
const collate< _Elem > * _Pcoll
Definition: regex:430
const ctype< _Elem > * _Pctype
Definition: regex:431
template<class _Elem>
_Regex_traits< _Elem >::_Regex_traits ( const _Myt _Right)
inline
318  : _Pcoll(0), _Pctype(0), _Loc(_Right._Loc)
319  { // copy construct
320  }
const collate< _Elem > * _Pcoll
Definition: regex:430
const ctype< _Elem > * _Pctype
Definition: regex:431
locale_type _Loc
Definition: regex:432
const _Ty & _Right
Definition: algorithm:4087

Member Function Documentation

template<class _Elem>
const collate<_Elem>* _Regex_traits< _Elem >::_Getcoll ( ) const
inline
414  { // get collate facet pointer
415  if (_Pcoll == 0)
416  *((const collate<_Elem> **)&_Pcoll) =
418  return (_Pcoll);
419  }
const collate< _Elem > * _Pcoll
Definition: regex:430
#define _USE(loc, fac)
Definition: xlocale:555
locale_type getloc() const
Definition: regex:408
Definition: locale:23
template<class _Elem>
const ctype<_Elem>* _Regex_traits< _Elem >::_Getctype ( ) const
inline
422  { // get ctype facet pointer
423  if (_Pctype == 0)
424  *((const ctype<_Elem> **)&_Pctype) =
425  &_USE(getloc(), ctype<_Elem>);
426  return (_Pctype);
427  }
const ctype< _Elem > * _Pctype
Definition: regex:431
#define _USE(loc, fac)
Definition: xlocale:555
locale_type getloc() const
Definition: regex:408
Definition: xlocale:2113
template<class _Elem>
locale_type _Regex_traits< _Elem >::getloc ( ) const
inline
409  { // return locale object
410  return (_Loc);
411  }
locale_type _Loc
Definition: regex:432
template<class _Elem>
locale_type _Regex_traits< _Elem >::imbue ( locale_type  _Lx)
inline
400  { // store locale object
401  _Pcoll = 0;
402  _Pctype = 0;
403  locale_type _Tmp = _Loc;
404  _Loc = _Lx;
405  return (_Tmp);
406  }
const collate< _Elem > * _Pcoll
Definition: regex:430
const ctype< _Elem > * _Pctype
Definition: regex:431
locale_type _Loc
Definition: regex:432
locale locale_type
Definition: regex:302
template<class _Elem>
bool _Regex_traits< _Elem >::isctype ( _Elem  _Ch,
char_class_type  _Fx 
) const
inline
365  { // return true if _Ch is in character class _Fx
366  if (_Fx != (char_class_type)(-1))
367  return (_Getctype()->is(_Fx, _Ch));
368  else
369  return (_Ch == '_' // assumes L'_' == '_'
370  || _Getctype()->is(_Ch_alnum, _Ch));
371  }
const ctype< _Elem > * _Getctype() const
Definition: regex:421
Definition: regex:277
ctype_base::mask char_class_type
Definition: regex:290
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
template<class _Elem>
static size_type _Regex_traits< _Elem >::length ( const _Elem *  _Str)
inlinestatic
305  { // return length of _Str
306  if (_Str == 0)
307  _Xregex_error(
308  regex_constants::error_parse); // to quiet diagnostics
309  return (char_traits<_Elem>::length(_Str));
310  }
Definition: regex:188
Definition: iosfwd:260
template<class _Elem>
template<class _Iter >
char_class_type _Regex_traits< _Elem >::lookup_classname ( _Iter  _First,
_Iter  _Last,
bool  _Icase = false 
) const
inline
376  { // map [_First, _Last) to character class mask value
377  _DEBUG_RANGE(_First, _Last);
378  int _Ix = 0;
379  for (; _Names[_Ix]._Ptr; ++_Ix)
380  if (_Same(_First, _Last,
381  _Names[_Ix]._Ptr, _Names[_Ix]._Ptr + _Names[_Ix]._Len,
383  break;
384 
386  if (_Names[_Ix]._Ptr != 0)
387  _Mask = _Names[_Ix]._Ctype;
388  if (_Icase && _Mask & (_Ch_lower | _Ch_upper))
389  _Mask |= _Ch_lower | _Ch_upper;
390  return (_Mask);
391  }
Definition: regex:219
Definition: regex:286
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
Definition: regex:294
bool _Same(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _Pr _Pred)
Definition: regex:264
static const _Cl_names< _Elem > _Names[]
Definition: regex:434
ctype_base::mask char_class_type
Definition: regex:290
Definition: regex:282
_CRT_MANAGED_FP_DEPRECATE _In_ unsigned int _Mask
Definition: float.h:120
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem>
template<class _FwdIt >
string_type _Regex_traits< _Elem >::lookup_collatename ( _FwdIt  _First,
_FwdIt  _Last 
) const
inline
395  { // map [_First, _Last) to collation element
396  return (string_type(_First, _Last));
397  }
basic_string< _Elem > string_type
Definition: regex:301
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem>
_Myt& _Regex_traits< _Elem >::operator= ( const _Myt _Right)
inline
323  { // assign
324  _Pcoll = 0;
325  _Pctype = 0;
326  _Loc = _Right._Loc;
327  return (*this);
328  }
const collate< _Elem > * _Pcoll
Definition: regex:430
const ctype< _Elem > * _Pctype
Definition: regex:431
locale_type _Loc
Definition: regex:432
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem>
template<class _FwdIt >
string_type _Regex_traits< _Elem >::transform ( _FwdIt  _First,
_FwdIt  _Last 
) const
inline
343  { // apply locale-specific transformation
344  return (_Getcoll()->transform(_First, _Last));
345  }
const collate< _Elem > * _Getcoll() const
Definition: regex:413
string_type transform(_FwdIt _First, _FwdIt _Last) const
Definition: regex:342
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem>
template<class _FwdIt >
string_type _Regex_traits< _Elem >::transform_primary ( _FwdIt  _First,
_FwdIt  _Last 
) const
inline
349  { // apply locale-specific case-insensitive transformation
350  string_type _Res;
351 
352  if (_First != _Last)
353  { // non-empty string, transform it
354  vector<_Elem> _Temp(_First, _Last);
355 
356  _Getctype()->tolower(&*_Temp.begin(),
357  &*_Temp.begin() + _Temp.size());
358  _Res = _Getcoll()->transform(&*_Temp.begin(),
359  &*_Temp.begin() + _Temp.size());
360  }
361  return (_Res);
362  }
const ctype< _Elem > * _Getctype() const
Definition: regex:421
const collate< _Elem > * _Getcoll() const
Definition: regex:413
Definition: vector:649
basic_string< _Elem > string_type
Definition: regex:301
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem>
_Elem _Regex_traits< _Elem >::translate ( _Elem  _Ch) const
inline
331  { // provide locale-sensitive mapping
332  string_type _Res = _Getcoll()->transform(&_Ch, &_Ch + 1);
333  return (_Res.length() == 1 ? _Res[0] : _Ch);
334  }
const collate< _Elem > * _Getcoll() const
Definition: regex:413
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
basic_string< _Elem > string_type
Definition: regex:301
template<class _Elem>
_Elem _Regex_traits< _Elem >::translate_nocase ( _Elem  _Ch) const
inline
337  { // provide case-insensitive mapping
338  return (_Getctype()->tolower(_Ch));
339  }
_Check_return_ _CRT_JIT_INTRINSIC _CRTIMP int __cdecl tolower(_In_ int _C)
const ctype< _Elem > * _Getctype() const
Definition: regex:421
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161

Member Data Documentation

template<class _Elem>
locale_type _Regex_traits< _Elem >::_Loc
private
template<class _Elem>
const _Cl_names<_Elem> _Regex_traits< _Elem >::_Names[]
staticprivate
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: