libStatGen Software 1
StringHashBase Class Referenceabstract
Inheritance diagram for StringHashBase:

Public Member Functions

void setCaseSensitive (bool caseSensitive)
 
virtual void SetSize (int newsize)=0
 

Protected Member Functions

bool stringsEqual (const String &string1, const String &string2) const
 
unsigned int getKey (const String &string) const
 

Protected Attributes

bool myCaseSensitive
 

Detailed Description

Definition at line 26 of file StringHash.h.

Constructor & Destructor Documentation

◆ StringHashBase()

StringHashBase::StringHashBase ( )
inline

Definition at line 30 of file StringHash.h.

31 : myCaseSensitive(false)
32 {}

◆ ~StringHashBase()

virtual StringHashBase::~StringHashBase ( )
inlinevirtual

Definition at line 34 of file StringHash.h.

34{}

Member Function Documentation

◆ getKey()

unsigned int StringHashBase::getKey ( const String string) const
inlineprotected

Definition at line 51 of file StringHash.h.

52 {
53 if(myCaseSensitive)
54 {
55 return(hash(string.uchar(), string.Length(), 0));
56 }
57 // Case insensitive.
58 return(hash_no_case(string.uchar(), string.Length(), 0));
59 }

◆ setCaseSensitive()

void StringHashBase::setCaseSensitive ( bool  caseSensitive)
inline

Definition at line 29 of file StringHash.h.

29{myCaseSensitive = caseSensitive;}

◆ stringsEqual()

bool StringHashBase::stringsEqual ( const String string1,
const String string2 
) const
inlineprotected

Definition at line 40 of file StringHash.h.

41 {
42 if(myCaseSensitive)
43 {
44 // Case sensitive is faster.
45 return(string1.FastCompare(string2) == 0);
46 }
47 // Case insensitive - slow compare - convert to same case.
48 return(string1.SlowCompare(string2) == 0);
49 }

Member Data Documentation

◆ myCaseSensitive

bool StringHashBase::myCaseSensitive
protected

Definition at line 61 of file StringHash.h.


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