Audacity  2.2.2
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:
Validator

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 ()
 

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

Member Function Documentation

Holder DoubleValidator::GetClone ( ) const
inlineoverridevirtual

Implements Validator.

Definition at line 191 of file Validators.h.

192  {
193  return std::make_unique<DoubleValidator>();
194  }
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 187 of file Validators.h.

188  {
189  return wxT("a floating-point number");
190  }
bool DoubleValidator::Validate ( const wxVariant &  v)
inlineoverridevirtual

Judge whether the passed value satisfies the Validator.

Reimplemented from Validator.

Definition at line 180 of file Validators.h.

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

181  {
182  double val;
183  if (!v.Convert(&val)) return false;
184  SetConverted(val);
185  return GetConverted().IsType(wxT("double"));
186  }
const wxVariant & GetConverted()
Definition: Validators.h:60
void SetConverted(const wxVariant &v)
Definition: Validators.h:56

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