musredit 1.0.0
Loading...
Searching...
No Matches
PDefaultPaths Class Reference

Container class for managing default data file search paths. More...

#include <PChangeDefaultPathsDialog.h>

Inheritance diagram for PDefaultPaths:
Collaboration diagram for PDefaultPaths:

Public Member Functions

 PDefaultPaths ()
 Constructs a PDefaultPaths object and loads paths from configuration.
 
virtual ~PDefaultPaths ()
 Virtual destructor.
 
virtual bool isValid ()
 Check if the configuration was loaded successfully.
 
virtual void appendDefaultPath (QString str)
 Add a new path to the default paths list.
 
virtual QStringList * getDefaultPathList ()
 Get the list of default search paths.
 
virtual QString getPrefPathName ()
 Get the path to the configuration file being used.
 

Private Attributes

bool fValid
 Flag indicating if configuration loaded successfully.
 
QString fPrefPathName
 Full path to the active configuration file.
 
QStringList fDefaultPath
 List of default data file search directories.
 

Friends

class PDefaultPathsXMLParser
 Allow parser to access private members.
 

Detailed Description

Container class for managing default data file search paths.

This class loads and stores the list of default directory paths where musrfit searches for muon data files. The paths are read from the musrfit_startup.xml configuration file during construction.

The configuration file is searched in the following order:

  1. Current working directory
  2. $HOME/.musrfit/
  3. $MUSRFITPATH/
  4. $ROOTSYS/bin/
See also
PDefaultPathsXMLParser For the XML parsing implementation
PChangeDefaultPathsDialog For the user interface to edit paths

Definition at line 140 of file PChangeDefaultPathsDialog.h.

Constructor & Destructor Documentation

◆ PDefaultPaths()

PDefaultPaths::PDefaultPaths ( )

Constructs a PDefaultPaths object and loads paths from configuration.

Searches for the musrfit_startup.xml configuration file in the standard search locations, then parses it to extract default data paths.

Search Order:
  1. Current working directory (./musrfit_startup.xml)
  2. User's home directory ($HOME/.musrfit/musrfit_startup.xml)
  3. MUSRFITPATH environment variable ($MUSRFITPATH/musrfit_startup.xml)
  4. ROOT installation ($ROOTSYS/bin/musrfit_startup.xml)

After construction, call isValid() to check if configuration was loaded successfully.

Note
Displays an error dialog if parsing fails.

Definition at line 242 of file PChangeDefaultPathsDialog.cpp.

◆ ~PDefaultPaths()

virtual PDefaultPaths::~PDefaultPaths ( )
inlinevirtual

Virtual destructor.

Definition at line 148 of file PChangeDefaultPathsDialog.h.

Member Function Documentation

◆ appendDefaultPath()

virtual void PDefaultPaths::appendDefaultPath ( QString str)
inlinevirtual

Add a new path to the default paths list.

Parameters
strDirectory path to add.

Definition at line 160 of file PChangeDefaultPathsDialog.h.

◆ getDefaultPathList()

virtual QStringList * PDefaultPaths::getDefaultPathList ( )
inlinevirtual

Get the list of default search paths.

Returns
Pointer to the QStringList containing all paths.

Definition at line 166 of file PChangeDefaultPathsDialog.h.

◆ getPrefPathName()

virtual QString PDefaultPaths::getPrefPathName ( )
inlinevirtual

Get the path to the configuration file being used.

Returns
Full path to the musrfit_startup.xml file.

Definition at line 172 of file PChangeDefaultPathsDialog.h.

◆ isValid()

virtual bool PDefaultPaths::isValid ( )
inlinevirtual

Check if the configuration was loaded successfully.

Returns
true if valid, false if loading failed.

Definition at line 154 of file PChangeDefaultPathsDialog.h.

Friends And Related Symbol Documentation

◆ PDefaultPathsXMLParser

friend class PDefaultPathsXMLParser
friend

Allow parser to access private members.

Definition at line 175 of file PChangeDefaultPathsDialog.h.

Member Data Documentation

◆ fDefaultPath

QStringList PDefaultPaths::fDefaultPath
private

List of default data file search directories.

Definition at line 179 of file PChangeDefaultPathsDialog.h.

◆ fPrefPathName

QString PDefaultPaths::fPrefPathName
private

Full path to the active configuration file.

Definition at line 178 of file PChangeDefaultPathsDialog.h.

◆ fValid

bool PDefaultPaths::fValid
private

Flag indicating if configuration loaded successfully.

Definition at line 177 of file PChangeDefaultPathsDialog.h.


The documentation for this class was generated from the following files: