Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
websocketpp::utility::my_equal< charT > Struct Template Reference

Helper functor for case insensitive find. More...

#include <utilities.hpp>

Public Member Functions

 my_equal (std::locale const &loc)
 Construct the functor with the given locale.
 
bool operator() (charT ch1, charT ch2)
 Perform a case insensitive comparison.
 

Detailed Description

template<typename charT>
struct websocketpp::utility::my_equal< charT >

Based on code from http://stackoverflow.com/questions/3152241/case-insensitive-stdstring-find

templated version of my_equal so it could work with both char and wchar_t

Definition at line 49 of file utilities.hpp.

Constructor & Destructor Documentation

◆ my_equal()

template<typename charT >
websocketpp::utility::my_equal< charT >::my_equal ( std::locale const & loc)
inline
Parameters
[in]locThe locale to use for determining the case of values

Definition at line 54 of file utilities.hpp.

54: m_loc(loc) {}

Member Function Documentation

◆ operator()()

template<typename charT >
bool websocketpp::utility::my_equal< charT >::operator() ( charT ch1,
charT ch2 )
inline
Parameters
ch1The first value to compare
ch2The second value to compare
Returns
Whether or not the two values are equal when both are converted to uppercase using the given locale.

Definition at line 63 of file utilities.hpp.

63 {
64 return std::toupper(ch1, m_loc) == std::toupper(ch2, m_loc);
65 }

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