use std::env::consts::FAMILY;
use crate::enums::SystemFamily;
use crate::strategy::get_hw_strategy;
use crate::strategy::traits::HwStrategy;

pub mod strategy;
pub mod enums;
pub mod dtos;

pub fn get_system_family<'a>() -> Result<SystemFamily, &'a str> {
	match FAMILY {
		"windows" => Ok(SystemFamily::Windows),

		"macosx" => Ok(SystemFamily::Macosx),

		"unix" => Ok(SystemFamily::Linux),

		_ => Err("Unknown operating system family")
	}
}

fn main() {
	 let system_family = get_system_family().unwrap();

	 println!("{:?}", system_family);

	//  let hw = get_hw_strategy(system_family);
	//
	// //  let _bios = hw.get_bios();
	//
	// //  println!("bios {:?}: ", _bios);
	//
	// let _cpu = hw.get_cpu();
	//
	// println!("cpu: {:?}", _cpu);

	// let uuid = fs::read_to_string("/sys/class/dmi/id/board_serial").unwrap().trim().to_string();
	// println!("uuid {:?}", uuid);

	// println!("{:?}", FAMILY)

	let hw = get_hw_strategy(system_family);

	// let _bios = hw.get_bios();

	// println!("{:?}", _bios);

	// let _cpu = hw.get_cpu();

	// println!("{:?}", _cpu);

	// let _display = hw.get_display();

	// println!("display: {:?}", _display);

	// let _gpu =hw.get_gpu();

	// println!("gpu: {:?}", _gpu);

	// let _memory = hw.get_memory();
	// println!("memory: {:?}", _memory);

	// let _board = hw.get_motherboard();
	// println!("board: {:?}", _board);

	// let _os = hw.get_os();
	// println!("os: {:?}", _os);

	// let _storage = hw.get_storage();
	// println!("storage: {:?}", _storage)

	// let disk = fs::read_to_string("/proc/mounts").unwrap().trim().to_string();
	// println!("disk {:?}", disk);

	let hw_info = hw.get_hw();
	println!("hw_info: {:?}", hw_info);
}
