cxWidgets 1.0
Public Member Functions | List of all members
cx::cxTextValidator Class Reference

Provides some text validation functionality. See README.txt for. More...

#include <cxTextValidator.h>

Collaboration diagram for cx::cxTextValidator:
Collaboration graph

Public Member Functions

 cxTextValidator (const std::string &pTextStr="", const std::string &pValidatorStr="")
 
virtual ~cxTextValidator ()
 
virtual void setTextStr (const std::string &pTextStr)
 
virtual const std::string & getTextStr () const
 
virtual void setValidatorStr (const std::string &pValidatorStr)
 
virtual const std::string & getValidatorStr () const
 
virtual bool textIsValid () const
 
virtual bool textIsValid (const std::string &pTextStr) const
 
virtual std::string addImpliedChars () const
 
virtual void addImpliedChars (std::string &pTextStr) const
 
virtual std::string cxTypeStr () const
 Returns the name of the cxWidgets class. This can be used to.
 

Detailed Description

Provides some text validation functionality. See README.txt for.

details of validation strings.

Constructor & Destructor Documentation

◆ cxTextValidator()

cx::cxTextValidator::cxTextValidator ( const std::string &  pTextStr = "",
const std::string &  pValidatorStr = "" 
)
explicit

Default constructor; takes a text string and a validator string

Parameters
pTextStrString to validate; blank by default
pValidatorStrString used to validate text; blank by default

◆ ~cxTextValidator()

cx::cxTextValidator::~cxTextValidator ( )
virtual

Destructor

Member Function Documentation

◆ addImpliedChars() [1/2]

string cx::cxTextValidator::addImpliedChars ( ) const
virtual

Adds any implied characters from the validator string to the text string, if it is valid. For example, with a string of "5031234567" and a validator string of "(DDD) DDD-DDDD", the string would become "(503) 123-4567".

Returns
The text string with any implied characters added.

References addImpliedChars().

Referenced by addImpliedChars(), cx::cxInput::getValue(), main(), and cx::cxInput::showModal().

◆ addImpliedChars() [2/2]

virtual void cx::cxTextValidator::addImpliedChars ( std::string &  pTextStr) const
virtual

Adds any implied characters from the validator string to a text string, if it is valid. For example, with a string of "5031234567" and a validator string of "(DDD) DDD-DDDD", the string would become "(503) 123-4567".

Parameters
pTextStrA string to add implied characters to (it will get the implied characters added to it)

◆ cxTypeStr()

string cx::cxTextValidator::cxTypeStr ( ) const
virtual

Returns the name of the cxWidgets class. This can be used to.

determine the type of cxWidgets object that deriving classes

derive from in applications.

Returns
The name of the cxWidgets class.

◆ getTextStr()

const string & cx::cxTextValidator::getTextStr ( ) const
virtual

Returns the text string

Returns
The text string

◆ getValidatorStr()

const string & cx::cxTextValidator::getValidatorStr ( ) const
virtual

Returns the validator string

Returns
Validator string

Referenced by cx::cxInput::getValidatorStr().

◆ setTextStr()

void cx::cxTextValidator::setTextStr ( const std::string &  pTextStr)
virtual

Sets the text string to be validated

Parameters
pTextStrText string to be validated

Referenced by main().

◆ setValidatorStr()

void cx::cxTextValidator::setValidatorStr ( const std::string &  pValidatorStr)
virtual

Sets the validator string

Parameters
pValidatorStrValidator string–see README.txt for details of validator strings

Referenced by main(), and cx::cxInput::setValidator().

◆ textIsValid() [1/2]

bool cx::cxTextValidator::textIsValid ( ) const
virtual

Returns whether the text string passes validation

Returns
True or false, depending on whether string passes validation

References textIsValid().

Referenced by main(), cx::cxInput::textIsValid(), and textIsValid().

◆ textIsValid() [2/2]

virtual bool cx::cxTextValidator::textIsValid ( const std::string &  pTextStr) const
virtual

Returns whether parameter string passes validation

Parameters
pTextStrString to validate
Returns
True or false, depending on whether string passes validation

The documentation for this class was generated from the following files: