Audacity  2.2.2
Public Types | Public Member Functions | Private Attributes | List of all members
Validator Class Referenceabstract

A Validator is an object which checks whether a wxVariant satisfies a certain criterion. This is a base validator which allows anything. More...

#include <Validators.h>

Inheritance diagram for Validator:
BoolArrayValidator BoolValidator DefaultValidator DoubleValidator IntValidator OptionValidator RangeValidator

Public Types

using Holder = std::unique_ptr< Validator >
 This MUST be overridden, to avoid slicing! More...
 

Public Member Functions

 Validator ()
 
virtual ~Validator ()
 
void SetConverted (const wxVariant &v)
 
const wxVariant & GetConverted ()
 
virtual bool Validate (const wxVariant &v)
 Judge whether the passed value satisfies the Validator. More...
 
virtual wxString GetDescription () const
 
virtual Holder GetClone () const =0
 

Private Attributes

wxVariant mConverted
 

Detailed Description

A Validator is an object which checks whether a wxVariant satisfies a certain criterion. This is a base validator which allows anything.

Definition at line 48 of file Validators.h.

Member Typedef Documentation

using Validator::Holder = std::unique_ptr<Validator>

This MUST be overridden, to avoid slicing!

Definition at line 80 of file Validators.h.

Constructor & Destructor Documentation

Validator::Validator ( )
inline

Definition at line 54 of file Validators.h.

54 {};
virtual Validator::~Validator ( )
inlinevirtual

Definition at line 55 of file Validators.h.

55 {};

Member Function Documentation

virtual Holder Validator::GetClone ( ) const
pure virtual
const wxVariant& Validator::GetConverted ( )
inline

Definition at line 60 of file Validators.h.

References mConverted.

Referenced by CommandImplementation::SetParameter(), BoolValidator::Validate(), DoubleValidator::Validate(), and IntValidator::Validate().

61  {
62  return mConverted;
63  }
wxVariant mConverted
Definition: Validators.h:51
virtual wxString Validator::GetDescription ( ) const
inlinevirtual

Return a description (for error messages) should be of the form 'v must be $description'

Reimplemented in IntValidator, RangeValidator, DoubleValidator, BoolArrayValidator, BoolValidator, and OptionValidator.

Definition at line 74 of file Validators.h.

Referenced by CommandType::Describe(), and CommandImplementation::SetParameter().

75  {
76  return wxT("any value");
77  }
void Validator::SetConverted ( const wxVariant &  v)
inline
virtual bool Validator::Validate ( const wxVariant &  v)
inlinevirtual

Judge whether the passed value satisfies the Validator.

Reimplemented in IntValidator, RangeValidator, DoubleValidator, BoolArrayValidator, BoolValidator, and OptionValidator.

Definition at line 66 of file Validators.h.

References SetConverted().

Referenced by CommandImplementation::SetParameter().

67  {
68  SetConverted(v);
69  return true;
70  }
void SetConverted(const wxVariant &v)
Definition: Validators.h:56

Member Data Documentation

wxVariant Validator::mConverted
private

Definition at line 51 of file Validators.h.

Referenced by GetConverted(), and SetConverted().


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