All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions
openfluid::tools::ExternalProgram Class Reference

#include <tools/ExternalProgram.hpp>

List of all members.

Public Types

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

Public Member Functions

 ExternalProgram (const QString &Program, 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 QString &Program)
static QString findUsingPathsList (const QString &Program, 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 

Constructor & Destructor Documentation

openfluid::tools::ExternalProgram::ExternalProgram ( const QString &  Program,
const QStringList &  SearchPaths = QStringList(),
bool  UsePathEnv = true 
)

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

Parameters:
[in]ProgramThe 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.

Member Function Documentation

static QString openfluid::tools::ExternalProgram::findUsingPATHEnvVar ( const QString &  Program) [static]

Finds a program using the PATH environment variable

Parameters:
[in]ProgramThe command of the program to find
Returns:
The full path of the first found program
static QString openfluid::tools::ExternalProgram::findUsingPathsList ( const QString &  Program,
const QStringList &  PathsList 
) [static]

Finds a program using a given paths list

Parameters:
[in]ProgramThe program to find
[in]PathsListThe list of paths to search
Returns:
The full path of the first found program

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::tools::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

Returns true if the current program has been found

Returns:
true if the current program has been found

Searches for the program


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines