cbp2make
Makefile generation tool for Code::Blocks IDE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cbglobalvar.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 CBGLOBALVAR_H
21 #define CBGLOBALVAR_H
22 //------------------------------------------------------------------------------
23 #include "stlstrings.h"
24 #include "stlconfig.h"
25 //------------------------------------------------------------------------------
26 
27 class TiXmlElement;
28 class CGlobalVariableSet;
29 
31 {
32  private:
35  // standard fields
42  // user fields
44  public:
45  CString& Name(void) { return m_Name; }
46  CString& Description(void) { return m_Description; }
47  CString Base(void);
48  CString Include(void);
49  CString Lib(void);
50  CString& Obj(void) { return m_Obj; }
51  CString& Cflags(void) { return m_Cflags; }
52  CString& Lflags(void) { return m_Lflags; }
53  public:
54  static CString Convert(const CString& Value, const int Case = 0);
55  int Count(void);
56  CString GetField(const int Index);
57  CString GetValue(const int Index);
58  void Clear(void);
59  void Add(const CString& Name, const CString& Value);
60  void Remove(const CString& Name);
61  void Read(const TiXmlElement *GlobalVariableRoot);
62  void Write(TiXmlElement *GlobalVariableRoot);
63  void Show(void);
64  public:
65  CGlobalVariable(void);
66  ~CGlobalVariable(void);
67 };
68 
70 {
71  private:
73  std::vector<CGlobalVariable *> m_Variables;
74  bool m_Active;
75  //bool m_HaveDefaults;
76  public:
77  CString& Name(void) { return m_Name; }
78  bool& Active(void) { return m_Active; }
79  public:
80  void Clear(void);
81  size_t Count(void) const { return m_Variables.size(); };
82  CGlobalVariable *Get(const size_t Index);
84  CGlobalVariable *Add(const CString& Name, const CString& Description = "");
85  void Remove(const CString& Name);
86  void Read(const TiXmlElement *GlobalVariableSetRoot);
87  void Write(TiXmlElement *GlobalVariableSetRoot);
88  void Show(void);
89  public:
90  CGlobalVariableSet(void);
91  ~CGlobalVariableSet(void);
92 };
93 
95 {
96  private:
97  std::vector<CGlobalVariableSet *> m_VariableSets;
98  public:
99  public:
100  void Clear(void);
101  size_t Count(void) const { return m_VariableSets.size(); };
102  CGlobalVariableSet *Get(const size_t Index);
103  CGlobalVariableSet *Find(const CString& Name);
104  CGlobalVariableSet *Add(const CString& Name);
105  void AddDefault(void);
106  void Remove(const CString& Name);
107  void Read(const TiXmlElement *GlobalVariableConfigRoot);
108  void Write(TiXmlElement *GlobalVariableConfigRoot);
109  void Show(void);
110  public:
111  CGlobalVariableConfig(void);
113 };
114 
115 #endif
116 //------------------------------------------------------------------------------