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.
ubl-settings-diskquota/source/my_device.cc

29 lines
923 B

#include "my_device.h"
namespace Devices {
map_str_str Parted::get_parted() {
string cmd = "lsblk --fs --raw --output PATH,FSTYPE --exclude 7,11,253";
string response = obj_process_call.call_all_sections(cmd);
vector<string> vec_parted = Utils::split(response, '\n');
map_str_str dict_parted;
string key = "";
string value = "";
if (vec_parted.size()>1) {
vec_parted.erase(vec_parted.begin());
}
for (const string& str_parted : vec_parted) {
key = str_parted.substr(0, str_parted.find(" "));
if (str_parted.find(" ") != string::npos) {
value = str_parted.substr(str_parted.find(" ") + 1, str_parted.length());
if (value.length()>0) {
dict_parted[key] = value;
}
}
}
return dict_parted;
}
}