Audacity
3.2.0
libraries
lib-command-parameters
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
15
enum
teWrappedType
16
{
17
eWrappedNotSet
,
18
eWrappedString
,
19
eWrappedInt
,
20
eWrappedDouble
,
21
eWrappedBool
,
22
eWrappedEnum
23
};
24
25
class
wxString;
26
27
class
COMMAND_PARAMETERS_API
WrappedType
28
{
29
public
:
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
59
public :
60
61
const
teWrappedType
eWrappedType
;
62
wxString *
const
mpStr {};
63
int
*
const
mpInt {};
64
double
*
const
mpDouble {};
65
bool
*
const
mpBool {};
66
67
};
68
69
#endif
teWrappedType
teWrappedType
Definition:
WrappedType.h:16
eWrappedNotSet
@ eWrappedNotSet
Definition:
WrappedType.h:17
eWrappedDouble
@ eWrappedDouble
Definition:
WrappedType.h:20
eWrappedEnum
@ eWrappedEnum
Definition:
WrappedType.h:22
eWrappedInt
@ eWrappedInt
Definition:
WrappedType.h:19
eWrappedBool
@ eWrappedBool
Definition:
WrappedType.h:21
eWrappedString
@ eWrappedString
Definition:
WrappedType.h:18
WrappedType
Used in type conversions, this wrapper for ints, strings, doubles and enums provides conversions betw...
Definition:
WrappedType.h:28
WrappedType::WrappedType
WrappedType(wxString &InStr)
Definition:
WrappedType.h:31
WrappedType::WrappedType
WrappedType()
Definition:
WrappedType.h:43
WrappedType::WrappedType
WrappedType(int &InInt)
Definition:
WrappedType.h:34
WrappedType::WrappedType
WrappedType(bool &InBool)
Definition:
WrappedType.h:40
WrappedType::eWrappedType
const teWrappedType eWrappedType
Definition:
WrappedType.h:61
WrappedType::WrappedType
WrappedType(double &InDouble)
Definition:
WrappedType.h:37
Generated by
1.9.3