Refactored command executors (better naming, documentation).

This commit is contained in:
Alexander Shaduri
2021-03-16 15:24:08 +04:00
parent cfc11bef6e
commit d74da816a1
31 changed files with 696 additions and 546 deletions
+5 -5
View File
@@ -99,7 +99,7 @@ void StorageDevice::clear_fetched(bool including_outputs) {
std::string StorageDevice::fetch_basic_data_and_parse(const std::shared_ptr<CmdexSync>& smartctl_ex)
std::string StorageDevice::fetch_basic_data_and_parse(const std::shared_ptr<CommandExecutor>& smartctl_ex)
{
if (this->test_is_active_)
return _("A test is currently being performed on this drive.");
@@ -254,7 +254,7 @@ std::string StorageDevice::parse_basic_data(bool do_set_properties, bool emit_si
std::string StorageDevice::fetch_data_and_parse(const std::shared_ptr<CmdexSync>& smartctl_ex)
std::string StorageDevice::fetch_data_and_parse(const std::shared_ptr<CommandExecutor>& smartctl_ex)
{
if (this->test_is_active_)
return _("A test is currently being performed on this drive.");
@@ -346,7 +346,7 @@ StorageDevice::ParseStatus StorageDevice::get_parse_status() const
std::string StorageDevice::set_smart_enabled(bool b, const std::shared_ptr<CmdexSync>& smartctl_ex)
std::string StorageDevice::set_smart_enabled(bool b, const std::shared_ptr<CommandExecutor>& smartctl_ex)
{
if (this->test_is_active_)
return _("A test is currently being performed on this drive.");
@@ -386,7 +386,7 @@ A mandatory SMART command failed: exiting. To continue, add one or more '-T perm
std::string StorageDevice::set_aodc_enabled(bool b, const std::shared_ptr<CmdexSync>& smartctl_ex)
std::string StorageDevice::set_aodc_enabled(bool b, const std::shared_ptr<CommandExecutor>& smartctl_ex)
{
if (this->test_is_active_) {
return _("A test is currently being performed on this drive.");
@@ -809,7 +809,7 @@ std::string StorageDevice::get_device_options() const
std::string StorageDevice::execute_device_smartctl(const std::string& command_options,
const std::shared_ptr<CmdexSync>& smartctl_ex, std::string& smartctl_output, bool check_type)
const std::shared_ptr<CommandExecutor>& smartctl_ex, std::string& smartctl_output, bool check_type)
{
// don't forbid running on currently tested drive - we need to call this from the test code.