Interface for running jobs locally. More...
#include <globalsearch/local.h>
Public Slots | |
virtual bool | writeFiles (Structure *s, const QHash< QString, QString > &files) const |
virtual bool | prepareForStructureUpdate (Structure *s) const |
virtual bool | checkIfFileExists (Structure *s, const QString &filename, bool *exists) |
virtual bool | fetchFile (Structure *s, const QString &filename, QString *contents) const |
virtual bool | grepFile (Structure *s, const QString &matchText, const QString &filename, QStringList *matches=0, int *exitcode=0, const bool caseSensitive=true) const |
Public Member Functions | |
LocalQueueInterface (OptBase *parent, const QString &settingFile="") | |
virtual | ~LocalQueueInterface () |
Interface for running jobs locally.
Definition at line 30 of file local.h.
GlobalSearch::LocalQueueInterface::LocalQueueInterface | ( | OptBase * | parent, | |
const QString & | settingFile = "" | |||
) | [explicit] |
Constructor
parent | OptBase parent | |
settingFile | Filename from which to initialize settings. |
Definition at line 32 of file local.cpp.
References GlobalSearch::QueueInterface::m_hasDialog, and GlobalSearch::QueueInterface::m_idString.
GlobalSearch::LocalQueueInterface::~LocalQueueInterface | ( | ) | [virtual] |
bool GlobalSearch::LocalQueueInterface::checkIfFileExists | ( | Structure * | s, | |
const QString & | filename, | |||
bool * | exists | |||
) | [virtual, slot] |
Check if the file filename exists in the working directory of Structure s and store the result in exists.
Implements GlobalSearch::QueueInterface.
bool GlobalSearch::LocalQueueInterface::fetchFile | ( | Structure * | s, | |
const QString & | filename, | |||
QString * | contents | |||
) | const [virtual, slot] |
Retrieve the contents of the file filename for Structure s as a QString contents.
Implements GlobalSearch::QueueInterface.
Definition at line 101 of file local.cpp.
Referenced by grepFile().
bool GlobalSearch::LocalQueueInterface::grepFile | ( | Structure * | s, | |
const QString & | matchText, | |||
const QString & | filename, | |||
QStringList * | matches = 0 , |
|||
int * | exitcode = 0 , |
|||
const bool | caseSensitive = true | |||
) | const [virtual, slot] |
Grep through the file filename for Structure s's working directory, looking for matchText. The list of matches is returned in the QStringList matches and the exit status is returned as exitcode.
Possible exitcodes:
s | Structure of interest | |
matchText | Text to match | |
filename | Name of file to grep | |
matches | List of matches (return) | |
exitcode | Exit code of grep (see details) (return) | |
caseSensitive | If true, match case. Otherwise, perform case-insensitive search (e.g. grep -i) Default is true. |
Implements GlobalSearch::QueueInterface.
Definition at line 115 of file local.cpp.
References fetchFile().
bool GlobalSearch::LocalQueueInterface::prepareForStructureUpdate | ( | Structure * | s | ) | const [virtual, slot] |
Perform any work needed before calling Optimizer::update. This function mainly exists for RemoteQueue classes to copy files back from the server, but may be used for other purposes. It is guaranteed to be called by Optimizer before updating.
s | The structure that is to be updated. |
Implements GlobalSearch::QueueInterface.
bool GlobalSearch::LocalQueueInterface::writeFiles | ( | Structure * | s, | |
const QHash< QString, QString > & | files | |||
) | const [virtual, slot] |
Write the input files in the hash files to the appropriate location for Structure s.
s | Structure of interest | |
files | Key: filename, Value: text. |
Implements GlobalSearch::QueueInterface.