Public Types | Public Member Functions | Static Public Member Functions | List of all members
openfluid::utils::ExternalProgram Class Reference

#include <utils/ExternalProgram.hpp>

Public Types

enum  RegisteredPrograms {
  CMakeProgram, ZipProgram, SevenZipProgram, GnuplotProgram,
  GoogleEarthProgram, GccProgram, PdfLatexProgram, BibTexProgram,
  Latex2HTMLProgram, GitProgram, GrassGisProgram
}
 

Public Member Functions

 ExternalProgram (const QStringList &ProgramNames, const QStringList &SearchPaths=QStringList(), bool UsePathEnv=true)
 
 ExternalProgram (const QString &ProgramName, const QStringList &SearchPaths=QStringList(), bool UsePathEnv=true)
 
 ~ExternalProgram ()
 
bool isFound () const
 
void searchForProgram ()
 
QString getFullProgramPath () const
 

Static Public Member Functions

static ExternalProgram getRegisteredProgram (RegisteredPrograms Prog, const QStringList &SearchPaths=QStringList(), bool UsePathEnv=true)
 
static QString findUsingPATHEnvVar (const QStringList &ProgramNames)
 
static QString findUsingPathsList (const QStringList &ProgramNames, const QStringList &PathsList)
 

Detailed Description

Management of external programs

Member Enumeration Documentation

List of pre-registered external programs

Enumerator
CMakeProgram 
ZipProgram 
SevenZipProgram 
GnuplotProgram 
GoogleEarthProgram 
GccProgram 
PdfLatexProgram 
BibTexProgram 
Latex2HTMLProgram 
GitProgram 
GrassGisProgram 

Constructor & Destructor Documentation

openfluid::utils::ExternalProgram::ExternalProgram ( const QStringList &  ProgramNames,
const QStringList &  SearchPaths = QStringList(),
bool  UsePathEnv = true 
)

Constructor for a given external programs. Automatically searches for the program at construction

Parameters
[in]ProgramNamesThe possible names of the program to find
[in]SearchPathsThe list of paths to search. Default value is an empty list
[in]UsePathEnvEnable the use of PATH environment variable to search for the program. Default value is true.
openfluid::utils::ExternalProgram::ExternalProgram ( const QString &  ProgramName,
const QStringList &  SearchPaths = QStringList(),
bool  UsePathEnv = true 
)

Constructor for a given external programs. Automatically searches for the program at construction

Parameters
[in]ProgramNameThe name of the program to find
[in]SearchPathsThe list of paths to search. Default value is an empty list
[in]UsePathEnvEnable the use of PATH environment variable to search for the program. Default value is true.
openfluid::utils::ExternalProgram::~ExternalProgram ( )

Member Function Documentation

static QString openfluid::utils::ExternalProgram::findUsingPATHEnvVar ( const QStringList &  ProgramNames)
static

Finds a program using the PATH environment variable

Parameters
[in]ProgramNamesThe list of the potential program names of the program to find
Returns
The full path of the first found program
static QString openfluid::utils::ExternalProgram::findUsingPathsList ( const QStringList &  ProgramNames,
const QStringList &  PathsList 
)
static

Finds a program using a given paths list

Parameters
[in]ProgramNamesThe list of the potential program names of the program to find
[in]PathsListThe list of paths to search
Returns
The full path of the first found program
QString openfluid::utils::ExternalProgram::getFullProgramPath ( ) const
inline

Returns the full path of the program

Returns
the full path of the program if it has been found, otherwise an empty string
static ExternalProgram openfluid::utils::ExternalProgram::getRegisteredProgram ( RegisteredPrograms  Prog,
const QStringList &  SearchPaths = QStringList(),
bool  UsePathEnv = true 
)
static

Returns an ExternalProgram object initialized with the registered program to find

Parameters
[in]ProgThe registered program to find
[in]SearchPathsThe list of paths to search. Default value is an empty list
[in]UsePathEnvEnable the use of PATH environment variable to search for the registered program. Default value is true.
Returns
An ExternalProgram object initialized with the registered program to find
bool openfluid::utils::ExternalProgram::isFound ( ) const
inline

Returns true if the current program has been found

Returns
true if the current program has been found
void openfluid::utils::ExternalProgram::searchForProgram ( )

Searches for the program


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