1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 03:39:14 +00:00
OpenMW/apps/openmw/mwworld/recordcmp.hpp

35 lines
920 B
C++
Raw Normal View History

2012-11-03 16:20:16 +00:00
#ifndef OPENMW_MWWORLD_RECORDCMP_H
#define OPENMW_MWWORLD_RECORDCMP_H
#include <components/esm/records.hpp>
#include <components/misc/stringops.hpp>
2012-11-03 16:20:16 +00:00
namespace MWWorld
{
struct RecordCmp
{
template <class T>
bool operator()(const T &x, const T& y) const {
return x.mId < y.mId;
}
};
template <>
2012-11-06 11:10:57 +00:00
inline bool RecordCmp::operator()<ESM::Dialogue>(const ESM::Dialogue &x, const ESM::Dialogue &y) const {
2012-12-23 19:23:24 +00:00
return Misc::StringUtils::ciLess(x.mId, y.mId);
2012-11-03 16:20:16 +00:00
}
template <>
2012-11-06 11:10:57 +00:00
inline bool RecordCmp::operator()<ESM::Cell>(const ESM::Cell &x, const ESM::Cell &y) const {
2012-12-23 19:23:24 +00:00
return Misc::StringUtils::ciLess(x.mName, y.mName);
2012-11-03 16:20:16 +00:00
}
template <>
2012-11-06 11:10:57 +00:00
inline bool RecordCmp::operator()<ESM::Pathgrid>(const ESM::Pathgrid &x, const ESM::Pathgrid &y) const {
2012-12-23 19:23:24 +00:00
return Misc::StringUtils::ciLess(x.mCell, y.mCell);
2012-11-03 16:20:16 +00:00
}
} // end namespace
#endif