WvStreams
wvhash.h
1/* -*- Mode: C++ -*-
2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
4 *
5 * Common hash functions for use with wvscatterhash.h and wvhashtable.h.
6 */
7#ifndef __WVHASH_H
8#define __WVHASH_H
9
10#include "wvstring.h"
11
12// predefined hashing functions (note: string hashes are case-insensitive)
13unsigned WvHash(WvStringParm s);
14unsigned WvHash(const char *s);
15unsigned WvHash(const int &i);
16unsigned WvHash(const void *p);
17
18
19// Default comparison function used by WvHashTable
20template <class K>
22{
23 static bool compare(const K *key1, const K *key2)
24 { return *key1 == *key2; }
25};
26
27
28// Case-insensitive comparison function for WvHashTable
29template <class K>
31{
32 static bool compare(const K *key1, const K *key2)
33 { return strcasecmp(*key1, *key2) == 0; }
34};
35
36#endif // __WVHASH_H
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
Definition wvstring.h:94