opencv/platforms/android/service/engine/jni/BinderComponent/ProcReader.cpp

32 lines
534 B
C++
Raw Normal View History

#include "ProcReader.h"
#include "StringUtils.h"
#include <fstream>
using namespace std;
map<string, string> GetCpuInfo()
{
map<string, string> result;
ifstream f;
2012-10-17 07:18:30 +08:00
f.open("/proc/cpuinfo");
if (f.is_open())
{
while (!f.eof())
2012-10-17 07:18:30 +08:00
{
string tmp;
string key;
string value;
getline(f, tmp);
if (ParseString(tmp, key, value))
{
result[key] = value;
}
2012-10-17 07:18:30 +08:00
}
}
f.close();
2012-10-17 07:18:30 +08:00
return result;
}