ExeFile Class Reference

Access to external program executables (game clients, servers, and so on). More...

#include <exefile.h>

+ Inheritance diagram for ExeFile:

Public Member Functions

const QString & configKey () const
 Config key where executable path on current system can be remembered. More...
 
const QString & exeTypeName () const
 Name of the type of the executable (server, client, etc.). More...
 
virtual Message install (QWidget *parent)
 Attempts to install the binary. More...
 
virtual QString pathToExe (Message &message)
 Returns the path to the executable file. More...
 
const QString & programName () const
 Name of the program this executable belongs to (ex. "Odamex"). More...
 
void setConfigKey (const QString &keyName)
 Plugin setter for configKey(). More...
 
void setExeTypeName (const QString &name)
 Plugin setter for exeTypeName(). More...
 
void setProgramName (const QString &name)
 Plugin setter for programName(). More...
 
virtual QString workingDirectory (Message &message)
 Path to this executable working directory. More...
 

Detailed Description

Access to external program executables (game clients, servers, and so on).

ExeFile is an interface to external programs executables. It obtains directory and file paths to the executable with pathToExe() and workingDirectory(), defines name of configKey() under which the executable path can be stored, names the program in general through programName() and also names the purpose of the exec within that program through exeTypeName() and lastly, it optionally handles install() procedure if user and plugin desire so.

Definition at line 48 of file exefile.h.

Member Function Documentation

const QString & ExeFile::configKey ( ) const

Config key where executable path on current system can be remembered.

Definition at line 52 of file exefile.cpp.

const QString & ExeFile::exeTypeName ( ) const

Name of the type of the executable (server, client, etc.).

Definition at line 57 of file exefile.cpp.

Message ExeFile::install ( QWidget *  parent)
virtual

Attempts to install the binary.

Some games may support additional executables (testing binaries, for example). If such executables are not available on local filesystem, but can be installed automatically, pathToExe() should return Message with Message::Type::GAME_NOT_FOUND_BUT_CAN_BE_INSTALLED error type and implement install() method.

Default implementation does nothing and returns ignorable message.

Example implementation is provided in Zandronum plugin.

Parameters
parentShould be treated as parent widget for all widgets that need to be created during the process.
Returns
Message with appropriately set type. Type of the message affects Doomseeker behavior so it needs to be set correctly.
  • Message::Type::SUCCESSFUL if installation completes properly, in this case Doomseeker continues any operation that was interrupted by the installation procedure (like game launch).
  • Message::Type::CANCELLED if installation was cancelled by the user, in this case Doomseeker aborts silently.
  • Return error type to prompt Doomseeker to display an error message.

Definition at line 62 of file exefile.cpp.

QString ExeFile::pathToExe ( Message message)
virtual

Returns the path to the executable file.

Parameters
[out]messageInformation or error message, if any. The type of the message might be relevant in some cases, please review documentation for install() method.
Returns
Path to the file if all fine or empty if error.
See Also
install()

Definition at line 67 of file exefile.cpp.

const QString & ExeFile::programName ( ) const

Name of the program this executable belongs to (ex. "Odamex").

Definition at line 98 of file exefile.cpp.

void ExeFile::setConfigKey ( const QString &  keyName)

Plugin setter for configKey().

Definition at line 103 of file exefile.cpp.

void ExeFile::setExeTypeName ( const QString &  name)

Plugin setter for exeTypeName().

Definition at line 108 of file exefile.cpp.

void ExeFile::setProgramName ( const QString &  name)

Plugin setter for programName().

Definition at line 113 of file exefile.cpp.

QString ExeFile::workingDirectory ( Message message)
virtual

Path to this executable working directory.

Default behavior returns directory of pathToExe(), but you can override this to provide different working directory if needed.

Parameters
[out]messageInformation or error message, if any.
Returns
Path to the working directory if all fine or empty if error.

Definition at line 118 of file exefile.cpp.


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