Need a C++ library for hardware information

This commit is contained in:
Ben
2018-12-17 16:35:11 +00:00
parent 2183e5939f
commit 034214efde
10 changed files with 72 additions and 47 deletions

View File

@@ -5,19 +5,4 @@
#include <iostream>
#include <unistd.h>
std::vector<std::string> execcommand(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;
}
std::vector<std::string> execcommand(std::string command);

View File

@@ -10,3 +10,14 @@ struct Sys {
unsigned short CPU_CORES;
};
class System {
public:
System();
Sys* getSystemSpec();
virtual ~System();
private:
Sys* m_Sys;
};
static System* System_Instance;