Audacity 3.2.0
Public Member Functions | List of all members
DoubleValidator Class Referencefinal

Parameter must be a floating-point number. More...

#include <Validators.h>

Inheritance diagram for DoubleValidator:
[legend]
Collaboration diagram for DoubleValidator:
[legend]

Public Member Functions

bool Validate (const wxVariant &v) override
 Judge whether the passed value satisfies the Validator. More...
 
wxString GetDescription () const override
 
Holder GetClone () const override
 
- Public Member Functions inherited from Validator
 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
 

Additional Inherited Members

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

Detailed Description

Parameter must be a floating-point number.

Definition at line 182 of file Validators.h.

Member Function Documentation

◆ GetClone()

Holder DoubleValidator::GetClone ( ) const
inlineoverridevirtual

Implements Validator.

Definition at line 196 of file Validators.h.

197 {
198 return std::make_unique<DoubleValidator>();
199 }

◆ GetDescription()

wxString DoubleValidator::GetDescription ( ) const
inlineoverridevirtual

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

Reimplemented from Validator.

Definition at line 192 of file Validators.h.

193 {
194 return wxT("a floating-point number");
195 }
wxT("CloseDown"))

References wxT().

Here is the call graph for this function:

◆ Validate()

bool DoubleValidator::Validate ( const wxVariant &  v)
inlineoverridevirtual

Judge whether the passed value satisfies the Validator.

Reimplemented from Validator.

Definition at line 185 of file Validators.h.

186 {
187 double val;
188 if (!v.Convert(&val)) return false;
189 SetConverted(val);
190 return GetConverted().IsType(wxT("double"));
191 }
const wxVariant & GetConverted()
Definition: Validators.h:65
void SetConverted(const wxVariant &v)
Definition: Validators.h:61

References Validator::GetConverted(), Validator::SetConverted(), and wxT().

Here is the call graph for this function:

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