-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwxBupBagSizes.cpp
132 lines (129 loc) · 4.33 KB
/
wxBupBagSizes.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// Auto-generated by wxEC 0.1.33 - 05/12/18 13:09:48
// Do not edit this file - it will be overwritten on next pass
// Make any necessary changes to the source file:
// D:\pkg\wx\MSVC2015\_3.1-2015\GitHubProjects\wxBup-Test\wxBupBagSizes.e
#include "wxBupBagSizes.h"
#include <string.h>
//======================================================================
/**** Enum Class: EBupBagSizeTypes ****/
const int EBupBagSizeTypes::m_iMapSize = 12;
EBupBagSizeTypes::Map_t EBupBagSizeTypes::m_Map[EBupBagSizeTypes::m_iMapSize];
//----------------------------------------------------------------------
EBupBagSizeTypes::EBupBagSizeTypes()
{
m_Enum = eBagSize_Unknown;
EBupBagSizeTypes::m_Map[0] = Map_t( eBagSize_Unknown, "unknown", _T("unknown") );
EBupBagSizeTypes::m_Map[1] = Map_t( eBagSize_NoSplit, "Single Volume, no split", _T("Single Volume, no split") );
EBupBagSizeTypes::m_Map[2] = Map_t( eBagSize_Custom, "Custom size", _T("Custom size") );
EBupBagSizeTypes::m_Map[3] = Map_t( eBagSize_144MB, "1.44 MB Floppy", _T("1.44 MB Floppy") );
EBupBagSizeTypes::m_Map[4] = Map_t( eBagSize_5MB, "5 MB Attachment", _T("5 MB Attachment") );
EBupBagSizeTypes::m_Map[5] = Map_t( eBagSize_10MB, "10 MB Attachment", _T("10 MB Attachment") );
EBupBagSizeTypes::m_Map[6] = Map_t( eBagSize_650MB, "650 MB CD", _T("650 MB CD") );
EBupBagSizeTypes::m_Map[7] = Map_t( eBagSize_700MB, "700 MB CD", _T("700 MB CD") );
EBupBagSizeTypes::m_Map[8] = Map_t( eBagSize_3_7GB, "3.7 GB DVD", _T("3.7 GB DVD") );
EBupBagSizeTypes::m_Map[9] = Map_t( eBagSize_4_7GB, "4.7 GB DVD", _T("4.7 GB DVD") );
EBupBagSizeTypes::m_Map[10] = Map_t( eBagSize_8_5GB, "8.5 GB DVD-DL", _T("8.5 GB DVD-DL") );
EBupBagSizeTypes::m_Map[11] = Map_t( eBagSize_25GB, "25 GB Blueray", _T("25 GB Blueray") );
}
//----------------------------------------------------------------------
EBupBagSizeTypes::~EBupBagSizeTypes()
{
}
//----------------------------------------------------------------------
EBupBagSizeTypes::Enum EBupBagSizeTypes::operator=(int i)
{
m_Enum = AsEnum(i);
return m_Enum;
}
//----------------------------------------------------------------------
EBupBagSizeTypes::operator int () const
{
return m_Enum;
}
//----------------------------------------------------------------------
EBupBagSizeTypes::Enum EBupBagSizeTypes::operator=(const char* sz)
{
m_Enum = AsEnum(sz);
return m_Enum;
}
//----------------------------------------------------------------------
bool EBupBagSizeTypes::operator==(const char* sz)
{
return m_Enum == AsEnum(sz);
}
//----------------------------------------------------------------------
EBupBagSizeTypes::operator const char* () const
{
return AsName(m_Enum);
}
//----------------------------------------------------------------------
EBupBagSizeTypes::Enum EBupBagSizeTypes::AsEnum(const char* sz)
{
for(int i=0;i<m_iMapSize;i++)
{
if(strcmp(sz, m_Map[i].szDescription)==0)
{
return (Enum)m_Map[i].iValue;
}
}
return (Enum)m_Map[0].iValue;
}
//----------------------------------------------------------------------
EBupBagSizeTypes::Enum EBupBagSizeTypes::AsEnum(int e)
{
for(int i=0;i<m_iMapSize;i++)
{
if(m_Map[i].iValue == e)
{
return (Enum)m_Map[i].iValue;
}
}
return (Enum)m_Map[0].iValue;
}
//----------------------------------------------------------------------
const char* EBupBagSizeTypes::AsName(int e)
{
for(int i=0;i<m_iMapSize;i++)
{
if(m_Map[i].iValue == e)
{
return m_Map[i].szDescription;
}
}
return m_Map[0].szDescription;
}
//----------------------------------------------------------------------
bool EBupBagSizeTypes::GetMap(int iIndex, int& iValue, const char*& szDescription)
{
if(iIndex>=m_iMapSize)
{
return false;
}
iValue = m_Map[iIndex].iValue;
szDescription = m_Map[iIndex].szDescription;
return true;
}
//----------------------------------------------------------------------
bool EBupBagSizeTypes::GetMap(int iIndex, int& iValue, wxString& wsDescription)
{
if(iIndex>=m_iMapSize)
{
return false;
}
iValue = m_Map[iIndex].iValue;
wsDescription = m_Map[iIndex].wsDescription;
return true;
}
//----------------------------------------------------------------------
const wxString& EBupBagSizeTypes::AsWxName(int e)
{
for(int i=0;i<m_iMapSize;i++)
{
if(m_Map[i].iValue == e)
{
return m_Map[i].wsDescription;
}
}
return m_Map[0].wsDescription;
}
// ------------------------------- eof ------------------------------