Mantid
Loading...
Searching...
No Matches
CaseInsensitiveMap.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9#include <cstring>
10#include <map>
11#include <string>
12
13namespace Mantid {
14namespace Kernel {
15
19 bool operator()(const std::string &s1, const std::string &s2) const {
20#ifdef _MSC_VER
21 return _stricmp(s1.c_str(), s2.c_str()) < 0;
22#else
23 return strcasecmp(s1.c_str(), s2.c_str()) < 0;
24#endif
25 }
26};
27
30template <class T> using CaseInsensitiveMap = std::map<std::string, T, CaseInsensitiveStringComparator>;
31} // namespace Kernel
32} // namespace Mantid
std::map< std::string, T, CaseInsensitiveStringComparator > CaseInsensitiveMap
Alias template for a map data structure that has case insensitive string comparision with a variable ...
Helper class which provides the Collimation Length for SANS instruments.
Functor to provide a case insensitive string comparator.
bool operator()(const std::string &s1, const std::string &s2) const