diff options
author | saturneric <[email protected]> | 2023-11-07 07:18:06 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2023-11-07 07:18:06 +0000 |
commit | 3ad7fecdb6458fdd6f146bed19fe643c7f93e905 (patch) | |
tree | 522f7a5dd0389ad0771d01a50ea49ef646940894 /src/core/function/GlobalSettingStation.h | |
parent | refactor: improve the code structure of core (diff) | |
download | GpgFrontend-3ad7fecdb6458fdd6f146bed19fe643c7f93e905.tar.gz GpgFrontend-3ad7fecdb6458fdd6f146bed19fe643c7f93e905.zip |
refactor: remove CommonUtils at core
Diffstat (limited to 'src/core/function/GlobalSettingStation.h')
-rw-r--r-- | src/core/function/GlobalSettingStation.h | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/src/core/function/GlobalSettingStation.h b/src/core/function/GlobalSettingStation.h index fc0197be..18f42db1 100644 --- a/src/core/function/GlobalSettingStation.h +++ b/src/core/function/GlobalSettingStation.h @@ -62,71 +62,79 @@ class GPGFRONTEND_CORE_EXPORT GlobalSettingStation * * @return libconfig::Setting& */ - libconfig::Setting &GetMainSettings() noexcept; + auto GetMainSettings() noexcept -> libconfig::Setting &; /** * @brief Get the App Dir object * * @return std::filesystem::path */ - [[nodiscard]] std::filesystem::path GetAppDir() const; + [[nodiscard]] auto GetAppDir() const -> std::filesystem::path; /** * @brief Gets the application data directory. * @return Path to the application data directory. */ - [[nodiscard]] std::filesystem::path GetAppDataPath() const; + [[nodiscard]] auto GetAppDataPath() const -> std::filesystem::path; /** * @brief Get the Log Dir object * * @return std::filesystem::path */ - [[nodiscard]] std::filesystem::path GetLogDir() const; + [[nodiscard]] auto GetLogDir() const -> std::filesystem::path; /** * @brief Get the Standalone Database Dir object * * @return std::filesystem::path */ - [[nodiscard]] std::filesystem::path GetStandaloneDatabaseDir() const; + [[nodiscard]] auto GetStandaloneDatabaseDir() const -> std::filesystem::path; - [[nodiscard]] std::filesystem::path GetAppConfigPath() const; + [[nodiscard]] auto GetAppConfigPath() const -> std::filesystem::path; /** * @brief Get the Standalone Gpg Bin Dir object * * @return std::filesystem::path */ - [[nodiscard]] std::filesystem::path GetStandaloneGpgBinDir() const; + [[nodiscard]] auto GetStandaloneGpgBinDir() const -> std::filesystem::path; /** * @brief Get the Locale Dir object * * @return std::filesystem::path */ - [[nodiscard]] std::filesystem::path GetLocaleDir() const; + [[nodiscard]] auto GetLocaleDir() const -> std::filesystem::path; /** * @brief Get the Resource Dir object * * @return std::filesystem::path */ - [[nodiscard]] std::filesystem::path GetResourceDir() const; + [[nodiscard]] auto GetResourceDir() const -> std::filesystem::path; /** * @brief Get the Certs Dir object * * @return std::filesystem::path */ - [[nodiscard]] std::filesystem::path GetCertsDir() const; + [[nodiscard]] auto GetCertsDir() const -> std::filesystem::path; - [[nodiscard]] std::string GetLogFilesSize() const; + [[nodiscard]] auto GetLogFilesSize() const -> std::string; - [[nodiscard]] std::string GetDataObjectsFilesSize() const; + [[nodiscard]] auto GetDataObjectsFilesSize() const -> std::string; + /** + * @brief clear all log files + * + */ void ClearAllLogFiles() const; + /** + * @brief clear all data objects + * + */ void ClearAllDataObjects() const; /** @@ -142,7 +150,7 @@ class GPGFRONTEND_CORE_EXPORT GlobalSettingStation * @return The setting value. */ template <typename T> - T LookupSettings(std::string path, T default_value) noexcept { + auto LookupSettings(std::string path, T default_value) noexcept -> T { T value = default_value; try { value = static_cast<T>(GetMainSettings().lookup(path)); |