Audacity  3.0.3
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:
[legend]

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 52 of file Validators.h.

Member Typedef Documentation

◆ Holder

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

This MUST be overridden, to avoid slicing!

Definition at line 84 of file Validators.h.

Constructor & Destructor Documentation

◆ Validator()

Validator::Validator ( )
inline

Definition at line 58 of file Validators.h.

58 {};

◆ ~Validator()

virtual Validator::~Validator ( )
inlinevirtual

Definition at line 59 of file Validators.h.

59 {};

Member Function Documentation

◆ GetClone()

virtual Holder Validator::GetClone ( ) const
pure virtual

◆ GetConverted()

const wxVariant& Validator::GetConverted ( )
inline

Definition at line 64 of file Validators.h.

65  {
66  return mConverted;
67  }

References mConverted.

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

Here is the caller graph for this function:

◆ GetDescription()

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 78 of file Validators.h.

79  {
80  return wxT("any value");
81  }

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

Here is the caller graph for this function:

◆ SetConverted()

void Validator::SetConverted ( const wxVariant &  v)
inline

Definition at line 60 of file Validators.h.

61  {
62  mConverted = v;
63  }

References mConverted.

Referenced by Validate(), OptionValidator::Validate(), BoolValidator::Validate(), BoolArrayValidator::Validate(), DoubleValidator::Validate(), RangeValidator::Validate(), and IntValidator::Validate().

Here is the caller graph for this function:

◆ Validate()

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 70 of file Validators.h.

71  {
72  SetConverted(v);
73  return true;
74  }

References SetConverted().

Referenced by CommandImplementation::SetParameter().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mConverted

wxVariant Validator::mConverted
private

Definition at line 55 of file Validators.h.

Referenced by GetConverted(), and SetConverted().


The documentation for this class was generated from the following file:
Validator::mConverted
wxVariant mConverted
Definition: Validators.h:55
Validator::SetConverted
void SetConverted(const wxVariant &v)
Definition: Validators.h:60