You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.4 KiB
46 lines
1.4 KiB
#include "controler.h"
|
|
Back_Back::Back_Back() {}
|
|
void Back_Back::set_mode(string flag_mode) {
|
|
this->flag_mode = flag_mode;
|
|
}
|
|
|
|
void Back_Back::set_partition(string partition) {
|
|
this->partition = partition;
|
|
}
|
|
|
|
void Back_Back::set_sys_flag(string sys_flag) {
|
|
this->sys_flag = sys_flag;
|
|
}
|
|
|
|
bool Back_Back::wrapper_off_quotas(string quotas_type) {
|
|
bool flag_status = false;
|
|
quotas_type = this->handler_quotas_type(quotas_type);
|
|
if (flag_mode == "system") {
|
|
string cmd_hw = "";
|
|
string cmd_sw = "";
|
|
flag_status = obj_quotas_sys.off_quota(partition, cmd_hw, cmd_sw);
|
|
}
|
|
else if (flag_mode == "ubconfig") {
|
|
flag_status = obj_quotas_ubconfig.off_quota(partition, quotas_type, "disable");
|
|
}
|
|
return flag_status;
|
|
}
|
|
bool Back_Back::wrapper_on_quotas(string quotas_type) {
|
|
bool flag_status = false;
|
|
quotas_type = this->handler_quotas_type(quotas_type);
|
|
if (flag_mode == "system") {
|
|
string cmd_hw = "";
|
|
string cmd_sw = "";
|
|
flag_status = obj_quotas_sys.on_quota_hw(partition, cmd_hw, cmd_sw);
|
|
flag_status = obj_quotas_sys.wrapper_on_quotas(partition, quotas_type);
|
|
}
|
|
else if (flag_mode == "ubconfig") {
|
|
flag_status = obj_quotas_sys.wrapper_on_quotas(partition, quotas_type, "enable");
|
|
flag_status = obj_quotas_ubconfig.format_cmd_quotas();
|
|
}
|
|
return flag_status;
|
|
}
|
|
|
|
string Back_Back::handler_quotas_type(string quotas_type) {
|
|
return quotas_type;
|
|
} |