ManaPlus
Public Member Functions
SortFriendsFunctor Class Reference

#include <socialfriendsfunctor.h>

Public Member Functions

bool operator() (const Avatar *const m1, const Avatar *const m2) const
 

Detailed Description

Definition at line 31 of file socialfriendsfunctor.h.

Member Function Documentation

◆ operator()()

bool SortFriendsFunctor::operator() ( const Avatar *const  m1,
const Avatar *const  m2 
) const
inline

Definition at line 36 of file socialfriendsfunctor.h.

38  {
39  if ((m1 == nullptr) || (m2 == nullptr))
40  return false;
41 
42  if (m1->getOnline() != m2->getOnline())
43  {
44  return static_cast<int>(m1->getOnline()) >
45  static_cast<int>(m2->getOnline());
46  }
47 
48  if (m1->getName() != m2->getName())
49  {
50  std::string s1 = m1->getName();
51  std::string s2 = m2->getName();
52  toLower(s1);
53  toLower(s2);
54  return s1 < s2;
55  }
56  return false;
57  }
bool getOnline() const
Definition: avatar.h:81
std::string getName() const
Definition: avatar.h:53
std::string toLower(std::string const &s)

References Catch::toLower().


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