Doxygen
FileNameFn类 参考

Custom combined key compare and hash functor that uses a lower case string in case CASE_SENSE_NAMES is set to NO. 更多...

#include <filename.h>

Public 成员函数

std::size_t operator() (const std::string &input) const noexcept
 used as hash function 更多...
 
bool operator() (const std::string &t1, const std::string &t2) const
 used as equal operator 更多...
 

Private 成员函数

std::string searchKey (std::string input) const
 

详细描述

Custom combined key compare and hash functor that uses a lower case string in case CASE_SENSE_NAMES is set to NO.

在文件 filename.h44 行定义.

成员函数说明

◆ operator()() [1/2]

std::size_t FileNameFn::operator() ( const std::string &  input) const
inlinenoexcept

used as hash function

在文件 filename.h48 行定义.

49  {
50  return std::hash<std::string>()(searchKey(input));
51  }

引用了 searchKey().

◆ operator()() [2/2]

bool FileNameFn::operator() ( const std::string &  t1,
const std::string &  t2 
) const
inline

used as equal operator

在文件 filename.h53 行定义.

54  {
55  return searchKey(t1) == searchKey(t2);
56  }

引用了 searchKey().

◆ searchKey()

std::string FileNameFn::searchKey ( std::string  input) const
inlineprivate

在文件 filename.h58 行定义.

59  {
60  std::string key = input;
61  if (!Config_getBool(CASE_SENSE_NAMES))
62  {
63  // convert key to lower case
64  std::transform(key.begin(),key.end(),key.begin(),
65  [](char c){ return (char)std::tolower(c); });
66  }
67  return key;
68  }

引用了 Config_getBool.

被这些函数引用 operator()().


该类的文档由以下文件生成:
FileNameFn::searchKey
std::string searchKey(std::string input) const
Definition: filename.h:58
Config_getBool
#define Config_getBool(name)
Definition: config.h:33