NCBI C++ ToolKit
Public Types | Static Public Member Functions | Static Protected Member Functions | Private Types | Static Private Attributes | List of all members
CSysPath Class Reference

Search Toolkit Book for CSysPath

#include <gui/widgets/wx/sys_path.hpp>

+ Collaboration diagram for CSysPath:

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
 

Detailed Description

Definition at line 52 of file sys_path.hpp.

Member Typedef Documentation

◆ TAliasMap

typedef map<wxString, wxString> CSysPath::TAliasMap
private

Definition at line 113 of file sys_path.hpp.

Member Enumeration Documentation

◆ 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.

Member Function Documentation

◆ AddToPath()

void CSysPath::AddToPath ( const wxString &  path,
EPathMode  mode = ePath_Prepend 
)
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().

◆ BindAlias()

void CSysPath::BindAlias ( const wxString &  alias,
const wxString &  path 
)
static

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.

◆ GetHomePath()

wxString CSysPath::GetHomePath ( void  )
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().

◆ GetInst()

string CSysPath::GetInst ( )
static

◆ GetResourcePath()

wxString CSysPath::GetResourcePath ( void  )
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().

◆ GetStandardPaths()

wxStandardPathsBase & CSysPath::GetStandardPaths ( )
staticprotected

Definition at line 61 of file sys_path.cpp.

References Get().

Referenced by GetHomePath(), and GetStdPath().

◆ GetStdPath()

wxString CSysPath::GetStdPath ( void  )
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().

◆ ResolvePath() [1/2]

wxString CSysPath::ResolvePath ( const wxString &  path)
static

Call the two paramter ResolvePath after splitting the path.

Definition at line 89 of file sys_path.cpp.

References ResolvePath(), and wxT.

◆ ResolvePath() [2/2]

wxString CSysPath::ResolvePath ( const wxString &  path,
const wxString &  rel_name 
)
static

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().

◆ ResolvePathExisting()

wxString CSysPath::ResolvePathExisting ( const wxString &  path,
const wxString &  delim = wxT(",") 
)
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().

◆ SetInst()

void CSysPath::SetInst ( const string inst)
static

Definition at line 51 of file sys_path.cpp.

References sm_Inst.

Member Data Documentation

◆ sm_AliasMap

CSysPath::TAliasMap CSysPath::sm_AliasMap
staticprivate

Definition at line 114 of file sys_path.hpp.

Referenced by BindAlias(), and ResolvePath().

◆ sm_Inst

string CSysPath::sm_Inst
staticprivate

Definition at line 116 of file sys_path.hpp.

Referenced by GetHomePath(), GetInst(), and SetInst().


The documentation for this class was generated from the following files:
Modified on Wed Sep 04 15:03:33 2024 by modify_doxy.py rev. 669887