summaryrefslogtreecommitdiff
path: root/src/loadmechanism.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/loadmechanism.h')
-rw-r--r--src/loadmechanism.h111
1 files changed, 62 insertions, 49 deletions
diff --git a/src/loadmechanism.h b/src/loadmechanism.h
index dfa43d85..c04473ab 100644
--- a/src/loadmechanism.h
+++ b/src/loadmechanism.h
@@ -20,9 +20,11 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#ifndef LOADMECHANISM_H
#define LOADMECHANISM_H
+
#include <QDir>
#include <QString>
+
/**
* @brief manages the various load mechanisms supported by Mod Organizer
* the load mechanisms is the means by which the mo-dll is injected into the target
@@ -36,72 +38,83 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
* chain-load the original dll. This currently only works with steam-versions of games and
* is intended as a last resort solution.
**/
-class LoadMechanism {
+class LoadMechanism
+{
public:
- enum EMechanism { LOAD_MODORGANIZER = 0, LOAD_SCRIPTEXTENDER, LOAD_PROXYDLL };
+
+ enum EMechanism {
+ LOAD_MODORGANIZER = 0,
+ LOAD_SCRIPTEXTENDER,
+ LOAD_PROXYDLL
+ };
public:
- /**
- * @brief constructor
- *
- **/
- LoadMechanism();
- /**
- * activate the specified mechanism. This automatically disables any other mechanism active
- *
- * @param mechanism the mechanism to activate
- **/
- void activate(EMechanism mechanism);
+ /**
+ * @brief constructor
+ *
+ **/
+ LoadMechanism();
+
+ /**
+ * activate the specified mechanism. This automatically disables any other mechanism active
+ *
+ * @param mechanism the mechanism to activate
+ **/
+ void activate(EMechanism mechanism);
- /**
- * @brief test whether the "Mod Organizer" load mechanism is supported for the current game
- *
- * @return true if the load mechanism is supported
- **/
- bool isDirectLoadingSupported();
+ /**
+ * @brief test whether the "Mod Organizer" load mechanism is supported for the current game
+ *
+ * @return true if the load mechanism is supported
+ **/
+ bool isDirectLoadingSupported();
- /**
- * @brief test whether the "Script Extender" load mechanism is supported for the current game
- *
- * @return true if the load mechanism is supported
- **/
- bool isScriptExtenderSupported();
+ /**
+ * @brief test whether the "Script Extender" load mechanism is supported for the current game
+ *
+ * @return true if the load mechanism is supported
+ **/
+ bool isScriptExtenderSupported();
- /**
- * @brief test whether the "Proxy DLL" load mechanism is supported for the current game
- *
- * @return true if the load mechanism is supported
- **/
- bool isProxyDLLSupported();
+ /**
+ * @brief test whether the "Proxy DLL" load mechanism is supported for the current game
+ *
+ * @return true if the load mechanism is supported
+ **/
+ bool isProxyDLLSupported();
private:
- // write a hint file that is required for certain loading mechanisms for the dll to find
- // the mod organizer installation
- void writeHintFile(const QDir& targetDirectory);
- // remove the hint file if it exists. does nothing if the file doesn't exist
- void removeHintFile(QDir targetDirectory);
+ // write a hint file that is required for certain loading mechanisms for the dll to find
+ // the mod organizer installation
+ void writeHintFile(const QDir &targetDirectory);
- // compare the two files by md5-hash, returns true if they are identical
- bool hashIdentical(const QString& fileNameLHS, const QString& fileNameRHS);
+ // remove the hint file if it exists. does nothing if the file doesn't exist
+ void removeHintFile(QDir targetDirectory);
- // deactivate loading through script extender. does nothing if se-loading wasn't active
- void deactivateScriptExtender();
+ // compare the two files by md5-hash, returns true if they are identical
+ bool hashIdentical(const QString &fileNameLHS, const QString &fileNameRHS);
- // deactivate loading through proxy-dll. does nothing if se-loading wasn't active
- void deactivateProxyDLL();
+ // deactivate loading through script extender. does nothing if se-loading wasn't active
+ void deactivateScriptExtender();
- // activate loading through script extender. does nothing if already active. updates
- // the dll if necessary
- void activateScriptExtender();
+ // deactivate loading through proxy-dll. does nothing if se-loading wasn't active
+ void deactivateProxyDLL();
- // activate loading through proxy-dll. does nothing if already active. updates
- // the dll if necessary
- void activateProxyDLL();
+ // activate loading through script extender. does nothing if already active. updates
+ // the dll if necessary
+ void activateScriptExtender();
+
+ // activate loading through proxy-dll. does nothing if already active. updates
+ // the dll if necessary
+ void activateProxyDLL();
private:
- EMechanism m_SelectedMechanism;
+
+ EMechanism m_SelectedMechanism;
+
};
+
#endif // LOADMECHANISM_H