cbp2make
Makefile generation tool for Code::Blocks IDE
|
Workspace description. More...
#include <cbworkspace.h>
Public Member Functions | |
void | Clear (void) |
Resets the workspace to the initial state. More... | |
void | Read (const TiXmlElement *WorkspaceRoot) |
Reads the workspace settings from an XML document. More... | |
bool | LoadWorkspaceProjects (const CString &WorkspacePath) |
Loads all workspace units (projects) in the workspace. More... | |
bool | LoadWorkspace (const CString &FileName) |
Loads a workspace from a file specified by FileName. More... | |
void | Show (const bool ShowProjects=false) |
Prints the workspace contents and (optionally) contents of workspace units (projects) to standard output. More... | |
bool | GenerateMakefile (const CString &FileName, CCodeBlocksBuildConfig &Config) |
Generates makefile and writes its text representation to a file specified by FileName. More... | |
void | GenerateMakefileText (const CString &FileName, CCodeBlocksBuildConfig &Config) |
Generates makefile text and writes it to a file specified by FileName. More... | |
CCodeBlocksWorkspace (void) | |
Create workspace. More... | |
~CCodeBlocksWorkspace (void) | |
Destroys workspace. More... | |
Protected Member Functions | |
int | CalculateProjectWeight (const size_t Index=0) |
Calculates weight (priority) of a single workspace unit (project) with number Index. More... | |
void | ResolveProjectDependencies (void) |
Resolves workspace unit (project) dependencies by calculating project weights. More... | |
void | SortProjectsByWeight (void) |
Sorts workspace units (projects) by weight in ascending order. More... | |
Private Attributes | |
CString | m_Title |
Title of the workspace. More... | |
std::vector< CWorkspaceUnit * > | m_Units |
List of workspace units (projects) in the workspace. More... | |
CStringList | m_TargetNames |
List of build target names of workspace units. More... | |
CStringList | m_MakefileNames |
List of makefile names of workspace units. More... | |
CStringList | m_MakefilePaths |
List of makefile paths of workspace units. More... | |
CStringList | m_TargetDeps |
List of dependencies of workspace units. More... | |
CStringList | m_MakefileText |
Contains plain text of makefile for the workspace. More... | |
CMakefile | m_Makefile |
Contains object-based makefile for the workspace. More... | |
Workspace description.
Contains properties of Code::Blocks workspace.
CCodeBlocksWorkspace::CCodeBlocksWorkspace | ( | void | ) |
Create workspace.
CCodeBlocksWorkspace::~CCodeBlocksWorkspace | ( | void | ) |
Destroys workspace.
|
protected |
Calculates weight (priority) of a single workspace unit (project) with number Index.
Index | number of a workspace unit (project). |
This function is a part of the core mechanism for resolving project dependencies.
CCodeBlocksWorkspace::Clear | ( | void | ) |
Resets the workspace to the initial state.
CCodeBlocksWorkspace::GenerateMakefile | ( | const CString & | FileName, |
CCodeBlocksBuildConfig & | Config | ||
) |
Generates makefile and writes its text representation to a file specified by FileName.
FileName | a file name for makefile of the workspace. |
Config | build configuration. |
This function generates makefile text only for the workspace, makefiles for individual projects in the workspace are generated by CCodeBlocksProject.
CCodeBlocksWorkspace::GenerateMakefileText | ( | const CString & | FileName, |
CCodeBlocksBuildConfig & | Config | ||
) |
Generates makefile text and writes it to a file specified by FileName.
FileName | a file name for makefile of the workspace. |
Config | build configuration. |
This function generates makefile text only for the workspace, makefiles for individual projects in the workspace are generated by CCodeBlocksProject.
CCodeBlocksWorkspace::LoadWorkspace | ( | const CString & | FileName | ) |
Loads a workspace from a file specified by FileName.
FileName | name of Code::Blocks workspace file. |
CCodeBlocksWorkspace::LoadWorkspaceProjects | ( | const CString & | WorkspacePath | ) |
Loads all workspace units (projects) in the workspace.
CCodeBlocksWorkspace::Read | ( | const TiXmlElement * | WorkspaceRoot | ) |
Reads the workspace settings from an XML document.
WorkspaceRoot | an element of XML document. |
|
protected |
Resolves workspace unit (project) dependencies by calculating project weights.
CCodeBlocksWorkspace::Show | ( | const bool | ShowProjects = false | ) |
Prints the workspace contents and (optionally) contents of workspace units (projects) to standard output.
ShowProjects | tell to display contents of workspace units. |
|
protected |
Sorts workspace units (projects) by weight in ascending order.
This function is a part of the core mechanism for resolving project dependencies.
|
private |
Contains object-based makefile for the workspace.
Contents of makefile are generated by CCodeBlocksWorkspace::GenerateMakefile(const CString& FileName, CCodeBlocksBuildConfig& Config) before saving to a file.
|
private |
List of makefile names of workspace units.
This list is automatically refreshed by CCodeBlocksWorkspace::GenerateMakefile(const CString& FileName, CCodeBlocksBuildConfig& Config).
|
private |
List of makefile paths of workspace units.
This list is automatically refreshed by CCodeBlocksWorkspace::GenerateMakefile(const CString& FileName, CCodeBlocksBuildConfig& Config).
|
private |
Contains plain text of makefile for the workspace.
Contents of makefile are generated by CCodeBlocksWorkspace::GenerateMakefileText(const CString& FileName, CCodeBlocksBuildConfig& Config) before saving to a file.
|
private |
List of dependencies of workspace units.
Each line of the list contains decorated project names separated by space character and represents dependencies of corresponding project contained in the workspace. Decorated names are used as makefile target names. This list is automatically refreshed by CCodeBlocksWorkspace::GenerateMakefile(const CString& FileName, CCodeBlocksBuildConfig& Config).
|
private |
List of build target names of workspace units.
This list is automatically refreshed by CCodeBlocksWorkspace::GenerateMakefile(const CString& FileName, CCodeBlocksBuildConfig& Config).
|
private |
Title of the workspace.
|
private |
List of workspace units (projects) in the workspace.