parent
							
								
									68426f9c7e
								
							
						
					
					
						commit
						fd1001e359
					
				@ -0,0 +1,26 @@
 | 
				
			||||
#include "ubconfig_quotas.h"
 | 
				
			||||
 | 
				
			||||
namespace Quotas_ubconfig {
 | 
				
			||||
 | 
				
			||||
void Quotas_ubconfig::format_cmd_quotas_ubconfig(struct struct_quotas& _struct_quota) {
 | 
				
			||||
    string key = "DISK_QUOTA[";
 | 
				
			||||
    key += ":" + _struct_quota.device + "]";
 | 
				
			||||
    string value = _struct_quota.name + ":" + _struct_quota.cmd;
 | 
				
			||||
    (*map_gui_cfg)[key] = value;
 | 
				
			||||
}
 | 
				
			||||
 | 
				
			||||
void Quotas_ubconfig::off_quota_ubconfig(string partition, string quota_type) {
 | 
				
			||||
    string key = "DISK_QUOTA[" + quota_type + ":" + partition + "]";
 | 
				
			||||
    string value = "disable";
 | 
				
			||||
    (*map_gui_cfg)[key] = value;
 | 
				
			||||
}
 | 
				
			||||
void Quotas_ubconfig::set_map_gui(map_str_str &map_gui) {
 | 
				
			||||
    map_gui_cfg = &map_gui;
 | 
				
			||||
}
 | 
				
			||||
Quotas_ubconfig::Quotas_ubconfig() {
 | 
				
			||||
    map_hw_or_sw["ext2"] = "hw";
 | 
				
			||||
    map_hw_or_sw["ext3"] = "hw";
 | 
				
			||||
    map_hw_or_sw["nfs"] = "sw";
 | 
				
			||||
    map_hw_or_sw["NFS"] = "sw";
 | 
				
			||||
}
 | 
				
			||||
}
 | 
				
			||||
@ -0,0 +1,25 @@
 | 
				
			||||
#ifndef UBCONFIG_QUOTAS
 | 
				
			||||
#define UBCONFIG_QUOTAS
 | 
				
			||||
 | 
				
			||||
#include "project_lib.h"
 | 
				
			||||
#include "my_type.h"
 | 
				
			||||
#include "my_process.h"
 | 
				
			||||
#include "util.h"
 | 
				
			||||
 | 
				
			||||
namespace Quotas_ubconfig {
 | 
				
			||||
 | 
				
			||||
 | 
				
			||||
class Quotas_ubconfig{
 | 
				
			||||
    public:
 | 
				
			||||
        map_str_str map_hw_or_sw;
 | 
				
			||||
 | 
				
			||||
        map_str_str* map_gui_cfg;
 | 
				
			||||
        My_Process::My_Process_system obj_process_system = My_Process::My_Process_system();
 | 
				
			||||
        My_Process::My_Process_call obj_process_call = My_Process::My_Process_call();
 | 
				
			||||
    Quotas_ubconfig();
 | 
				
			||||
    void off_quota_ubconfig(string partition, string quota_type);
 | 
				
			||||
    void format_cmd_quotas_ubconfig(struct struct_quotas& _struct_quota);
 | 
				
			||||
    void set_map_gui(map_str_str &map_gui);
 | 
				
			||||
};
 | 
				
			||||
}
 | 
				
			||||
#endif
 | 
				
			||||
					Loading…
					
					
				
		Reference in new issue