Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
CSystem.hpp
Go to the documentation of this file.
1#ifndef LIBS_CORE_CSYSTEM_HPP_
2#define LIBS_CORE_CSYSTEM_HPP_
3
4#include <cstdint>
5#include <string>
6
7class CSystem
8{
9public:
10 static void changeLanguage(const std::string &codeLanguage, const std::string &codeMessages,
11 const std::string &codeMonetary, const std::string &codeNumeric);
12 static bool commandPassword(const std::string &txtTitle, uint32_t timeOut, std::string *password);
13 static bool commandQuestion(const std::string &txtQuestion);
14 static int32_t commandWithCodeError(const std::string &command);
15 static void logger(const std::string &environment, const char *strFormat, ...)
16 __attribute__((format(printf, 2, 3)));
17 static void reboot();
18 static void sleepMilliseconds(uint64_t milliseconds);
19 static void shutdown();
20 static void getCpuInfo(std::string *stepping, std::string *model, std::string *family, std::string *processorType,
21 std::string *extendedModel, std::string *extendedFamily);
22 static std::string getCPUSerial();
23 static std::string getVolumeSerial();
24 static bool ping(const std::string &ipAddress, float timeOutInSec);
25 static bool startService(std::string_view serviceName);
26 static bool stopService(std::string_view serviceName);
27 static bool enableService(const std::string serviceName);
28 static bool isServiceRunning(std::string_view serviceName);
29 static void changeGmt(std::string_view gmt);
30};
31
32#endif /* LIBS_CORE_CSYSTEM_HPP_ */
Definition CSystem.hpp:8
static std::string getVolumeSerial()
Gets the volume serial. If it is not possible to get one, it provides "nvme0n1" as the default.
Definition CSystem.cpp:331
static void sleepMilliseconds(uint64_t milliseconds)
Generate a milliseconds sleep.
Definition CSystem.cpp:263
static bool commandPassword(const std::string &txtTitle, uint32_t timeOut, std::string *password)
Shows a password entry dialog.
Definition CSystem.cpp:167
static bool startService(std::string_view serviceName)
Definition CSystem.cpp:349
static void logger(const std::string &environment, const char *strFormat,...) __attribute__((format(printf
Create logs with the set of arguments provided.
Definition CSystem.cpp:234
static bool ping(const std::string &ipAddress, float timeOutInSec)
Ping the given IP address using the internal ping command.
Definition CSystem.cpp:398
static int32_t commandWithCodeError(const std::string &command)
Execute a system's command.
Definition CSystem.cpp:223
static bool enableService(const std::string serviceName)
Definition CSystem.cpp:361
static bool stopService(std::string_view serviceName)
Definition CSystem.cpp:355
static std::string getCPUSerial()
Returns the CPU serial.
Definition CSystem.cpp:311
static void changeGmt(std::string_view gmt)
Change the GMT area to the one given.
Definition CSystem.cpp:382
static bool commandQuestion(const std::string &txtQuestion)
Make a question on the screen.
Definition CSystem.cpp:208
static bool isServiceRunning(std::string_view serviceName)
Checks if a service is running.
Definition CSystem.cpp:372
static void getCpuInfo(std::string *stepping, std::string *model, std::string *family, std::string *processorType, std::string *extendedModel, std::string *extendedFamily)
Returns the CPU information.
Definition CSystem.cpp:289
static void changeLanguage(const std::string &codeLanguage, const std::string &codeMessages, const std::string &codeMonetary, const std::string &codeNumeric)
This function permit the user to change application's language.
Definition CSystem.cpp:140
static void static void reboot()
Begin a reboot process.
Definition CSystem.cpp:250
static void shutdown()
Begin a shutdown process.
Definition CSystem.cpp:271