gonna redo CPUinfo class with workers and structs, started that

This commit is contained in:
Ben
2018-12-11 14:30:13 +00:00
parent 914a3457b5
commit 09f266a694
7 changed files with 65 additions and 2 deletions

22
include/common.h Normal file
View File

@@ -0,0 +1,22 @@
#pragma once
#include <vector>
#include <string>
#include <iostream>
std::vector<std::string> exec(std::string command) {
char buffer[128];
std::vector<std::string> result;
FILE* pipe = popen(command.c_str(), "r");
try {
while (fgets(buffer, sizeof buffer, pipe) != NULL) {
result.push_back(buffer);
}
} catch (...) {
pclose(pipe);
throw;
}
pclose(pipe);
return result;
}

View File

View File

@@ -0,0 +1,12 @@
#pragma once
#include <cpu.h>
#include <temp.h>
#include <gpu.h>
#include <memstat.h>
struct Sys {
unsigned long long SYSTEM_UPTIME;
unsigned short CPU_CORES;
};

2
include/temp.h Normal file
View File

@@ -0,0 +1,2 @@
#pragma once