made wxHashMap work with any form of strings

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45097 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2007-03-28 09:46:46 +00:00
parent 4ca056ea2b
commit ad78ab8c50
2 changed files with 23 additions and 25 deletions

View File

@@ -561,21 +561,29 @@ public:
wxPointerEqual& operator=(const wxPointerEqual&) { return *this; }
};
// wxString, char*, wxChar*
// wxString, char*, wchar_t*
class WXDLLIMPEXP_BASE wxStringHash
{
public:
wxStringHash() {}
unsigned long operator()( const wxString& x ) const
{ return wxCharStringHash( x.c_str() ); }
unsigned long operator()( const wxChar* x ) const
{ return wxCharStringHash( x ); }
static unsigned long wxCharStringHash( const wxChar* );
#if wxUSE_UNICODE
{ return stringHash( x.wx_str() ); }
unsigned long operator()( const wchar_t* x ) const
{ return stringHash( x ); }
unsigned long operator()( const char* x ) const
{ return charStringHash( x ); }
static unsigned long charStringHash( const char* );
#endif // wxUSE_UNICODE
{ return stringHash( x ); }
#if WXWIN_COMPATIBILITY_2_8
static unsigned long wxCharStringHash( const wxChar* x )
{ return stringHash(x); }
#if wxUSE_UNICODE
static unsigned long charStringHash( const char* x )
{ return stringHash(x); }
#endif
#endif // WXWIN_COMPATIBILITY_2_8
static unsigned long stringHash( const wchar_t* );
static unsigned long stringHash( const char* );
wxStringHash& operator=(const wxStringHash&) { return *this; }
};