cbp2make
Makefile generation tool for Code::Blocks IDE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cbworkspace.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 CBWORKSPACE_H
21 #define CBWORKSPACE_H
22 //------------------------------------------------------------------------------
23 #include "stlstrings.h"
24 #include "cbproject.h"
25 //------------------------------------------------------------------------------
26 
27 class TiXmlElement;
28 class CToolChainSet;
29 
32 
34 {
35  friend class CCodeBlocksWorkspace;
37  private:
41  int m_Weight;
42  public:
43  void Clear(void);
44  void Read(const TiXmlElement* UnitRoot);
45  void Show(void);
46  bool LoadProject(const CString& WorkspacePath);
47  public:
48  CWorkspaceUnit(void);
49  ~CWorkspaceUnit(void);
50 };
51 
53 {
54  private:
56  std::vector<CWorkspaceUnit *> m_Units;
63  protected:
64  int CalculateProjectWeight(const size_t Index = 0);
65  void ResolveProjectDependencies(void);
66  void SortProjectsByWeight(void);
67  public:
68  void Clear(void);
69  void Read(const TiXmlElement* WorkspaceRoot);
70  bool LoadWorkspaceProjects(const CString& WorkspacePath);
71  bool LoadWorkspace(const CString& FileName);
72  void Show(const bool ShowProjects = false);
73  bool GenerateMakefile(const CString& FileName, CCodeBlocksBuildConfig& Config);
74  void GenerateMakefileText(const CString& FileName, CCodeBlocksBuildConfig& Config);
75  public:
78 };
79 
80 #endif
81 //------------------------------------------------------------------------------