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

TStringLookupValidator Class Reference

Verifies the data in its associated input line by searching through a collection of valid strings. More...

#include <validate.h>

Inheritance diagram for TStringLookupValidator::

TLookupValidator TValidator TObject TStreamable List of all members.

Public Methods

 TStringLookupValidator (TStringCollection *aStrings)
 ~TStringLookupValidator ()
virtual void error ()
virtual Boolean lookup (const char *s)
void newStringList (TStringCollection *aStrings)

Static Public Methods

TStreamablebuild ()

Static Public Attributes

const char* const name

Protected Methods

 TStringLookupValidator (StreamableInit)
virtual void write (opstream &os)
virtual void* read (ipstream &is)

Protected Attributes

TStringCollectionstrings

Detailed Description

A string lookup validator object verifies the data in its associated input line by searching through a collection of valid strings. Use string lookup validators when your input line needs to accept only members of a certain set of strings.

Definition at line 835 of file validate.h.


Constructor & Destructor Documentation

TStringLookupValidator::TStringLookupValidator ( TStringCollection * aStrings )
 

Constructs a string lookup validator object by first calling the constructor inherited from TLookupValidator, then setting strings data member to `aStrings'.

TStringLookupValidator::~TStringLookupValidator ( )
 

Disposes of the list of valid strings by calling newStringList(0), then disposes of the string lookup object by calling the destructor inherited from TLookupValidator.

See also:
newStringList

TStringLookupValidator::TStringLookupValidator ( 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 * TStringLookupValidator::build ( ) [static]
 

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

Reimplemented from TLookupValidator.

void TStringLookupValidator::error ( ) [virtual]
 

Displays a message box indicating that the typed string does not match an entry in the string list.

Reimplemented from TValidator.

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

Returns True if the string passed in `s' matches any of the strings in strings data member. Uses the strcmp() function to determine if `s' is present.

Reimplemented from TLookupValidator.

void TStringLookupValidator::newStringList ( TStringCollection * aStrings )
 

Sets the list of valid input strings for the string lookup validator. Disposes of any existing string list, then sets strings data member to `aStrings'.

Passing 0 in `aStrings' disposes of the existing list without assigning a new one.

void * TStringLookupValidator::read ( ipstream & is ) [protected, virtual]
 

Reads from the input stream `is'.

Reimplemented from TValidator.

void TStringLookupValidator::write ( opstream & os ) [protected, virtual]
 

Writes to the output stream `os'.

Reimplemented from TValidator.


Member Data Documentation

const char *const TStringLookupValidator::name [static]
 

Undocumented.

Reimplemented from TLookupValidator.

Definition at line 906 of file validate.h.

TStringCollection * TStringLookupValidator::strings [protected]
 

Points to a string collection containing all the valid strings the user can type. If strings data member is 0, all input will be invalid.

Definition at line 883 of file validate.h.


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