cbp2make
Makefile generation tool for Code::Blocks IDE
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
lib
stlconfig.h
Go to the documentation of this file.
1
/*
2
cbp2make : Makefile generation tool for the Code::Blocks IDE
3
Copyright (C) 2010-2013 Mirai Computing (mirai.computing@gmail.com)
4
5
This program is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
9
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
14
15
You should have received a copy of the GNU General Public License
16
along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
//------------------------------------------------------------------------------
20
#ifndef STL_CONFIG_H
21
#define STL_CONFIG_H
22
//------------------------------------------------------------------------------
23
#include "
stlvariables.h
"
24
//------------------------------------------------------------------------------
25
26
class
CConfiguration
27
{
28
protected
:
29
CVariable
m_NullVariable
;
30
std::vector<CVariable *>
m_Variables
;
31
CString
m_DefinedPrefix
;
32
protected
:
33
bool
ValidIndex
(
const
int
Index)
const
;
34
public
:
35
virtual
void
Initialize
(
void
) {};
36
virtual
void
Clear
(
void
);
37
int
GetCount
(
void
)
const
;
38
CString
&
DefinedPrefix
(
void
) {
return
m_DefinedPrefix
; }
39
CString
DefinedPrefix
(
void
)
const
{
return
m_DefinedPrefix
; }
40
bool
VarDefined
(
const
CString
& Name)
const
;
41
void
SetDefined
(
const
CString
& Name);
42
void
SetUndefined
(
const
CString
& Name);
43
CVariable
&
Variable
(
const
int
Index);
44
CVariable
&
VarNamed
(
const
CString
& Name);
45
int
VarIndex
(
const
CString
& Name)
const
;
46
int
InsertIntegerVariable
(
const
CString
& Name,
const
int
Value=0);
47
int
InsertFloatVariable
(
const
CString
& Name,
const
double
Value=0.0);
48
int
InsertBooleanVariable
(
const
CString
& Name,
const
bool
Value=
false
);
49
int
InsertStringVariable
(
const
CString
& Name,
const
CString
& Value=
""
);
50
int
InsertCharVariable
(
const
CString
& Name,
const
char
Value=
char
(0));
51
void
RemoveVariable
(
const
int
Index);
52
void
RemoveVariable
(
const
CString
& Name);
53
void
SetIntegerVariable
(
const
CString
& Name,
const
int
Value);
54
void
SetFloatVariable
(
const
CString
& Name,
const
double
Value);
55
void
SetBooleanVariable
(
const
CString
& Name,
const
bool
Value);
56
void
SetStringVariable
(
const
CString
& Name,
const
CString
& Value);
57
void
SetCharVariable
(
const
CString
& Name,
const
char
Value);
58
void
Print
(std::ostream& out);
59
void
ProcessParameters
(
int
argc,
char
* argv[]);
60
void
LoadFromFile
(
const
CString
& FileName);
61
void
SaveToFile
(
const
CString
& FileName);
62
public
:
63
CConfiguration
(
void
);
64
virtual
~CConfiguration
(
void
);
65
};
66
67
class
CParameterString
68
{
69
protected
:
70
CString
m_NullParameter
;
71
CStringList
m_Parameters
;
72
public
:
73
void
SetParameters
(
int
argc,
char
* argv[]);
74
void
SetParameters
(
const
CString
& Parameters);
75
void
SetParameters
(
const
CParameterString
& Parameters);
76
void
AddParameters
(
const
CString
& Parameters);
77
void
AddParameters
(
const
CParameterString
& Parameters);
78
int
GetCount
(
void
)
const
{
return
m_Parameters
.
GetCount
(); }
79
CString
Parameter
(
const
int
Index)
const
;
80
virtual
void
Print
(std::ostream& out) {};
81
public
:
82
CParameterString
(
int
argc,
char
* argv[]);
83
CParameterString
(
const
CString
& Parameters);
84
CParameterString
(
void
);
85
virtual
~CParameterString
(
void
);
86
};
87
88
class
CParameterStringConfiguration
:
public
CConfiguration
89
{
90
protected
:
91
CString
m_DefinedPrefix
;
92
public
:
93
CString
&
DefinedPrefix
(
void
) {
return
m_DefinedPrefix
; }
94
bool
VarDefined
(
const
CString
& Name);
95
void
SetDefined
(
const
CString
& Name);
96
void
SetUndefined
(
const
CString
& Name);
97
void
ProcessParameters
(
const
CParameterString
& Parameters);
98
void
ProcessParameters
(
const
CString
& Parameters);
99
public
:
100
CParameterStringConfiguration
(
void
) {
m_DefinedPrefix
=
'~'
; };
101
virtual
~CParameterStringConfiguration
(
void
) {};
102
};
103
104
#endif
105
//------------------------------------------------------------------------------
Generated on Sun Jun 9 2013 10:55:50 for cbp2make by
1.8.4