Doxygen
Loading...
Searching...
No Matches
FileNameFn Class Reference

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

#include <src/filename.h>

Public Member Functions

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 Member Functions

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

Detailed Description

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

Definition at line 45 of file filename.h.

Member Function Documentation

◆ operator()() [1/2]

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

used as hash function

Definition at line 49 of file filename.h.

50 {
51 return std::hash<std::string>()(searchKey(input));
52 }
std::string searchKey(const std::string &input) const
Definition filename.h:59

References searchKey().

◆ operator()() [2/2]

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

used as equal operator

Definition at line 54 of file filename.h.

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

References searchKey().

◆ searchKey()

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

Definition at line 59 of file filename.h.

60 {
61 std::string key = input;
62 if (!getCaseSenseNames())
63 {
64 key = convertUTF8ToLower(key);
65 }
66 return key;
67 }
std::string convertUTF8ToLower(const std::string &input)
Converts the input string into a lower case version, also taking into account non-ASCII characters th...
Definition utf8.cpp:187
bool getCaseSenseNames()
Definition util.cpp:3674

References convertUTF8ToLower(), and getCaseSenseNames().

Referenced by operator()(), and operator()().


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