Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

TLookupValidator Class Reference

Compares the string typed by a user with a list of acceptable values. More...

#include <validate.h>

Inheritance diagram for TLookupValidator::

TValidator TObject TStreamable TStringLookupValidator List of all members.

Public Methods

 TLookupValidator ()
virtual Boolean isValid (const char *s)
virtual Boolean lookup (const char *s)

Static Public Methods

TStreamablebuild ()

Static Public Attributes

const char* const name

Protected Methods

 TLookupValidator (StreamableInit)

Detailed Description

A lookup validator compares the string typed by a user with a list of acceptable values. TLookupValidator is an abstract validator type from which you can derive useful lookup validators. You will never create an instance of TLookupValidator.

When you create a lookup validator type, you need to specify a list of valid items and override the lookup() method to return True only if the user input matches an item in that list. One example of a working descendant of TLookupValidator is TStringLookupValidator.

Definition at line 752 of file validate.h.


Constructor & Destructor Documentation

TLookupValidator::TLookupValidator ( ) [inline]
 

Undocumented.

Definition at line 758 of file validate.h.

TLookupValidator::TLookupValidator ( StreamableInit ) [protected]
 

Each streamable class needs a "builder" to allocate the correct memory for its objects together with the initialized virtual table pointers. This is achieved by calling this constructor with an argument of type StreamableInit.


Member Function Documentation

TStreamable * TLookupValidator::build ( ) [static]
 

Called to create an object in certain stream-reading situations.

Reimplemented from TValidator.

Reimplemented in TStringLookupValidator.

Boolean TLookupValidator::isValid ( const char * s ) [virtual]
 

Calls lookup() to find the string `s' in the list of valid input items. Returns True if lookup() returns True, meaning lookup() found `s' in its list; otherwise returns False.

Reimplemented from TValidator.

Boolean TLookupValidator::lookup ( const char * s ) [virtual]
 

Searches for the string `s' in the list of valid entries and returns True if it finds `s'; otherwise returns False. TLookupValidator's lookup() is an abstract method that always returns False.

Descendant lookup validator types must override lookup() to perform a search based on the actual list of acceptable items.

Reimplemented in TStringLookupValidator.


Member Data Documentation

const char *const TLookupValidator::name [static]
 

Undocumented.

Reimplemented from TValidator.

Reimplemented in TStringLookupValidator.

Definition at line 781 of file validate.h.


The documentation for this class was generated from the following file:
Generated at Sat Sep 22 20:19:28 2001 for TVision by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001