home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
SAMPLES
/
ICLCC
/
TOYWORD.H
< prev
next >
Wrap
C/C++ Source or Header
|
1993-05-07
|
2KB
|
45 lines
/******************************************************************************/
/* */
/* COPYRIGHT: */
/* ---------- */
/* Copyright (C) International Business Machines Corp., 1991,1992. */
/* */
/* DISCLAIMER OF WARRANTIES: */
/* ------------------------- */
/* The following [enclosed] code is sample code created by IBM */
/* Corporation. This sample code is not part of any standard IBM product */
/* and is provided to you solely for the purpose of assisting you in the */
/* development of your applications. The code is provided "AS IS", */
/* without warranty of any kind. IBM shall not be liable for any damages */
/* arising out of your use of the sample code, even if they have been */
/* advised of the possibility of such damages. */
/* */
/******************************************************************************/
/*-------------------------------------------------------------*\
| toyword.h - Class Word for use with coding examples. |
\*-------------------------------------------------------------*/
#include "toystrng.h"
class Word : public ToyString {
public:
Word(char* pc) : ToyString(pc) {}
/* Equality op is not required for the collections *\
| that use this Word class. |
| Inequality is not required for the collections |
| either but needed by our example code to |
\* iterate until we hit the Word we searched for */
int operator != (char* anOther) const {
return (!operator==(anOther));
}
};
// Key addess. The length of the word is the key.
inline int const& key (Word const& aWord) {
return aWord.length();
}