File indexing completed on 2025-01-18 10:04:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _Standard_CStringHasher_HeaderFile
0015 #define _Standard_CStringHasher_HeaderFile
0016
0017 #include <Standard_CString.hxx>
0018 #include <Standard_HashUtils.hxx>
0019 #include <Standard_TypeDef.hxx>
0020
0021 #include <functional>
0022
0023 class Standard_CStringHasher
0024 {
0025 public:
0026
0027 size_t operator()(const Standard_CString& theString) const noexcept
0028 {
0029 const int aLen = static_cast<int>(strlen(theString));
0030 if (aLen < 4)
0031 {
0032 return opencascade::FNVHash::hash_combine(*theString, aLen);
0033 }
0034 return opencascade::hashBytes(theString, aLen);
0035 }
0036
0037 bool operator()(const Standard_CString& theString1,
0038 const Standard_CString& theString2) const noexcept
0039 {
0040 return strcmp(theString1, theString2) == 0;
0041 }
0042
0043 };
0044
0045 #endif