[Classes] [Prev] [Next] [Methods]

CValidator

Methods Index

Heritage
Description
Usage
Protected Data Members
Public Methods
Constructor, Destructor, and Operator Methods
Validator Methods

CValidator


Heritage

Superclass: None

Subclass: None

Helper Class: CValidatorFactory


Description

CValidator is a proxy for the internal class CValidatorImplementation, which handles field formatting and validation. Generally, you should have CValidatorFactory construct a CValidator for you and then pass the object to the SetValidator() methods of views such as NEditControl and CNativeList that support validation.

CValidator, as a proxy, is small and you should pass it by value, as you would a float, for example. Unless you are writing your own validator factory, CValidatorImplementation should be invisible to your application. In addition, you should not need to call any of the methods on CValidator unless you are writing a new view that supports validation.


Usage

#include CGlobalClassLib_i
#include PowerFactoryDef_i
#include CValidatorFactory_i

...

itsNLineText->SetValidator(

VALIDATOR_FACTORY->ConstructValidator(
"{Sun,Mon,Tue,Wed,Thu,Fri,Sat}")

);

Protected Data Members

CValidatorImplementation* itsImplementation;


Public Methods

Constructor, Destructor, and Operator Methods

Only factories should call the constructors.

CValidator();
CValidator(
CValidatorImplementation* theImplementation);
CValidator(const CValidator& theValidator);
CValidator& operator=(
const CValidator& theValidator);
virtual ~CValidator();

Validator Methods

The following methods are passed through to implementation.

virtual BOOLEAN IsValid() const;
virtual BOOLEAN TestMatch(const CStringRW& theText);
virtual CStringRW FormatString(
const CStringRW& theText, int *theSelectionStart,
int *theSelectionEnd);
const CValidatorImplementation* Implementation() const;
CValidatorImplementation* Implementation();
void Implementation(
CValidatorImplementation* theImplementation);


[Classes] [Prev] [Next] [Methods]

support@xvt.com


Visit our online help desk for tech support

Copyright © 2009, Providence Software Solutions Inc. All rights reserved.