![]() |
Audacity 3.2.0
|
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions between all the types. Functions that work on wrapped types can quickly be reused to work on any of these types. This cuts out a lot of repetitive code. More...
#include <WrappedType.h>
Public Member Functions | |
WrappedType (wxString &InStr) | |
WrappedType (int &InInt) | |
WrappedType (double &InDouble) | |
WrappedType (bool &InBool) | |
WrappedType () | |
bool | IsString () |
wxString | ReadAsString () |
int | ReadAsInt () |
double | ReadAsDouble () |
bool | ReadAsBool () |
void | WriteToAsString (const wxString &InStr) |
void | WriteToAsInt (const int InInt) |
void | WriteToAsDouble (const double InDouble) |
void | WriteToAsBool (const bool InBool) |
Public Attributes | |
const teWrappedType | eWrappedType |
wxString *const | mpStr {} |
int *const | mpInt {} |
double *const | mpDouble {} |
bool *const | mpBool {} |
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions between all the types. Functions that work on wrapped types can quickly be reused to work on any of these types. This cuts out a lot of repetitive code.
JKC: This class grows in size with the square of the number of types it supports. It has to do all conversions between all pairs, so try to re-use existing types if you can.
It's probable that not all the cases are actually used in practice. The most heavily used will be conversions to <-> from string.
Definition at line 30 of file WrappedType.h.
|
inlineexplicit |
Definition at line 34 of file WrappedType.h.
|
inlineexplicit |
Definition at line 37 of file WrappedType.h.
|
inlineexplicit |
Definition at line 40 of file WrappedType.h.
|
inlineexplicit |
Definition at line 43 of file WrappedType.h.
|
inlineexplicit |
Definition at line 46 of file WrappedType.h.
bool WrappedType::IsString | ( | ) |
Definition at line 35 of file WrappedType.cpp.
References eWrappedString, and eWrappedType.
Referenced by ShuttleGuiBase::TieRadioButton().
bool WrappedType::ReadAsBool | ( | ) |
Definition at line 120 of file WrappedType.cpp.
References eWrappedBool, eWrappedDouble, eWrappedEnum, eWrappedInt, eWrappedString, eWrappedType, mpBool, mpDouble, mpInt, mpStr, and wxT().
Referenced by ShuttleGuiBase::DoTieCheckBox(), and ShuttleGuiBase::DoTieCheckBoxOnRight().
double WrappedType::ReadAsDouble | ( | ) |
Definition at line 94 of file WrappedType.cpp.
References Internat::CompatibleToDouble(), eWrappedBool, eWrappedDouble, eWrappedEnum, eWrappedInt, eWrappedString, eWrappedType, mpBool, mpDouble, mpInt, and mpStr.
int WrappedType::ReadAsInt | ( | ) |
Definition at line 68 of file WrappedType.cpp.
References eWrappedBool, eWrappedDouble, eWrappedEnum, eWrappedInt, eWrappedString, eWrappedType, mpBool, mpDouble, mpInt, and mpStr.
Referenced by ShuttleGuiBase::DoTieSlider(), and ShuttleGuiBase::DoTieSpinCtrl().
wxString WrappedType::ReadAsString | ( | ) |
Definition at line 42 of file WrappedType.cpp.
References eWrappedBool, eWrappedDouble, eWrappedEnum, eWrappedInt, eWrappedString, eWrappedType, mpBool, mpDouble, mpInt, mpStr, and wxT().
Referenced by ShuttleGuiBase::DoTieCheckBox(), ShuttleGuiBase::DoTieCheckBoxOnRight(), ShuttleGuiBase::DoTieNumericTextBox(), ShuttleGuiBase::DoTieTextBox(), ShuttleGuiBase::TieCheckBoxOnRight(), and ShuttleGuiBase::TieRadioButton().
void WrappedType::WriteToAsBool | ( | const bool | InBool | ) |
Definition at line 229 of file WrappedType.cpp.
References eWrappedBool, eWrappedDouble, eWrappedEnum, eWrappedInt, eWrappedString, eWrappedType, mpBool, mpDouble, mpInt, mpStr, and wxT().
Referenced by ShuttleGuiBase::DoTieCheckBox(), and ShuttleGuiBase::DoTieCheckBoxOnRight().
void WrappedType::WriteToAsDouble | ( | const double | InDouble | ) |
Definition at line 202 of file WrappedType.cpp.
References eWrappedBool, eWrappedDouble, eWrappedEnum, eWrappedInt, eWrappedString, eWrappedType, mpBool, mpDouble, mpInt, mpStr, and wxT().
void WrappedType::WriteToAsInt | ( | const int | InInt | ) |
Definition at line 177 of file WrappedType.cpp.
References eWrappedBool, eWrappedDouble, eWrappedEnum, eWrappedInt, eWrappedString, eWrappedType, mpBool, mpDouble, mpInt, mpStr, and wxT().
Referenced by ShuttleGuiBase::DoTieSlider(), and ShuttleGuiBase::DoTieSpinCtrl().
void WrappedType::WriteToAsString | ( | const wxString & | InStr | ) |
Definition at line 148 of file WrappedType.cpp.
References Internat::CompatibleToDouble(), eWrappedBool, eWrappedDouble, eWrappedEnum, eWrappedInt, eWrappedString, eWrappedType, mpBool, mpDouble, mpInt, mpStr, and wxT().
Referenced by ShuttleGuiBase::DoTieNumericTextBox(), and ShuttleGuiBase::DoTieTextBox().
const teWrappedType WrappedType::eWrappedType |
Definition at line 64 of file WrappedType.h.
Referenced by IsString(), ReadAsBool(), ReadAsDouble(), ReadAsInt(), ReadAsString(), WriteToAsBool(), WriteToAsDouble(), WriteToAsInt(), and WriteToAsString().
bool* const WrappedType::mpBool {} |
Definition at line 68 of file WrappedType.h.
Referenced by ReadAsBool(), ReadAsDouble(), ReadAsInt(), ReadAsString(), WriteToAsBool(), WriteToAsDouble(), WriteToAsInt(), and WriteToAsString().
double* const WrappedType::mpDouble {} |
Definition at line 67 of file WrappedType.h.
Referenced by ReadAsBool(), ReadAsDouble(), ReadAsInt(), ReadAsString(), WriteToAsBool(), WriteToAsDouble(), WriteToAsInt(), and WriteToAsString().
int* const WrappedType::mpInt {} |
Definition at line 66 of file WrappedType.h.
Referenced by ReadAsBool(), ReadAsDouble(), ReadAsInt(), ReadAsString(), WriteToAsBool(), WriteToAsDouble(), WriteToAsInt(), and WriteToAsString().
wxString* const WrappedType::mpStr {} |
Definition at line 65 of file WrappedType.h.
Referenced by ReadAsBool(), ReadAsDouble(), ReadAsInt(), ReadAsString(), WriteToAsBool(), WriteToAsDouble(), WriteToAsInt(), and WriteToAsString().