NCBI C++ ToolKit
|
Search Toolkit Book for CSysPath
#include <gui/widgets/wx/sys_path.hpp>
Public Types | |
enum | EPathMode { ePath_Prepend , ePath_Append } |
Add an element to the environment's PATH variable. More... | |
Static Public Member Functions | |
static void | BindAlias (const wxString &alias, const wxString &path) |
Bind an alias to an existing path The application expects certain aliases to be present; if they are not provided, reasonable defaults will be used. More... | |
static wxString | ResolvePath (const wxString &path, const wxString &rel_name) |
Utility function to hide the platform specifics of locating our standard directories and files. More... | |
static wxString | ResolvePath (const wxString &path) |
Call the two paramter ResolvePath after splitting the path. More... | |
static wxString | ResolvePathExisting (const wxString &path, const wxString &delim=wxT(",")) |
Utility function to hide the platform specifics of locating our standard directories. More... | |
static wxString | GetStdPath (void) |
the applicaton installation directory. More... | |
static wxString | GetHomePath (void) |
the user-specific application-specific home directory corresponds to the <home> alias above. More... | |
static wxString | GetResourcePath (void) |
the shared resource path corresponds to the <res> alias above. More... | |
static void | AddToPath (const wxString &path, EPathMode mode=ePath_Prepend) |
PATH variable manipulators. More... | |
static void | SetInst (const string &inst) |
static string | GetInst () |
Static Protected Member Functions | |
static wxStandardPathsBase & | GetStandardPaths () |
Private Types | |
typedef map< wxString, wxString > | TAliasMap |
Static Private Attributes | |
static TAliasMap | sm_AliasMap |
static string | sm_Inst |
Definition at line 52 of file sys_path.hpp.
|
private |
Definition at line 113 of file sys_path.hpp.
enum CSysPath::EPathMode |
Add an element to the environment's PATH variable.
This will make sure that the element is inserted in the approrpiate place, and will erase any occurrences of the path in the existing value
Enumerator | |
---|---|
ePath_Prepend | |
ePath_Append |
Definition at line 100 of file sys_path.hpp.
|
static |
PATH variable manipulators.
Definition at line 232 of file sys_path.cpp.
References ePath_Append, ePath_Prepend, and wxT.
Referenced by CPkgManager::x_LoadPackage().
Bind an alias to an existing path The application expects certain aliases to be present; if they are not provided, reasonable defaults will be used.
Note that this function is not thread-safe by design; application aliases shall be created in a single thread at application start-up. Possible aliases include: '<std>' = location of the application installation '<home>' = application- and user-specific data directory '<res>' = location of the standard resource directory '<pkgdir>' = location of package installation
Definition at line 78 of file sys_path.cpp.
References sm_AliasMap.
|
static |
the user-specific application-specific home directory corresponds to the <home> alias above.
Definition at line 202 of file sys_path.cpp.
References DEFINE_STATIC_FAST_MUTEX, GetStandardPaths(), sm_Inst, and wxT.
Referenced by ResolvePath().
|
static |
Definition at line 56 of file sys_path.cpp.
References sm_Inst.
Referenced by CEditingBtnsPanel::CEditingBtnsPanel(), CFeedbackWizard::Create(), and CDiscrepancyDlg::CreateControls().
|
static |
the shared resource path corresponds to the <res> alias above.
Definition at line 189 of file sys_path.cpp.
References GetStdPath(), and wxT.
Referenced by CGLDemoDlg::Init(), ResolvePath(), and CVectorScreen::Run().
|
staticprotected |
Definition at line 61 of file sys_path.cpp.
References Get().
Referenced by GetHomePath(), and GetStdPath().
|
static |
the applicaton installation directory.
Usually the parent of the App Path. corresponds to the <std> alias above.
Definition at line 159 of file sys_path.cpp.
References GetStandardPaths(), LOG_POST, Warning(), and wxT.
Referenced by GetResourcePath(), ResolvePath(), CBLASTSeqToolJob::x_CreateProjectItems(), and CWindowMaskerJob::x_CreateProjectItems().
|
static |
Call the two paramter ResolvePath after splitting the path.
Definition at line 89 of file sys_path.cpp.
References ResolvePath(), and wxT.
Utility function to hide the platform specifics of locating our standard directories and files.
This function is responsible for resolving '<std>', '<home>', and '<res>' correctly.
Definition at line 106 of file sys_path.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), GetHomePath(), GetResourcePath(), GetStdPath(), sm_AliasMap, and wxT.
Referenced by CWorkspaceAutoSaver::CheckCrash(), CWorkspaceAutoSaver::CleanUp(), CDataMiningPanel::CreateControls(), CQueryParsePanel::CreateControls(), CMacroFlowEditor::CreateControls(), CwxLogDiagHandler::CwxLogDiagHandler(), CFeedbackReport::Format(), CDiscrepancyDlg::GetSettingsPath(), CDiscrepancyPanel::GetSettingsPath(), CMacroFlowEditor::GetSettingsPath(), CScriptPanel::Init(), CMacroPanelLoader::Initialize(), CEditingBtnsPanel::LoadSettings(), CUIToolRegistry::LoadTemplateToolsInfo(), CSeqGraphicDemoDlg::OnAccClick(), CBLASTSearchOptionsPanel::OnTryAgain(), CNetBLASTUIDataSource::Open(), CGenBankUIDataSource::Open(), CLayoutTrack::RegisterIconImage(), ResolvePath(), ResolvePathExisting(), s_GetMacroScriptLocation(), s_UpdateMacros(), CWndLayoutReg::Save(), CEditingBtnsPanel::SaveSettings(), CFeedbackReport::SendFeedback(), CWorkbenchFrame::SetPagerMessage(), CWorkbench::x_CreateFileArtProvider(), CWinMaskerFileStorage::x_GetDownloadPath(), CFrameworkDemoApp::x_GetGuiRegistryPath(), CAlignMultipleDemoApp::x_GetGuiRegistryPath(), CDemoApp::x_GetGuiRegistryPath(), CNetBLASTUIDataSource::x_LoadJobDescriptors(), CPkgManager::x_LoadPackage(), CwxMainFrame::x_RegisterAliases(), CWorkspaceAutoSaver::x_RestoreWorkspace(), CNetBLASTUIDataSource::x_SaveJobDescriptors(), CWorkspaceAutoSaver::x_SaveWorkspace(), CWorkbenchFrame::x_ShowPagerMessage(), CSequenceSearchForm::x_UpdateFileList(), COrfSearchForm::x_UpdateKozak(), and CSeqEditPackage::x_UpdateValAuxFile().
|
static |
Utility function to hide the platform specifics of locating our standard directories.
This function is responsible for resolving '<std>', '<home>', and '<res>' correctly, and further ensures that the relevant final name already exists as a file or directory. The 'path' parameter here contains a delimited set of directories to search in order.
Definition at line 142 of file sys_path.cpp.
References count, i, and ResolvePath().
Referenced by CMacroFlowEditor::CopyDefaultLibrary(), CSeqTextDemoDlg::CreateControls(), CSeqEditPackage::Init(), CWndLayoutReg::Load(), CMacroFlowEditor::OnSaveCopies(), CGenBankUIDataSource::Open(), RunningInsideNCBI(), and CFeedbackReport::SendFeedback().
Definition at line 51 of file sys_path.cpp.
References sm_Inst.
|
staticprivate |
Definition at line 114 of file sys_path.hpp.
Referenced by BindAlias(), and ResolvePath().
|
staticprivate |
Definition at line 116 of file sys_path.hpp.
Referenced by GetHomePath(), GetInst(), and SetInst().