-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwxEcCppData.h
169 lines (166 loc) · 11.4 KB
/
wxEcCppData.h
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/*-----------------------------------------------------------------
* Name: wxEcCppData.h
* Purpose:
* Author: A. Wiegert
*
* Copyright:
* Licence: wxWidgets licence
*-------------------------------------------------------------- */
#ifndef _WX_EC_CPP_DATA_H
#define _WX_EC_CPP_DATA_H
// ------------------------------------------------------------------
#define BASIC 1
#define WXWIDGETS 2
// ------------------------------------------------------------------
struct ecCppData
{
wxString wsData;
int iFlags;
wxString wsFormat;
};
// ------------------------------------------------------------------
/**
* Format:
* data string flags format string
*/
ecCppData ecCpp1[] = {
{ _T("//======================================================================"),
BASIC | WXWIDGETS, _T("") },
{ _T("/**** Enum Class: %s ****/"), BASIC | WXWIDGETS, _T("s") },
{ _T("const int %s::m_iMapSize = %d;"), BASIC | WXWIDGETS, _T("sd") },
{ _T("%s::Map_t %s::m_Map[%s::m_iMapSize];"), BASIC | WXWIDGETS, _T("sss") },
{ _T("//----------------------------------------------------------------------"),
BASIC | WXWIDGETS, _T("") },
// ctor
{ _T("%s::%s()"), BASIC | WXWIDGETS, _T("ss") },
{ _T("{"), BASIC | WXWIDGETS, _T("") },
{ _T("\tm_Enum = %s;"), BASIC | WXWIDGETS, _T("u") },
};
/* // sample data
{Unknown, "Unknown"},
{Solid, "Solid Matter"},
{Liquid, "Liquid Matter "},
{Gas, "Vapour"}
*/
ecCppData ecCpp2[] = {
{ _T("}"), BASIC | WXWIDGETS, _T("") },
{ _T("//----------------------------------------------------------------------"),
BASIC | WXWIDGETS, _T("") },
// dtor
{ _T("%s::~%s()"), BASIC | WXWIDGETS, _T("ss") },
{ _T("{"), BASIC | WXWIDGETS, _T("") },
{ _T("}"), BASIC | WXWIDGETS, _T("") },
{ _T("//----------------------------------------------------------------------"),
BASIC | WXWIDGETS, _T("") },
{ _T("%s::Enum %s::operator=(int i)"), BASIC | WXWIDGETS, _T("ss") },
{ _T("{"), BASIC | WXWIDGETS, _T("") },
{ _T("\tm_Enum = AsEnum(i);"), BASIC | WXWIDGETS, _T("") },
{ _T("\treturn m_Enum;"), BASIC | WXWIDGETS, _T("") },
{ _T("}"), BASIC | WXWIDGETS, _T("") },
{ _T("//----------------------------------------------------------------------"),
BASIC | WXWIDGETS, _T("") },
{ _T("%s::operator int () const"), BASIC | WXWIDGETS, _T("s") },
{ _T("{"), BASIC | WXWIDGETS, _T("") },
{ _T("\treturn m_Enum;"), BASIC | WXWIDGETS, _T("") },
{ _T("}"), BASIC | WXWIDGETS, _T("") },
{ _T("//----------------------------------------------------------------------"),
BASIC | WXWIDGETS, _T("") },
{ _T("%s::Enum %s::operator=(const char* sz)"), BASIC | WXWIDGETS, _T("ss") },
{ _T("{"), BASIC | WXWIDGETS, _T("") },
{ _T("\tm_Enum = AsEnum(sz);"), BASIC | WXWIDGETS, _T("") },
{ _T("\treturn m_Enum;"), BASIC | WXWIDGETS, _T("") },
{ _T("}"), BASIC | WXWIDGETS, _T("") },
{ _T("//----------------------------------------------------------------------"),
BASIC | WXWIDGETS, _T("") },
{ _T("bool %s::operator==(const char* sz)"), BASIC | WXWIDGETS, _T("s") },
{ _T("{"), BASIC | WXWIDGETS, _T("") },
{ _T("\treturn m_Enum == AsEnum(sz);"), BASIC | WXWIDGETS, _T("") },
{ _T("}"), BASIC | WXWIDGETS, _T("") },
{ _T("//----------------------------------------------------------------------"),
BASIC | WXWIDGETS, _T("") },
{ _T("%s::operator const char* () const"), BASIC | WXWIDGETS, _T("s") },
{ _T("{"), BASIC | WXWIDGETS, _T("") },
{ _T("\treturn AsName(m_Enum);"), BASIC | WXWIDGETS, _T("") },
{ _T("}"), BASIC | WXWIDGETS, _T("") },
{ _T("//----------------------------------------------------------------------"),
BASIC | WXWIDGETS, _T("") },
{ _T("%s::Enum %s::AsEnum(const char* sz)"), BASIC | WXWIDGETS, _T("ss") },
{ _T("{"), BASIC | WXWIDGETS, _T("") },
{ _T("\tfor(int i=0;i<m_iMapSize;i++)"), BASIC | WXWIDGETS, _T("") },
{ _T("\t{"), BASIC | WXWIDGETS, _T("") },
{ _T("\t\tif(strcmp(sz, m_Map[i].szDescription)==0)"),BASIC | WXWIDGETS, _T("") },
{ _T("\t\t{"), BASIC | WXWIDGETS, _T("") },
{ _T("\t\t\treturn (Enum)m_Map[i].iValue;"), BASIC | WXWIDGETS, _T("") },
{ _T("\t\t}"), BASIC | WXWIDGETS, _T("") },
{ _T("\t}"), BASIC | WXWIDGETS, _T("") },
{ _T("\treturn (Enum)m_Map[0].iValue;"), BASIC | WXWIDGETS, _T("") },
{ _T("}"), BASIC | WXWIDGETS, _T("") },
{ _T("//----------------------------------------------------------------------"),
BASIC | WXWIDGETS, _T("") },
{ _T("%s::Enum %s::AsEnum(int e)"), BASIC | WXWIDGETS, _T("ss") },
{ _T("{"), BASIC | WXWIDGETS, _T("") },
{ _T("\tfor(int i=0;i<m_iMapSize;i++)"), BASIC | WXWIDGETS, _T("") },
{ _T("\t{"), BASIC | WXWIDGETS, _T("") },
{ _T("\t\tif(m_Map[i].iValue == e)"), BASIC | WXWIDGETS, _T("") },
{ _T("\t\t{"), BASIC | WXWIDGETS, _T("") },
{ _T("\t\t\treturn (Enum)m_Map[i].iValue;"), BASIC | WXWIDGETS, _T("") },
{ _T("\t\t}"), BASIC | WXWIDGETS, _T("") },
{ _T("\t}"), BASIC | WXWIDGETS, _T("") },
{ _T("\treturn (Enum)m_Map[0].iValue;"), BASIC | WXWIDGETS, _T("") },
{ _T("}"), BASIC | WXWIDGETS, _T("") },
{ _T("//----------------------------------------------------------------------"),
BASIC | WXWIDGETS, _T("") },
{ _T("const char* %s::AsName(int e)"), BASIC | WXWIDGETS, _T("s") },
{ _T("{"), BASIC | WXWIDGETS, _T("") },
{ _T("\tfor(int i=0;i<m_iMapSize;i++)"), BASIC | WXWIDGETS, _T("") },
{ _T("\t{"), BASIC | WXWIDGETS, _T("") },
{ _T("\t\tif(m_Map[i].iValue == e)"), BASIC | WXWIDGETS, _T("") },
{ _T("\t\t{"), BASIC | WXWIDGETS, _T("") },
{ _T("\t\t\treturn m_Map[i].szDescription;"), BASIC | WXWIDGETS, _T("") },
{ _T("\t\t}"), BASIC | WXWIDGETS, _T("") },
{ _T("\t}"), BASIC | WXWIDGETS, _T("") },
{ _T("\treturn m_Map[0].szDescription;"), BASIC | WXWIDGETS, _T("") },
{ _T("}"), BASIC | WXWIDGETS, _T("") },
{ _T("//----------------------------------------------------------------------"),
BASIC | WXWIDGETS, _T("") },
{ _T("bool %s::GetMap(int iIndex, int& iValue, const char*& szDescription)"),
BASIC | WXWIDGETS, _T("s") },
{ _T("{"), BASIC | WXWIDGETS, _T("") },
{ _T("\tif(iIndex>=m_iMapSize)"), BASIC | WXWIDGETS, _T("") },
{ _T("\t{"), BASIC | WXWIDGETS, _T("") },
{ _T("\t\treturn false;"), BASIC | WXWIDGETS, _T("") },
{ _T("\t}"), BASIC | WXWIDGETS, _T("") },
{ _T("\tiValue = m_Map[iIndex].iValue;"), BASIC | WXWIDGETS, _T("") },
{ _T("\tszDescription = m_Map[iIndex].szDescription;"),BASIC | WXWIDGETS, _T("") },
{ _T("\treturn true;"), BASIC | WXWIDGETS, _T("") },
{ _T("}"), BASIC | WXWIDGETS, _T("") },
{ _T("//----------------------------------------------------------------------"),
WXWIDGETS, _T("") },
{ _T("bool %s::GetMap(int iIndex, int& iValue, wxString& wsDescription)"),
WXWIDGETS, _T("s") },
{ _T("{"), WXWIDGETS, _T("") },
{ _T("\tif(iIndex>=m_iMapSize)"), WXWIDGETS, _T("") },
{ _T("\t{"), WXWIDGETS, _T("") },
{ _T("\t\treturn false;"), WXWIDGETS, _T("") },
{ _T("\t}"), WXWIDGETS, _T("") },
{ _T("\tiValue = m_Map[iIndex].iValue;"), WXWIDGETS, _T("") },
{ _T("\twsDescription = m_Map[iIndex].wsDescription;"), WXWIDGETS, _T("") },
{ _T("\treturn true;"), WXWIDGETS, _T("") },
{ _T("}"), WXWIDGETS, _T("") },
{ _T("//----------------------------------------------------------------------"),
WXWIDGETS, _T("") },
{ _T("const wxString& %s::AsWxName(int e)"), WXWIDGETS, _T("s") },
{ _T("{\r\n"), WXWIDGETS, _T("") },
{ _T("\tfor(int i=0;i<m_iMapSize;i++)"), WXWIDGETS, _T("") },
{ _T("\t{"), WXWIDGETS, _T("") },
{ _T("\t\tif(m_Map[i].iValue == e)"), WXWIDGETS, _T("") },
{ _T("\t\t{"), WXWIDGETS, _T("") },
{ _T("\t\t\treturn m_Map[i].wsDescription;"), WXWIDGETS, _T("") },
{ _T("\t\t}"), WXWIDGETS, _T("") },
{ _T("\t}"), WXWIDGETS, _T("") },
{ _T("\treturn m_Map[0].wsDescription;"), WXWIDGETS, _T("") },
{ _T("}"), WXWIDGETS, _T("") },
{ _T(""), WXWIDGETS, _T("") },
};
#endif // _WX_EC_CPP_DATA_H
// ------------------------------- eof ---------------------------