qBittorrent
Utils::Compare::NaturalCompare< caseSensitivity > Class Template Reference

#include <compare.h>

Public Member Functions

 NaturalCompare ()
 
int operator() (const QString &left, const QString &right) const
 

Private Attributes

QCollator m_collator
 

Detailed Description

template<Qt::CaseSensitivity caseSensitivity>
class Utils::Compare::NaturalCompare< caseSensitivity >

Definition at line 45 of file compare.h.

Constructor & Destructor Documentation

◆ NaturalCompare()

template<Qt::CaseSensitivity caseSensitivity>
Utils::Compare::NaturalCompare< caseSensitivity >::NaturalCompare ( )
inline

Definition at line 48 of file compare.h.

49  {
50  m_collator.setNumericMode(true);
51  m_collator.setCaseSensitivity(caseSensitivity);
52  }

References Utils::Compare::NaturalCompare< caseSensitivity >::m_collator.

Member Function Documentation

◆ operator()()

template<Qt::CaseSensitivity caseSensitivity>
int Utils::Compare::NaturalCompare< caseSensitivity >::operator() ( const QString &  left,
const QString &  right 
) const
inline

Definition at line 54 of file compare.h.

55  {
56  return m_collator.compare(left, right);
57  }

References Utils::Compare::NaturalCompare< caseSensitivity >::m_collator.

Member Data Documentation

◆ m_collator

template<Qt::CaseSensitivity caseSensitivity>
QCollator Utils::Compare::NaturalCompare< caseSensitivity >::m_collator
private

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