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

#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 42 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 46 of file filename.h.

47 {
48 return std::hash<std::string>()(searchKey(input));
49 }
std::string searchKey(const std::string &input) const
Definition filename.h:56

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 51 of file filename.h.

52 {
53 return searchKey(t1) == searchKey(t2);
54 }

References searchKey().

◆ searchKey()

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

Definition at line 56 of file filename.h.

57 {
58 std::string key = input;
59 if (!useCaseSenseNames())
60 {
61 key = convertUTF8ToLower(key);
62 }
63 return key;
64 }
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:188
bool useCaseSenseNames()
Returns true if the names of the symbols can be case sensitive.
Definition util.cpp:2681

References convertUTF8ToLower(), and useCaseSenseNames().

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


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