Audacity 3.2.0
WrappedType.h
Go to the documentation of this file.
1/**********************************************************************
2
3 WrappedType.h
4
5 James Crook
6 (C) Audacity Developers, 2007
7
8 wxWidgets license. See Licensing.txt
9
10*************************************************************************/
11
12#ifndef __WRAPPED_TYPE__
13#define __WRAPPED_TYPE__
14
16{
23};
24
25class wxString;
26
27class COMMAND_PARAMETERS_API WrappedType
28{
29public:
30
31 explicit WrappedType( wxString & InStr )
32 : eWrappedType{ eWrappedString }, mpStr{ &InStr }
33 {}
34 explicit WrappedType( int & InInt )
35 : eWrappedType{ eWrappedInt }, mpInt{ &InInt }
36 {}
37 explicit WrappedType( double & InDouble )
38 : eWrappedType{ eWrappedDouble }, mpDouble{ &InDouble }
39 {}
40 explicit WrappedType( bool & InBool )
41 : eWrappedType{ eWrappedBool }, mpBool{ &InBool }
42 {}
43 explicit WrappedType()
44 : eWrappedType{ eWrappedNotSet }
45 {}
46
47 bool IsString();
48
49 wxString ReadAsString();
50 int ReadAsInt();
51 double ReadAsDouble();
52 bool ReadAsBool();
53
54 void WriteToAsString( const wxString & InStr);
55 void WriteToAsInt( const int InInt);
56 void WriteToAsDouble( const double InDouble);
57 void WriteToAsBool( const bool InBool);
58
59public :
60
62 wxString *const mpStr {};
63 int *const mpInt {};
64 double *const mpDouble {};
65 bool *const mpBool {};
66
67};
68
69#endif
teWrappedType
Definition: WrappedType.h:16
@ eWrappedNotSet
Definition: WrappedType.h:17
@ eWrappedDouble
Definition: WrappedType.h:20
@ eWrappedEnum
Definition: WrappedType.h:22
@ eWrappedInt
Definition: WrappedType.h:19
@ eWrappedBool
Definition: WrappedType.h:21
@ eWrappedString
Definition: WrappedType.h:18
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition: WrappedType.h:28
WrappedType(wxString &InStr)
Definition: WrappedType.h:31
WrappedType(int &InInt)
Definition: WrappedType.h:34
WrappedType(bool &InBool)
Definition: WrappedType.h:40
const teWrappedType eWrappedType
Definition: WrappedType.h:61
WrappedType(double &InDouble)
Definition: WrappedType.h:37