![]() |
KiCad PCB EDA Suite
|
#include <pgm_base.h>
Go to the source code of this file.
Functions | |
wxString | NormalizePath (const wxFileName &aFilePath, const ENV_VAR_MAP *aEnvVars, const PROJECT *aProject) |
< Helper functions to substitute paths with environmental variables. More... | |
wxString | NormalizePath (const wxFileName &aFilePath, const ENV_VAR_MAP *aEnvVars, const wxString &aProjectPath) |
Normalize a file path to an environmental variable, if possible. More... | |
wxString | ResolveFile (const wxString &aFileName, const ENV_VAR_MAP *aEnvVars, const PROJECT *aProject) |
Search the default paths trying to find one with the requested file. More... | |
bool | PathIsInsideProject (const wxString &aFileName, const PROJECT *aProject, wxFileName *aSubPath=nullptr) |
Check if a given filename is within a given project directory (not whether it exists!) More... | |
wxString NormalizePath | ( | const wxFileName & | aFilePath, |
const ENV_VAR_MAP * | aEnvVars, | ||
const PROJECT * | aProject | ||
) |
< Helper functions to substitute paths with environmental variables.
Normalize a file path to an environmental variable, if possible.
aFilePath | is the full file path (path and file name) to be normalized. |
aEnvVars | is an optional map of environmental variables to try substitution with. |
aProject | is an optional project, to normalize the file path to the project path. |
Definition at line 126 of file env_paths.cpp.
References PROJECT::GetProjectPath(), and NormalizePath().
wxString NormalizePath | ( | const wxFileName & | aFilePath, |
const ENV_VAR_MAP * | aEnvVars, | ||
const wxString & | aProjectPath | ||
) |
Normalize a file path to an environmental variable, if possible.
aFilePath | is the full file path (path and file name) to be normalized. |
aEnvVars | is an optional map of environmental variables to try substitution with. |
aProjectPath | is an optional string to normalize the file path to the project path. |
Definition at line 67 of file env_paths.cpp.
References Format(), normalizeAbsolutePaths(), and PROJECT_VAR_NAME.
Referenced by PCB_BASE_EDIT_FRAME::AddLibrary(), SYMBOL_LIBRARY_MANAGER::addLibrary(), SYMBOL_EDIT_FRAME::addLibTableEntry(), PANEL_SYM_LIB_TABLE::browseLibrariesHandler(), PANEL_FP_LIB_TABLE::browseLibrariesHandler(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), NormalizePath(), TEXT_BUTTON_FILE_BROWSER::OnButtonClick(), PANEL_SYM_LIB_TABLE::onConvertLegacyLibraries(), and SYMBOL_EDIT_FRAME::replaceLibTableEntry().
bool PathIsInsideProject | ( | const wxString & | aFileName, |
const PROJECT * | aProject, | ||
wxFileName * | aSubPath = nullptr |
||
) |
Check if a given filename is within a given project directory (not whether it exists!)
aFileName | is the absolute path to check |
aProject | is the project to test against |
aSubPath | will be filled with the relative path to the file inside the project (if any) |
Definition at line 181 of file env_paths.cpp.
References PROJECT::GetProjectPath().
wxString ResolveFile | ( | const wxString & | aFileName, |
const ENV_VAR_MAP * | aEnvVars, | ||
const PROJECT * | aProject | ||
) |
Search the default paths trying to find one with the requested file.
aFileName | is the name of the searched file. It might be a relative path. |
aEnvVars | is an optional map of environmental variables that can contain paths. |
aProject | is an optional project, to check the project path. |
Definition at line 150 of file env_paths.cpp.
References createFilePath(), and PROJECT::GetProjectPath().
Referenced by NETLIST_EXPORTER_PSPICE::Format().