Need a C++ library for hardware information
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user