home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
StringHash.hxx
< prev
next >
Wrap
Text File
|
1996-05-31
|
1KB
|
46 lines
/*---------------------------------------------------------------------------
*
* (c) Westmount Technology 1991
*
* File: @(#)StringHash.hxx 1.1 (1.1) (1.3)
* Author: sipi
* Description: declaration of Hashable class for strings
*---------------------------------------------------------------------------
SccsId = @(#)StringHash.hxx 1.1 (1.1) (1.3)\t09 Nov 1993 Copyright 1992 Westmount Technology */
#ifndef STRINGHASH_HXX
#define STRINGHASH_HXX
#ifndef HASHTBL_HXX
#include <HashTbl.hxx>
#endif
#ifndef STRING_HXX
#include <String.hxx>
#endif
class StringHash: public Hashable {
private:
String key;
public:
// Note: a copy is made of given strings
//
StringHash(const char *mykey) : key(mykey) {}
StringHash(const String &mykey);
~StringHash();
// Append extra text to the key
// Note: don't use this function after this object has been placed
// in a hashtable
//
void append_to_key(const char *extra) {key += extra;}
unsigned hash() const;
int isEqual(const Hashable& otherkey) const;
const String& get_key() const {return key;}
};
#endif