diff options
author | Saturn&Eric <[email protected]> | 2023-07-13 16:51:19 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2023-07-13 16:51:19 +0000 |
commit | 40bcaec6c8c0c363bf793745131a2e6d0274fd6d (patch) | |
tree | 8dc11045bee7caf8a1b936ee2203dd39bec59e07 /src/core/function/GlobalSettingStation.h | |
parent | Merge pull request #102 from CDmking/main (diff) | |
parent | Merge branch 'main' into dev/2.1.0/main (diff) | |
download | GpgFrontend-40bcaec6c8c0c363bf793745131a2e6d0274fd6d.tar.gz GpgFrontend-40bcaec6c8c0c363bf793745131a2e6d0274fd6d.zip |
Merge pull request #106 from saturneric/dev/2.1.0/main
Develop 2.1.1.4
Diffstat (limited to 'src/core/function/GlobalSettingStation.h')
-rw-r--r-- | src/core/function/GlobalSettingStation.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/core/function/GlobalSettingStation.h b/src/core/function/GlobalSettingStation.h index d70b3b63..80780f4b 100644 --- a/src/core/function/GlobalSettingStation.h +++ b/src/core/function/GlobalSettingStation.h @@ -29,6 +29,8 @@ #ifndef GPGFRONTEND_GLOBALSETTINGSTATION_H #define GPGFRONTEND_GLOBALSETTINGSTATION_H +#include <filesystem> + #include "GpgFrontendBuildInstallInfo.h" #include "core/GpgFrontendCore.h" #include "core/GpgFunctionObject.h" @@ -151,6 +153,14 @@ class GPGFRONTEND_CORE_EXPORT GlobalSettingStation return app_resource_path_ / "certs"; } + [[nodiscard]] std::string GetLogFilesSize() const; + + [[nodiscard]] std::string GetDataObjectsFilesSize() const; + + void ClearAllLogFiles() const; + + void ClearAllDataObjects() const; + /** * @brief sync the settings to the file * @@ -166,7 +176,7 @@ class GPGFRONTEND_CORE_EXPORT GlobalSettingStation std::filesystem::path app_log_path_ = app_data_path_ / "logs"; ///< Program Data Location std::filesystem::path app_data_objs_path_ = - app_data_path_ / "objs"; ///< Object storage path + app_data_path_ / "data_objs"; ///< Object storage path #ifdef LINUX_INSTALL_BUILD std::filesystem::path app_resource_path_ = @@ -200,6 +210,26 @@ class GPGFRONTEND_CORE_EXPORT GlobalSettingStation * */ void init_app_secure_key(); + + /** + * @brief + * + */ + int64_t get_files_size_at_path(std::filesystem::path path, + std::string filename_pattern) const; + + /** + * @brief + * + */ + std::string get_human_readable_size(int64_t size) const; + + /** + * @brief + * + */ + void delete_all_files(std::filesystem::path path, + std::string filename_pattern) const; }; } // namespace GpgFrontend |