linux_systemutil.hpp
Go to the documentation of this file.
1 /**
2  * @author: Daniel Fuchs
3  * @contact: fuxeysolutions@gmail.com
4  *
5  * distributed under the MIT License (MIT).
6  * Copyright (c) Daniel Fuchs
7  *
8  */
9 #pragma once
10 
11 #include <iostream>
12 #include <string>
13 
14 
15 
16 class linuxUtil {
17 
18 public:
19 
20  static bool isDeviceOnline(std::string address);
21  static std::string getOSVersion_Signature(void);
22  static std::string getOsVersionString(void);
23  static std::string getIFaceMacAddress(std::string deviceName);
24  static int killProcessById(int pid, const std::string& procName);
25  static int getProcIdByName(const std::string& procName);
26  static bool startAppAsDaemon();
27  static uint64_t userAvailableFreeSpace();
28  static int64_t getTemperature(const std::string& thermalZone= "thermal_zone0");
29  static uint64_t getFreeDiskSpace(std::string absoluteFilePath);
30  static uint64_t getSysUpTime();
31  static uint32_t getNumOfThreadsByThisProcess();
32  static uint32_t getNumOfThreadsByPID(int Pid);
33 };
34 
linuxUtil::getFreeDiskSpace
static uint64_t getFreeDiskSpace(std::string absoluteFilePath)
Definition: linux_systemutil.cpp:139
linuxUtil::getIFaceMacAddress
static std::string getIFaceMacAddress(std::string deviceName)
Definition: linux_systemutil.cpp:254
linuxUtil::userAvailableFreeSpace
static uint64_t userAvailableFreeSpace()
Definition: linux_systemutil.cpp:168
linuxUtil::getNumOfThreadsByPID
static uint32_t getNumOfThreadsByPID(int Pid)
Definition: linux_systemutil.cpp:243
linuxUtil::getOsVersionString
static std::string getOsVersionString(void)
Definition: linux_systemutil.cpp:193
linuxUtil::getNumOfThreadsByThisProcess
static uint32_t getNumOfThreadsByThisProcess()
Definition: linux_systemutil.cpp:232
linuxUtil
Definition: linux_systemutil.hpp:16
linuxUtil::startAppAsDaemon
static bool startAppAsDaemon()
Definition: linux_systemutil.cpp:104
linuxUtil::getOSVersion_Signature
static std::string getOSVersion_Signature(void)
Definition: linux_systemutil.cpp:179
linuxUtil::getProcIdByName
static int getProcIdByName(const std::string &procName)
Definition: linux_systemutil.cpp:41
linuxUtil::getTemperature
static int64_t getTemperature(const std::string &thermalZone="thermal_zone0")
Definition: linux_systemutil.cpp:26
linuxUtil::isDeviceOnline
static bool isDeviceOnline(std::string address)
Definition: linux_systemutil.cpp:207
linuxUtil::getSysUpTime
static uint64_t getSysUpTime()
Definition: linux_systemutil.cpp:85
linuxUtil::killProcessById
static int killProcessById(int pid, const std::string &procName)
Definition: linux_systemutil.cpp:73