KiCad PCB EDA Suite
|
A class which provides project template functionality. More...
#include <project_template.h>
Public Member Functions | |
PROJECT_TEMPLATE (const wxString &aPath) | |
Create a new project instance from aPath. | |
~PROJECT_TEMPLATE () | |
Non-virtual destructor (so no derived classes) | |
wxString | GetPrjDirName () |
Get the dir name of the project template (i.e. | |
wxFileName | GetHtmlFile () |
Get the full Html filename for the project template. | |
bool | CreateProject (wxFileName &aNewProjectPath, wxString *aErrorMsg=nullptr) |
Copies and renames all template files to create a new project. | |
wxBitmap * | GetIcon () |
Get the 64px^2 icon for the project template. | |
wxString * | GetTitle () |
Get the title of the project (extracted from the html title tag) | |
std::vector< wxFileName > | GetFileList () |
Get a vector list of filenames for the template. | |
size_t | GetDestinationFiles (const wxFileName &aNewProjectPath, std::vector< wxFileName > &aDestFiles) |
Fetch the list of destination files to be copied when the new project is created. | |
Protected Attributes | |
wxFileName | m_basePath |
wxFileName | m_metaPath |
wxFileName | m_metaHtmlFile |
wxFileName | m_metaIconFile |
wxBitmap * | m_metaIcon |
wxString | m_title |
A class which provides project template functionality.
Definition at line 143 of file project_template.h.
PROJECT_TEMPLATE::PROJECT_TEMPLATE | ( | const wxString & | aPath | ) |
Create a new project instance from aPath.
aPath should be a directory that conforms to the project template requirements
aPath | Should be a directory containing the template |
Definition at line 39 of file project_template.cpp.
References _, m_basePath, m_metaHtmlFile, m_metaIcon, m_metaIconFile, m_metaPath, m_title, METADIR, METAFILE_ICON, METAFILE_INFO_HTML, and SEP.
PROJECT_TEMPLATE::~PROJECT_TEMPLATE | ( | ) |
Non-virtual destructor (so no derived classes)
Definition at line 149 of file project_template.cpp.
bool PROJECT_TEMPLATE::CreateProject | ( | wxFileName & | aNewProjectPath, |
wxString * | aErrorMsg = nullptr |
||
) |
Copies and renames all template files to create a new project.
aNewProjectPath | The full path of the new project file to create |
aErrorMsg | is an optional string to place project creation error messages. |
Definition at line 213 of file project_template.cpp.
References _, FILEEXT::DrawingSheetFileExtension, GetFileList(), GetPrjDirName(), FILEEXT::LegacyProjectFileExtension, m_basePath, and FILEEXT::ProjectFileExtension.
size_t PROJECT_TEMPLATE::GetDestinationFiles | ( | const wxFileName & | aNewProjectPath, |
std::vector< wxFileName > & | aDestFiles | ||
) |
Fetch the list of destination files to be copied when the new project is created.
aNewProjectPath | is the path to the project to be created. |
aDestFiles | is a container to place the list of destination files to be created. |
Definition at line 167 of file project_template.cpp.
References GetFileList(), GetPrjDirName(), FILEEXT::LegacyProjectFileExtension, m_basePath, name, path, and FILEEXT::ProjectFileExtension.
std::vector< wxFileName > PROJECT_TEMPLATE::GetFileList | ( | ) |
Get a vector list of filenames for the template.
The files are the source files, and have not yet been through any renaming
Definition at line 132 of file project_template.cpp.
References m_basePath, and m_metaPath.
Referenced by CreateProject(), and GetDestinationFiles().
wxFileName PROJECT_TEMPLATE::GetHtmlFile | ( | ) |
Get the full Html filename for the project template.
Definition at line 155 of file project_template.cpp.
References m_metaHtmlFile.
Referenced by GetTitle(), and DIALOG_TEMPLATE_SELECTOR::SetWidget().
wxBitmap * PROJECT_TEMPLATE::GetIcon | ( | ) |
Get the 64px^2 icon for the project template.
Definition at line 161 of file project_template.cpp.
References m_metaIcon.
Referenced by TEMPLATE_WIDGET::SetTemplate().
wxString PROJECT_TEMPLATE::GetPrjDirName | ( | ) |
Get the dir name of the project template (i.e.
the name of the last folder containing the template files)
Definition at line 143 of file project_template.cpp.
References m_basePath.
Referenced by CreateProject(), and GetDestinationFiles().
wxString * PROJECT_TEMPLATE::GetTitle | ( | ) |
Get the title of the project (extracted from the html title tag)
Definition at line 321 of file project_template.cpp.
References GetHtmlFile(), m_title, and text.
Referenced by TEMPLATE_WIDGET::SetTemplate().
|
protected |
Definition at line 146 of file project_template.h.
Referenced by CreateProject(), GetDestinationFiles(), GetFileList(), GetPrjDirName(), and PROJECT_TEMPLATE().
|
protected |
Definition at line 148 of file project_template.h.
Referenced by GetHtmlFile(), and PROJECT_TEMPLATE().
|
protected |
Definition at line 150 of file project_template.h.
Referenced by GetIcon(), and PROJECT_TEMPLATE().
|
protected |
Definition at line 149 of file project_template.h.
Referenced by PROJECT_TEMPLATE().
|
protected |
Definition at line 147 of file project_template.h.
Referenced by GetFileList(), and PROJECT_TEMPLATE().
|
protected |
Definition at line 151 of file project_template.h.
Referenced by GetTitle(), and PROJECT_TEMPLATE().