Audacity 3.2.0
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 53 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 85 of file Validators.h.

Constructor & Destructor Documentation

◆ Validator()

Validator::Validator ( )
inline

Definition at line 59 of file Validators.h.

59{};

◆ ~Validator()

virtual Validator::~Validator ( )
inlinevirtual

Definition at line 60 of file Validators.h.

60{};

Member Function Documentation

◆ GetClone()

virtual Holder Validator::GetClone ( ) const
pure virtual

◆ GetConverted()

const wxVariant & Validator::GetConverted ( )
inline

Definition at line 65 of file Validators.h.

66 {
67 return mConverted;
68 }
wxVariant mConverted
Definition: Validators.h:56

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 OptionValidator, BoolValidator, BoolArrayValidator, DoubleValidator, RangeValidator, and IntValidator.

Definition at line 79 of file Validators.h.

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

References wxT().

Referenced by CommandImplementation::SetParameter().

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

◆ SetConverted()

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

Definition at line 61 of file Validators.h.

62 {
63 mConverted = v;
64 }

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 OptionValidator, BoolValidator, BoolArrayValidator, DoubleValidator, RangeValidator, and IntValidator.

Definition at line 71 of file Validators.h.

72 {
73 SetConverted(v);
74 return true;
75 }
void SetConverted(const wxVariant &v)
Definition: Validators.h:61

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

Referenced by GetConverted(), and SetConverted().


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