Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Click here to view the latest version of this page.
PrevUpHomeNext

Struct template null_regex_traits

boost::xpressive::null_regex_traits — stub regex_traits for non-char data

Synopsis

// In header: <boost/xpressive/traits/null_regex_traits.hpp>

template<typename Elem> 
struct null_regex_traits {
  // types
  typedef Elem                       char_type;      
  typedef std::vector< char_type >   string_type;    
  typedef unspecified                locale_type;    
  typedef int                        char_class_type;
  typedef regex_traits_version_1_tag version_tag;    

  // construct/copy/destruct
  null_regex_traits(locale_type = locale_type());

  // public member functions
  bool operator==(null_regex_traits< char_type > const &) const;
  bool operator!=(null_regex_traits< char_type > const &) const;
  char_type widen(char) const;

  // public static functions
  static unsigned char hash(char_type) ;
  static char_type translate(char_type) ;
  static char_type translate_nocase(char_type) ;
  static bool in_range(char_type, char_type, char_type) ;
  static bool in_range_nocase(char_type, char_type, char_type) ;
  template<typename FwdIter> static string_type transform(FwdIter, FwdIter) ;
  template<typename FwdIter> 
    static string_type transform_primary(FwdIter, FwdIter) ;
  template<typename FwdIter> 
    static string_type lookup_collatename(FwdIter, FwdIter) ;
  template<typename FwdIter> 
    static char_class_type lookup_classname(FwdIter, FwdIter, bool) ;
  static bool isctype(char_type, char_class_type) ;
  static int value(char_type, int) ;
  static locale_type imbue(locale_type) ;
  static locale_type getloc() ;
};

Description

null_regex_traits public construct/copy/destruct

  1. null_regex_traits(locale_type = locale_type());

    Initialize a null_regex_traits object.

null_regex_traits public member functions

  1. bool operator==(null_regex_traits< char_type > const & that) const;

    Checks two null_regex_traits objects for equality

    Returns:

    true.

  2. bool operator!=(null_regex_traits< char_type > const & that) const;

    Checks two null_regex_traits objects for inequality

    Returns:

    false.

  3. char_type widen(char ch) const;

    Convert a char to a Elem

    Parameters:

    ch

    The source character.

    Returns:

    Elem(ch).

null_regex_traits public static functions

  1. static unsigned char hash(char_type ch) ;

    Returns a hash value for a Elem in the range [0, UCHAR_MAX]

    Parameters:

    ch

    The source character.

    Returns:

    a value between 0 and UCHAR_MAX, inclusive.

  2. static char_type translate(char_type ch) ;

    No-op

    Parameters:

    ch

    The source character.

    Returns:

    ch

  3. static char_type translate_nocase(char_type ch) ;

    No-op

    Parameters:

    ch

    The source character.

    Returns:

    ch

  4. static bool in_range(char_type first, char_type last, char_type ch) ;

    Checks to see if a character is within a character range.

    Parameters:

    ch

    The source character.

    first

    The bottom of the range, inclusive.

    last

    The top of the range, inclusive.

    Returns:

    first <= ch && ch <= last.

  5. static bool in_range_nocase(char_type first, char_type last, char_type ch) ;

    Checks to see if a character is within a character range.

    Parameters:

    ch

    The source character.

    first

    The bottom of the range, inclusive.

    last

    The top of the range, inclusive.

    Returns:

    first <= ch && ch <= last.

    Notes:

    Since the null_regex_traits does not do case-folding, this function is equivalent to in_range().

  6. template<typename FwdIter> 
      static string_type transform(FwdIter begin, FwdIter end) ;

    Returns a sort key for the character sequence designated by the iterator range [F1, F2) such that if the character sequence [G1, G2) sorts before the character sequence [H1, H2) then v.transform(G1, G2) < v.transform(H1, H2).

    Notes:

    Not currently used

  7. template<typename FwdIter> 
      static string_type transform_primary(FwdIter begin, FwdIter end) ;

    Returns a sort key for the character sequence designated by the iterator range [F1, F2) such that if the character sequence [G1, G2) sorts before the character sequence [H1, H2) when character case is not considered then v.transform_primary(G1, G2) < v.transform_primary(H1, H2).

    Notes:

    Not currently used

  8. template<typename FwdIter> 
      static string_type lookup_collatename(FwdIter begin, FwdIter end) ;

    Returns a sequence of characters that represents the collating element consisting of the character sequence designated by the iterator range [F1, F2). Returns an empty string if the character sequence is not a valid collating element.

    Notes:

    Not currently used

  9. template<typename FwdIter> 
      static char_class_type 
      lookup_classname(FwdIter begin, FwdIter end, bool icase) ;

    The null_regex_traits does not have character classifications, so lookup_classname() is unused.

    Parameters:

    begin

    not used

    end

    not used

    icase

    not used

    Returns:

    static_cast<char_class_type>(0)

  10. static bool isctype(char_type ch, char_class_type mask) ;

    The null_regex_traits does not have character classifications, so isctype() is unused.

    Parameters:

    ch

    not used

    mask

    not used

    Returns:

    false

  11. static int value(char_type ch, int radix) ;

    The null_regex_traits recognizes no elements as digits, so value() is unused.

    Parameters:

    ch

    not used

    radix

    not used

    Returns:

    -1

  12. static locale_type imbue(locale_type loc) ;

    Not used

    Parameters:

    loc

    not used

    Returns:

    loc

  13. static locale_type getloc() ;

    Returns locale_type().

    Returns:

    locale_type()


PrevUpHomeNext