OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
recordcmp.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_MWWORLD_RECORDCMP_H
2 #define OPENMW_MWWORLD_RECORDCMP_H
3 
4 #include <cctype>
5 
7 
9 
10 namespace MWWorld
11 {
12  struct RecordCmp
13  {
14  template <class T>
15  bool operator()(const T &x, const T& y) const {
16  return x.mId < y.mId;
17  }
18  };
19 
20  template <>
21  inline bool RecordCmp::operator()<ESM::Dialogue>(const ESM::Dialogue &x, const ESM::Dialogue &y) const {
22  return Misc::StringUtils::ciLess(x.mId, y.mId);
23  }
24 
25  template <>
26  inline bool RecordCmp::operator()<ESM::Cell>(const ESM::Cell &x, const ESM::Cell &y) const {
27  return Misc::StringUtils::ciLess(x.mName, y.mName);
28  }
29 
30  template <>
31  inline bool RecordCmp::operator()<ESM::Pathgrid>(const ESM::Pathgrid &x, const ESM::Pathgrid &y) const {
32  return Misc::StringUtils::ciLess(x.mCell, y.mCell);
33  }
34 
35 } // end namespace
36 #endif
static bool ciLess(const std::string &x, const std::string &y)
Definition: stringops.hpp:58
Definition: loaddial.hpp:21
Definition: recordcmp.hpp:12
bool operator()(const T &x, const T &y) const
Definition: recordcmp.hpp:15
Definition: loadpgrd.hpp:16
Definition: loadcell.hpp:64