gonna redo CPUinfo class with workers and structs, started that
This commit is contained in:
22
include/common.h
Normal file
22
include/common.h
Normal 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;
|
||||
}
|
||||
|
||||
@@ -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
2
include/temp.h
Normal file
@@ -0,0 +1,2 @@
|
||||
#pragma once
|
||||
|
||||
Reference in New Issue
Block a user