From 52430face266fe677577e95a2f00a69270d984e9 Mon Sep 17 00:00:00 2001 From: Oskar Date: Thu, 24 Oct 2024 22:28:05 +0200 Subject: split up restore file with another function find_by_id and slight modification to directory_entry class --- trashsystem2.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'trashsystem2.hpp') diff --git a/trashsystem2.hpp b/trashsystem2.hpp index 83c1ead..5b1f116 100644 --- a/trashsystem2.hpp +++ b/trashsystem2.hpp @@ -60,17 +60,20 @@ private: class directory_entry { public: - directory_entry(std::filesystem::path dep, bool isd = false, bool isr = false, bool iso = false): - _de_path(dep), _is_dir(isd), _is_reg(isr), _is_other(iso) {} + directory_entry(std::filesystem::path dep, bool isd = false, bool isr = false, bool iso = false, TS_FUNCTION_RESULT isf = FUNCTION_SUCCESS): + _de_path(dep), _is_dir(isd), _is_reg(isr), _is_other(iso), _function_result(isf) {} bool is_reg() const { return _is_reg; } bool is_dir() const { return _is_dir; } bool is_other() const { return _is_other; } + TS_FUNCTION_RESULT get_function_result () const { return _function_result; } const std::filesystem::path &rget_path() const { return _de_path; } + void set_fail() { _function_result = FUNCTION_FAILURE; } private: std::filesystem::path _de_path; bool _is_dir = false; bool _is_reg = false; bool _is_other = false; + TS_FUNCTION_RESULT _function_result = FUNCTION_SUCCESS; }; class trashsys_log_info { -- cgit v1.2.3