From 79fc6239fd82b9c17562dbb6f2ce948afa978efa Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Tue, 27 Sep 2016 14:43:14 +0100 Subject: [PATCH] #5617 Revert "Remove plugin interface from Arch" This reverts commit 4613edc17ced61d6aca80cff661323ede0cb9d30. --- src/lib/arch/Arch.h | 4 ++++ src/lib/arch/IArchFile.h | 14 ++++++++++++++ src/lib/arch/unix/ArchFileUnix.h | 3 +++ src/lib/arch/win32/ArchFileWindows.h | 3 +++ 4 files changed, 24 insertions(+) diff --git a/src/lib/arch/Arch.h b/src/lib/arch/Arch.h index 42be6eb8..3c5a23ff 100644 --- a/src/lib/arch/Arch.h +++ b/src/lib/arch/Arch.h @@ -50,6 +50,7 @@ # include "arch/win32/ArchSystemWindows.h" # include "arch/win32/ArchTaskBarWindows.h" # include "arch/win32/ArchTimeWindows.h" +# include "arch/win32/ArchPluginWindows.h" # include "arch/win32/ArchInternetWindows.h" #elif SYSAPI_UNIX # include "arch/unix/ArchConsoleUnix.h" @@ -65,6 +66,7 @@ # include "arch/unix/ArchSystemUnix.h" # include "arch/unix/ArchTaskBarXWindows.h" # include "arch/unix/ArchTimeUnix.h" +# include "arch/unix/ArchPluginUnix.h" # include "arch/unix/ArchInternetUnix.h" #endif @@ -120,10 +122,12 @@ public: static void setInstance(Arch* s) { s_instance = s; } + ARCH_PLUGIN& plugin() const { return (ARCH_PLUGIN&)m_plugin; } ARCH_INTERNET& internet() const { return (ARCH_INTERNET&)m_internet; } private: static Arch* s_instance; + ARCH_PLUGIN m_plugin; ARCH_INTERNET m_internet; }; diff --git a/src/lib/arch/IArchFile.h b/src/lib/arch/IArchFile.h index da6623f2..bcbba6e0 100644 --- a/src/lib/arch/IArchFile.h +++ b/src/lib/arch/IArchFile.h @@ -63,6 +63,13 @@ public: */ virtual std::string getLogDirectory() = 0; + //! Get plugins directory + /*! + Returns the plugin files directory. If no plugin directory is set, + this will return the plugin folder within the user's profile. + */ + virtual std::string getPluginDirectory() = 0; + //! Get user's profile directory /*! Returns the user's profile directory. If no profile directory is set, @@ -88,4 +95,11 @@ public: Returns the user's profile directory. */ virtual void setProfileDirectory(const String& s) = 0; + + //@} + //! Set the user's plugin directory + /* + Returns the user's plugin directory. + */ + virtual void setPluginDirectory(const String& s) = 0; }; diff --git a/src/lib/arch/unix/ArchFileUnix.h b/src/lib/arch/unix/ArchFileUnix.h index 6d3f1e3c..cbf78668 100644 --- a/src/lib/arch/unix/ArchFileUnix.h +++ b/src/lib/arch/unix/ArchFileUnix.h @@ -34,11 +34,14 @@ public: virtual std::string getSystemDirectory(); virtual std::string getInstalledDirectory(); virtual std::string getLogDirectory(); + virtual std::string getPluginDirectory(); virtual std::string getProfileDirectory(); virtual std::string concatPath(const std::string& prefix, const std::string& suffix); virtual void setProfileDirectory(const String& s); + virtual void setPluginDirectory(const String& s); private: String m_profileDirectory; + String m_pluginDirectory; }; diff --git a/src/lib/arch/win32/ArchFileWindows.h b/src/lib/arch/win32/ArchFileWindows.h index 032b796e..cdb8e4a2 100644 --- a/src/lib/arch/win32/ArchFileWindows.h +++ b/src/lib/arch/win32/ArchFileWindows.h @@ -34,11 +34,14 @@ public: virtual std::string getSystemDirectory(); virtual std::string getInstalledDirectory(); virtual std::string getLogDirectory(); + virtual std::string getPluginDirectory(); virtual std::string getProfileDirectory(); virtual std::string concatPath(const std::string& prefix, const std::string& suffix); virtual void setProfileDirectory(const String& s); + virtual void setPluginDirectory(const String& s); private: String m_profileDirectory; + String m_pluginDirectory; };